-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add a way to add arbitrary environment variables to invocation of rustc from build scripts #2875
Comments
I just encountered this issue in the precise use case mentioned, i.e. embedding git sha into the binary for logging purposes. I think the possible workaround is to produce a file in |
bors
added a commit
that referenced
this issue
May 15, 2017
Allow cargo:rustc-env in build scripts This is an attempt to address issue #2875. Basically, I'm trying to allow build scripts to produce`cargo:rustc-env=FOO=foo` lines in their output. These are then translated to `env!()`-friendly env. vars that rustc is run with.
This should be closed? #3929 has been merged. |
the namespacing does not work well together with the requirement of
arbitrary here. What if I want to add, say, a search path for pkg-config?
Those surely wont take a variable prefixed with apparent garbage.
…On Jun 7, 2017 11:16, "kennytm" ***@***.***> wrote:
This should be closed? #3929
<#3929> has been merged.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2875 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AApc0j-nVkYCuZQRsCdEp-xudpix5lfSks5sBlxNgaJpZM4JMmba>
.
|
Quick reading of the code suggests there is no namesoacing going on, so
never mind me.
…On Jun 7, 2017 14:04, "Simonas Kazlauskas" ***@***.***> wrote:
the namespacing does not work well together with the requirement of
arbitrary here. What if I want to add, say, a search path for pkg-config?
Those surely wont take a variable prefixed with apparent garbage.
On Jun 7, 2017 11:16, "kennytm" ***@***.***> wrote:
> This should be closed? #3929
> <#3929> has been merged.
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#2875 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AApc0j-nVkYCuZQRsCdEp-xudpix5lfSks5sBlxNgaJpZM4JMmba>
> .
>
|
Yes @kennytm, this can be closed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
probably by printing something like
cargo:rustc-env...
Crates may use environment through macros like
env!
, therefore it is very useful to be able to set environment variables from build scripts. A potential use case would be to embed a git short-hash/version/build environment into the binary on build.The text was updated successfully, but these errors were encountered: