Skip to content
This repository has been archived by the owner on Feb 25, 2019. It is now read-only.

Cargo-specific environment variables are missing #4

Open
tazjin opened this issue May 15, 2018 · 0 comments
Open

Cargo-specific environment variables are missing #4

tazjin opened this issue May 15, 2018 · 0 comments
Labels
bug Something isn't working

Comments

@tazjin
Copy link
Owner

tazjin commented May 15, 2018

Issue description

This issue was discovered in combination with the comrak issues
described in #2.

When building the comrak binary crate, the following line of code is
run (from here):

.about(crate_description!())

The crate_description! macro expands to a call to
env!("CARGO_PKG_DESCRIPTION"), which attempts to read the
CARGO_PKG_DESCRIPTION variable at compile-time.

However, this environment variable is not present in Carnix-builds
which will cause the build to error at that point.

In several of my projects I've applied a workaround for this that
uses overrideAttrs to "fake" the environment variable, as issue #2
meant that I could not figure out how to stop the binary from being
built:

comrak_0_2_9 = { features?(comrak_0_2_9_features {}) }: (comrak_0_2_9_ {
  # bla bla bla #
}).overrideAttrs (oldAttrs: rec { CARGO_PKG_DESCRIPTION = "dummy"; });

There may be other such environment variables that crates attempt to
use, but I haven't looked deeper into that yet.

@tazjin tazjin added the bug Something isn't working label May 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant