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

Export environment from vcvars64.bat #17

Closed
wants to merge 1 commit into from

Conversation

ecstatic-morse
Copy link
Contributor

@ecstatic-morse ecstatic-morse commented Aug 5, 2019

Resolves #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 (there's no equivalent to source in bash). Instead, we use a variant of a hack described on Stack Overflow.

Note the call to [Environment]::SetEnvironmentVariable. Simply setting variables in $env: will not persist beyond a single RUN command.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Put cl.exe and link.exe on PATH on Windows?
1 participant