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
buildRustCrate: Replace hyphen with underscore in env variables #88054
Conversation
@ofborg build buildRustCrateTests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! The change looks good. Do you mind adding a test for this edge case? It will prevent us from regressing on this issue with the next refactoring.
I couldn't find any good docs on this, so just as a note, I actually ran that test suite by executing Running it against master, with the test case cherry-picked
Running against my patch branch
In any case, @andir, I've added a regression test. |
This fixes a bug that prevents encoding_c from building.
@ofborg build buildRustCrateTests |
Looks like all the tests are passing, and there is now a regression test… let's merge :) |
@andir Do you think this should be backported? I'm a bit cautious about it, seeing as it's infrastructure, but on the other hand as it's a quite significant bug…? |
Yeah, back porting sounds good.
…On Tue, May 26, 2020, 8:53 PM Léo Gaspard ***@***.***> wrote:
@andir <https://github.com/andir> Do you think this should be backported?
I'm a bit cautious about it, seeing as it's infrastructure, but on the
other hand as it's a quite significant bug…?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#88054 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAE365C6SGYLAPO7LPF56WTRTQF3XANCNFSM4ND4TNGQ>
.
|
* Add test case for include dir * buildRustCrate: replace hyphen with underscore in env This fixes a bug that prevents encoding_c from building. (cherry picked from commit c21cbf2)
Done :) |
This fixes a bug that prevents encoding_c from building.
Motivation for this change
I tried to use crate2nix to build a Rust package that depends on mozjs. This depends on encoding_c, which passes this output from
build.rs
:Which gets rewritten to this env file:
This is invalid; nix doesn't allow environment variables to contain hyphens. In any case, it also doesn't match up with how mozjs is trying to reference it here. The mozjs build script expects it to be spelled
DEPS_ENCODING_C_INCLUDE_DIR
, with all of it inSCREAMING_CASE
.Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)