-
Notifications
You must be signed in to change notification settings - Fork 93
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
Put cl.exe
and link.exe
on PATH
on Windows?
#13
Labels
Comments
ecstatic-morse
changed the title
Put
Put Jul 24, 2019
cl.exe
and link.exe
on PATH
cl.exe
and link.exe
on PATH
on Windows?
The github repo
|
ecstatic-morse
added a commit
to ecstatic-morse/crates-build-env
that referenced
this issue
Aug 5, 2019
Resolves rust-lang#13. Some build scripts want to have the compiler and/or linker on the `PATH` (such as `blt.mond`). On Windows, this is usually achieved by running a Visual Studio `cmd` shell which sets the appropriate environement. However, I didn't see a simple way to do this in the `Dockerfile` for `powershell` (Windows has no equivalent of `source` in `bash`). Instead, we use a variant of a hack described on [Stack Overflow](https://stackoverflow.com/a/2124759). Note the call to `[Environment]::SetEnvironmentVariable`. Simply setting variables in `$env:` will not persist beyond a single `RUN` command.
ecstatic-morse
added a commit
to ecstatic-morse/crates-build-env
that referenced
this issue
Aug 5, 2019
Resolves rust-lang#13. Some build scripts want to have the compiler and/or linker on the `PATH` (such as `blt.mond`). On Windows, this is usually achieved by running a Visual Studio `cmd` shell which sets the appropriate environment. However, I didn't see a simple way to do this in the `Dockerfile` for `powershell` (Windows has no equivalent of `source` in `bash`). Instead, we use a variant of a hack described on [Stack Overflow](https://stackoverflow.com/a/2124759). Note the call to `[Environment]::SetEnvironmentVariable`. Simply setting variables in `$env:` will not persist beyond a single `RUN` command.
Note that with VS 2019 you could also try to use Developer PowerShell although it seems that's only available for x86 toolset. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The vast majority of crates use the
cc
crate for building native libraries. However, a few want the compiler and/or linker on thePATH
(see https://github.com/blt/mond). This seems pretty standard coming from the UNIX world, but the normal workflow on Windows seems to be sourcing avcvars.bat
file before you build something. I'm not sure if this should be the crate's responsibility or ours. This is complicated by the fact that powershell doesn't have asource
equivalent, so one has to do a contrived workaround to permanently save the configuration invcvars.bat
.The text was updated successfully, but these errors were encountered: