Michał Górny (he/they) ∞🙀🚂🐧 on Nostr: #RustLang is just great. > Building this crate has an undeclared dependency on the ...
#RustLang is just great.
> Building this crate has an undeclared dependency on the `bpf-linker` binary.
Yes, if it wasn't bad enough that crates implicitly link to random shared system libraries (which at least you can note once the executable is compiled), they also can use any other undeclared dependency at build time. And the only way to learn about this is to put a lot of effort into checking every single one of a 1000 dependencies, or to be missing the external dependency and get a completely useless error message, then investigate the documentation of the crate in question.
```
error: failed to run custom build command for `mitmproxy-linux-ebpf v0.11.2 (/tmp/portage/net-proxy/mitmproxy-linux-0.11.2/work/mitmproxy_linux-0.11.2/mitmproxy-linux-ebpf)`
Caused by:
process didn't exit successfully: `/tmp/portage/net-proxy/mitmproxy-linux-0.11.2/work/mitmproxy_linux-0.11.2/target/debug/build/mitmproxy-linux-ebpf-60acb8a9e3d2f35a/build-script-build` (exit status: 101)
--- stderr
thread 'main' panicked at mitmproxy-linux-ebpf/build.rs:15:42:
called `Result::unwrap()` on an `Err` value: CannotFindBinaryPath
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
Yes, that's all you get. They didn't even bother adding a proper error handling, just a crash.
And of course the dependency uses this awful crate patching, because that's how you develop software these days: fork everything. And then it doesn't work, because apparently it requires a nightly compiler:
```
---- compile_test stdout ----
thread 'compile_test' panicked at tests/tests.rs:130:10:
failed to build sysroot: sysroot build failed; stderr:
warning: no edition set: defaulting to the 2015 edition while the latest is 2021
error: failed to run `rustc` to learn about target-specific information
Caused by:
process didn't exit successfully: `/usr/lib/rust/1.83.0/bin/rustc - --crate-name ___ --print=file-names -Zforce-unstable-if-unmarked
--cap-lints=warn -Aunexpected_cfgs -Cdebuginfo=2 --target bpfel-unknown-none --crate-type bin --crate-type rlib --crate-type dylib --cr
ate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg`
(exit status: 1)
--- stderr
error: the option `Z` is only accepted on the nightly compiler
help: consider switching to a nightly toolchain: `rustup default nightly`
note: selecting a toolchain with `+toolchain` arguments require a rustup proxy; see <https://rust-lang.github.io/rustup/concepts/inde
x.html>
note: for more information about Rust's stability policy, see <https://doc.rust-lang.org/book/appendix-07-nightly-rust.html#unstable-features>
error: 1 nightly option were parsed
```
So no, you can't build #mitmproxy without a nightly Rust toolchain anymore. And I've literally revived that package on Tuesday, and I regret it already.
#Gentoo
> Building this crate has an undeclared dependency on the `bpf-linker` binary.
Yes, if it wasn't bad enough that crates implicitly link to random shared system libraries (which at least you can note once the executable is compiled), they also can use any other undeclared dependency at build time. And the only way to learn about this is to put a lot of effort into checking every single one of a 1000 dependencies, or to be missing the external dependency and get a completely useless error message, then investigate the documentation of the crate in question.
```
error: failed to run custom build command for `mitmproxy-linux-ebpf v0.11.2 (/tmp/portage/net-proxy/mitmproxy-linux-0.11.2/work/mitmproxy_linux-0.11.2/mitmproxy-linux-ebpf)`
Caused by:
process didn't exit successfully: `/tmp/portage/net-proxy/mitmproxy-linux-0.11.2/work/mitmproxy_linux-0.11.2/target/debug/build/mitmproxy-linux-ebpf-60acb8a9e3d2f35a/build-script-build` (exit status: 101)
--- stderr
thread 'main' panicked at mitmproxy-linux-ebpf/build.rs:15:42:
called `Result::unwrap()` on an `Err` value: CannotFindBinaryPath
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
Yes, that's all you get. They didn't even bother adding a proper error handling, just a crash.
And of course the dependency uses this awful crate patching, because that's how you develop software these days: fork everything. And then it doesn't work, because apparently it requires a nightly compiler:
```
---- compile_test stdout ----
thread 'compile_test' panicked at tests/tests.rs:130:10:
failed to build sysroot: sysroot build failed; stderr:
warning: no edition set: defaulting to the 2015 edition while the latest is 2021
error: failed to run `rustc` to learn about target-specific information
Caused by:
process didn't exit successfully: `/usr/lib/rust/1.83.0/bin/rustc - --crate-name ___ --print=file-names -Zforce-unstable-if-unmarked
--cap-lints=warn -Aunexpected_cfgs -Cdebuginfo=2 --target bpfel-unknown-none --crate-type bin --crate-type rlib --crate-type dylib --cr
ate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg`
(exit status: 1)
--- stderr
error: the option `Z` is only accepted on the nightly compiler
help: consider switching to a nightly toolchain: `rustup default nightly`
note: selecting a toolchain with `+toolchain` arguments require a rustup proxy; see <https://rust-lang.github.io/rustup/concepts/inde
x.html>
note: for more information about Rust's stability policy, see <https://doc.rust-lang.org/book/appendix-07-nightly-rust.html#unstable-features>
error: 1 nightly option were parsed
```
So no, you can't build #mitmproxy without a nightly Rust toolchain anymore. And I've literally revived that package on Tuesday, and I regret it already.
#Gentoo