-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use alternatives to symlinks on Windows #82
Conversation
sample/setup_service/src/common.rs
Outdated
@@ -59,11 +59,17 @@ pub fn cred_type_from_schema(schema_uid : &str) -> Result<&'static str, &'static | |||
use std::os::unix::fs::symlink as symlink_any; | |||
|
|||
#[cfg(windows)] | |||
use junction; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By adding use junction;
here, the cfg(windows) is no longer applied to symlink_any. (these cfg macros only apply to one line, they aren't blocks. I suggest moving the use junction
line back up to the top of the file, with it's own conditional macro.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(the problem is on linux cargo tries to build symlink_any, which fails)
sample/setup_service/src/common.rs
Outdated
@@ -59,11 +59,17 @@ pub fn cred_type_from_schema(schema_uid : &str) -> Result<&'static str, &'static | |||
use std::os::unix::fs::symlink as symlink_any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also could you move lines 58-59 to the top of the file at the same time, thanks.
Signed-off-by: Greg Zaverucha <gregz@microsoft.com>
On Windows,
replace directory symlinks with Junctions (junctions are only for directories and require no special privileges)
replace file symlinks with hard-links (hard links are only for files and require no special privileges)