Skip to content
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

Make build detect and complain when compile env is outdated #168

Open
qmonnet opened this issue Jan 24, 2025 · 2 comments
Open

Make build detect and complain when compile env is outdated #168

qmonnet opened this issue Jan 24, 2025 · 2 comments

Comments

@qmonnet
Copy link
Member

qmonnet commented Jan 24, 2025

$ just cargo build
  Downloaded rustc-hash v2.1.0
  Downloaded unicode-width v0.2.0
  Downloaded annotate-snippets v0.11.5
  Downloaded bindgen v0.71.1
  Downloaded 4 crates (557.3 KB) in 0.17s
   Compiling clang-sys v1.8.1
   Compiling anstyle v1.0.10
   Compiling bindgen v0.71.1
   Compiling unicode-width v0.2.0
   Compiling rustc-hash v2.1.0
   Compiling dpdk v0.1.0 (/home/qmo/dev/dataplane/dpdk)
   Compiling net v0.0.1 (/home/qmo/dev/dataplane/net)
   Compiling scratch v0.1.0 (/home/qmo/dev/dataplane/scratch)
   Compiling annotate-snippets v0.11.5
   Compiling dpdk-sys v0.0.1 (/home/qmo/dev/dataplane/dpdk-sys)
error[E0432]: unresolved import `rte_eth_tx_offload`
   --> dpdk/src/dev.rs:387:13
    |
387 |         use rte_eth_tx_offload::*;
    |             ^^^^^^^^^^^^^^^^^^ use of undeclared crate or module `rte_eth_tx_offload`

error[E0432]: unresolved import `rte_eth_tx_offload`
   --> dpdk/src/dev.rs:449:13
    |
449 |         use rte_eth_tx_offload::*;
    |             ^^^^^^^^^^^^^^^^^^ use of undeclared crate or module `rte_eth_tx_offload`

error[E0432]: unresolved import `rte_eth_tx_offload`
   --> dpdk/src/dev.rs:503:13
    |
503 |         use rte_eth_tx_offload::*;
    |             ^^^^^^^^^^^^^^^^^^ use of undeclared crate or module `rte_eth_tx_offload`

For more information about this error, try `rustc --explain E0432`.
error: could not compile `dpdk` (lib) due to 3 previous errors
warning: build failed, waiting for other jobs to finish...
error: Recipe `cargo` failed with exit code 101

... Woops, I just needed a just --yes refresh-compile-env. But for a second I thought there was a bug somewhere.

To improve user experience, we should be able to check and tell when the compile environment is outdated and needs a refresh, before trying to build the project.

We could also have a similar check that detects when the /nix link is missing on the system, and display a message more friendly than cc not found.

@daniel-noland
Copy link
Collaborator

daniel-noland commented Jan 25, 2025

This is a very solid point (which has also been on my mind for a while).

I have a few potential solutions in mind but they will take a day or two to cook up.

I think keeping the compile-env's packaged versions of clang and lld aligned with the user's rustc is going to be a trick (although I have some ideas on that as well). Likely we will need to add a toolchain file and keep that in sync with the compile-env

@qmonnet
Copy link
Member Author

qmonnet commented Jan 27, 2025

This is one option. Another one could be to check (before building) whether there's a newer version for the compile-env available online, and simply warn the user that their version is outdated. Then if we get a splat like the one above, it's easier to remember to check the compile-env version first?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants