-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Closed
Milestone
Description
@kballard pointed out in IRC that the argument types for std::run::Process::new and std::unstable::dynamic_library::open_external are wrong for a couple reasons:
- They don't quite work like proper paths.
Process::newwraps the syscallexecvp, which looks in the current directory for"./foo", but in thePATHsearch paths for"foo".open_externalusesdlopen, does the same thing with theDL_LIBRARY_PATHorDYLD_LIBRARY_PATHenvironment variables. SincePath::newautomatically normalizes the paths, it turns a local reference of"./foo"into"foo", which changes the semantics of the syscall. - In the case of
Process::new, it uses~strfor the program and arguments, but on Unix paths have no encoding. - In the case of
dynamic_library::open_external, on Macs you can embed special dyld macros as in"@executable_path/../foo", which will look for a library relative to the location of the executable.
Because of these issues, I feel that the only real option is to have those methods take &[u8], or a trait that can produce one, like std::path::BytesContainer.
schneiderfelipe
Metadata
Metadata
Assignees
Labels
No labels