Skip to content
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

move platform dependent calls from hab to core #1264

Merged
merged 1 commit into from
Sep 20, 2016
Merged

Conversation

smurawski
Copy link
Contributor

First steps to getting a functional hab command on Windows.

  • wrap std::os::unix::ffi::OsStrExt and add a windows equal
  • wrap std::os::unix::symlink and add a windows mock. There are windows symlink calls but they differ for file and directory.

With this changeset, hab compiles but panics due to calling unimplemented user resolution from core.

ref: #1192

Signed-off-by: Steven Murawski [email protected]

wrap std::os::unix::ffi::OsStrExt and add a windows equal
wrap std::os::unix::symlink and add a windows mock.  There are windows symlink calls but they differ for file and directory.

Signed-off-by: Steven Murawski <[email protected]>
}
}

pub fn symlink<P: AsRef<Path>, Q: AsRef<Path>>(src: P, dst: Q) -> io::Result<()> {
unimplemented!();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are Junctions still a thing in Windows? How do they achieve symlinks these days (if at all)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Junctions are still a thing. the rust standard library has functions for the symlinks in windows, but they require you to determine if the source is a directory or file and call the specific function. Shouldn't be hard to implement here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Junctions can cross drive boundaries and are the only link type on windows that can do directory links. Hard links have to be on the same physical and logical volume and can only reference individual files.

https://msdn.microsoft.com/en-us/library/windows/desktop/aa365006(v=vs.85).aspx

@reset reset merged commit 56f222d into master Sep 20, 2016
@reset
Copy link
Collaborator

reset commented Sep 20, 2016

gif-keyboard-13850742219115196093

Great work man, so excited for hab on Windows!

@reset reset deleted the smurawski/hab_win branch September 20, 2016 19:24
@eeyun eeyun added C-feature and removed Feature labels Jun 6, 2017
@christophermaier christophermaier added Type: Feature Issues that describe a new desired feature and removed C-feature labels Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Issues that describe a new desired feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants