rustcoreutils/posixutils-rs

Broken compilation due to missing environment variable

Opened this issue · 0 comments

Running

cargo \
	install \
	--git \
	https://github.com/rustcoreutils/posixutils-rs \
	--locked \
	--profile \
	release \
	--tag \
	v0.2.2 \
	-- \
	posixutils-text

yields these errors:

error: environment variable `PROJECT_NAME` not defined at compile time
   --> text/./comm.rs:149:16
    |
149 |     textdomain(env!("PROJECT_NAME"))?;
    |                ^^^^^^^^^^^^^^^^^^^^
    |
    = help: use `std::env::var("PROJECT_NAME")` to read the variable at run time
    = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: environment variable `PROJECT_NAME` not defined at compile time
   --> text/./expand.rs:136:16
    |
136 |     textdomain(env!("PROJECT_NAME"))?;
    |                ^^^^^^^^^^^^^^^^^^^^
    |
    = help: use `std::env::var("PROJECT_NAME")` to read the variable at run time
    = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: environment variable `PROJECT_NAME` not defined at compile time
   --> text/./expand.rs:137:29
    |
137 |     bind_textdomain_codeset(env!("PROJECT_NAME"), "UTF-8")?;
    |                             ^^^^^^^^^^^^^^^^^^^^
    |
    = help: use `std::env::var("PROJECT_NAME")` to read the variable at run time
    = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: environment variable `PROJECT_NAME` not defined at compile time
   --> text/./comm.rs:150:29
    |
150 |     bind_textdomain_codeset(env!("PROJECT_NAME"), "UTF-8")?;
    |                             ^^^^^^^^^^^^^^^^^^^^
    |
    = help: use `std::env::var("PROJECT_NAME")` to read the variable at run time
    = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: environment variable `PROJECT_NAME` not defined at compile time
   --> text/./tail.rs:476:16
    |
476 |     textdomain(env!("PROJECT_NAME"))?;
    |                ^^^^^^^^^^^^^^^^^^^^
    |
    = help: use `std::env::var("PROJECT_NAME")` to read the variable at run time
    = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: environment variable `PROJECT_NAME` not defined at compile time
   --> text/./tail.rs:477:29
    |
477 |     bind_textdomain_codeset(env!("PROJECT_NAME"), "UTF-8")?;
    |                             ^^^^^^^^^^^^^^^^^^^^
    |
    = help: use `std::env::var("PROJECT_NAME")` to read the variable at run time
    = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: environment variable `PROJECT_NAME` not defined at compile time
   --> text/./paste.rs:423:16
    |
423 |     textdomain(env!("PROJECT_NAME"))?;
    |                ^^^^^^^^^^^^^^^^^^^^
    |
    = help: use `std::env::var("PROJECT_NAME")` to read the variable at run time
    = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: environment variable `PROJECT_NAME` not defined at compile time
   --> text/./paste.rs:424:29
    |
424 |     bind_textdomain_codeset(env!("PROJECT_NAME"), "UTF-8")?;
    |                             ^^^^^^^^^^^^^^^^^^^^
    |
    = help: use `std::env::var("PROJECT_NAME")` to read the variable at run time
    = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: environment variable `PROJECT_NAME` not defined at compile time
   --> text/./wc.rs:173:16
    |
173 |     textdomain(env!("PROJECT_NAME"))?;
    |                ^^^^^^^^^^^^^^^^^^^^
    |
    = help: use `std::env::var("PROJECT_NAME")` to read the variable at run time
    = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: environment variable `PROJECT_NAME` not defined at compile time
   --> text/./wc.rs:174:29
    |
174 |     bind_textdomain_codeset(env!("PROJECT_NAME"), "UTF-8")?;
    |                             ^^^^^^^^^^^^^^^^^^^^
    |
    = help: use `std::env::var("PROJECT_NAME")` to read the variable at run time
    = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: environment variable `PROJECT_NAME` not defined at compile time
   --> text/./head.rs:147:16
    |
147 |     textdomain(env!("PROJECT_NAME"))?;
    |                ^^^^^^^^^^^^^^^^^^^^
    |
    = help: use `std::env::var("PROJECT_NAME")` to read the variable at run time
    = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: environment variable `PROJECT_NAME` not defined at compile time
   --> text/./head.rs:148:29
    |
148 |     bind_textdomain_codeset(env!("PROJECT_NAME"), "UTF-8")?;
    |                             ^^^^^^^^^^^^^^^^^^^^
    |
    = help: use `std::env::var("PROJECT_NAME")` to read the variable at run time
    = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: environment variable `PROJECT_NAME` not defined at compile time
    --> text/./sort.rs:1006:16
     |
1006 |     textdomain(env!("PROJECT_NAME"))?;
     |                ^^^^^^^^^^^^^^^^^^^^
     |
     = help: use `std::env::var("PROJECT_NAME")` to read the variable at run time
     = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: environment variable `PROJECT_NAME` not defined at compile time
    --> text/./sort.rs:1007:29
     |
1007 |     bind_textdomain_codeset(env!("PROJECT_NAME"), "UTF-8")?;
     |                             ^^^^^^^^^^^^^^^^^^^^
     |
     = help: use `std::env::var("PROJECT_NAME")` to read the variable at run time
     = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: environment variable `PROJECT_NAME` not defined at compile time
   --> text/./tr.rs:292:16
    |
292 |     textdomain(env!("PROJECT_NAME"))?;
    |                ^^^^^^^^^^^^^^^^^^^^
    |
    = help: use `std::env::var("PROJECT_NAME")` to read the variable at run time
    = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: environment variable `PROJECT_NAME` not defined at compile time
   --> text/./tr.rs:293:29
    |
293 |     bind_textdomain_codeset(env!("PROJECT_NAME"), "UTF-8")?;
    |                             ^^^^^^^^^^^^^^^^^^^^
    |
    = help: use `std::env::var("PROJECT_NAME")` to read the variable at run time
    = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: environment variable `PROJECT_NAME` not defined at compile time
   --> text/./diff.rs:144:16
    |
144 |     textdomain(env!("PROJECT_NAME")).unwrap();
    |                ^^^^^^^^^^^^^^^^^^^^
    |
    = help: use `std::env::var("PROJECT_NAME")` to read the variable at run time
    = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: environment variable `PROJECT_NAME` not defined at compile time
   --> text/./diff.rs:145:29
    |
145 |     bind_textdomain_codeset(env!("PROJECT_NAME"), "UTF-8").unwrap();
    |                             ^^^^^^^^^^^^^^^^^^^^
    |
    = help: use `std::env::var("PROJECT_NAME")` to read the variable at run time
    = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: environment variable `PROJECT_NAME` not defined at compile time
   --> text/./grep.rs:491:16
    |
491 |     textdomain(env!("PROJECT_NAME"))?;
    |                ^^^^^^^^^^^^^^^^^^^^
    |
    = help: use `std::env::var("PROJECT_NAME")` to read the variable at run time
    = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: environment variable `PROJECT_NAME` not defined at compile time
   --> text/./grep.rs:492:29
    |
492 |     bind_textdomain_codeset(env!("PROJECT_NAME"), "UTF-8")?;
    |                             ^^^^^^^^^^^^^^^^^^^^
    |
    = help: use `std::env::var("PROJECT_NAME")` to read the variable at run time
    = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: environment variable `PROJECT_NAME` not defined at compile time
   --> text/./pr.rs:535:16
    |
535 |     textdomain(env!("PROJECT_NAME")).unwrap();
    |                ^^^^^^^^^^^^^^^^^^^^
    |
    = help: use `std::env::var("PROJECT_NAME")` to read the variable at run time
    = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: environment variable `PROJECT_NAME` not defined at compile time
   --> text/./pr.rs:536:29
    |
536 |     bind_textdomain_codeset(env!("PROJECT_NAME"), "UTF-8").unwrap();
    |                             ^^^^^^^^^^^^^^^^^^^^
    |
    = help: use `std::env::var("PROJECT_NAME")` to read the variable at run time
    = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: environment variable `PROJECT_NAME` not defined at compile time
   --> text/./nl.rs:313:16
    |
313 |     textdomain(env!("PROJECT_NAME")).unwrap();
    |                ^^^^^^^^^^^^^^^^^^^^
    |
    = help: use `std::env::var("PROJECT_NAME")` to read the variable at run time
    = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: environment variable `PROJECT_NAME` not defined at compile time
   --> text/./nl.rs:314:29
    |
314 |     bind_textdomain_codeset(env!("PROJECT_NAME"), "UTF-8").unwrap();
    |                             ^^^^^^^^^^^^^^^^^^^^
    |
    = help: use `std::env::var("PROJECT_NAME")` to read the variable at run time
    = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile `posixutils-text` (bin "expand") due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: could not compile `posixutils-text` (bin "comm") due to 2 previous errors
error: could not compile `posixutils-text` (bin "head") due to 2 previous errors
error: could not compile `posixutils-text` (bin "wc") due to 2 previous errors
error: could not compile `posixutils-text` (bin "paste") due to 2 previous errors
error: could not compile `posixutils-text` (bin "tail") due to 2 previous errors
error: could not compile `posixutils-text` (bin "grep") due to 2 previous errors
error: could not compile `posixutils-text` (bin "sort") due to 2 previous errors
error: could not compile `posixutils-text` (bin "nl") due to 2 previous errors
error: could not compile `posixutils-text` (bin "tr") due to 2 previous errors
error: could not compile `posixutils-text` (bin "pr") due to 2 previous errors
error: could not compile `posixutils-text` (bin "diff") due to 2 previous errors
error: failed to compile `posixutils-text v0.2.2 (https://github.com/rustcoreutils/posixutils-rs?tag=v0.2.2#1dcd701b)`, intermediate artifacts can be found at `/tmp/cargo-install2TKkDZ`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

I'm not sure I understand the point of using environment variables here. It increases the number of ways that the project can be misconfigured, as this bug demonstrates. If there's concern about unnecessary dependencies, there could just be a crate that has no code and only defines constants that are used by every program.