Skip to content

include doesn't support UNC paths on Windows #169

Closed
@kornelski

Description

@kornelski
let cc = gcc::Config::new();
cc.include(std::fs::canonicalize("."));

Doesn't add absolute path of "." as the include dir (tested on Win10, MSVC). This is because Rust's canonicalize() makes a UNC path such as \\?\C:\Foo.

Stripping the \\?\ prefix seems to solve the problem, but I don't know enough about UNC paths to know whether that's a good solution.

I use fs::canonicalize() as the easiest way to get absolute paths in build scripts of link/-sys dependencies to reliably pass the paths in env vars for other packages to consume, and it works well on Unix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions