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

rust: cleaner rust target-applies-to-host fix #6104

Merged
merged 1 commit into from
Jan 23, 2022

Conversation

jameshilliard
Copy link
Contributor

Looks like we can set this without passing a command line option.

Looks like we can set this without passing a command line option.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
@heitbaum
Copy link
Contributor

heitbaum commented Jan 9, 2022

@jameshilliard - sorry to hijack your PR - whilst you are revisiting rust could you look at how to teach rust to use $HOSTCC instead of cc?

Our https://github.com/LibreELEC/LibreELEC.tv/blob/master/tools/docker/focal/Dockerfile does not include cc (I have updated the other places where cc Was being used inadvertently - but a bit stuck on fixing rust.)

I tried a few things like below with no success yet.

-  cargo build \
+  cargo update
+  export CC=/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/toolchain
/bin/x86_64-libreelec-linux-gnu-gcc
+  RUST_LOG=debug cargo build \
     ${CARGO_Z_TARGET_APPLIES_TO_HOST} \
-    --release \
+    --all-features \
     --locked \
-    --all-features
+    --release \
+    --verbose

rust Error

error: linker `cc` not found
  |
  = note: No such file or directory (os error 2)

error: could not compile `log` due to previous error

Caused by:
  process didn't exit successfully: `rustc --crate-name build_script_build /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/build/rust-1.57.0/cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.14/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=0 -C debug-assertions=off --cfg 'feature="std"' -C metadata=912dbdd2dbc7a629 -C extra-filename=-912dbdd2dbc7a629 --out-dir /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/build/bottom-0.6.6/.x86_64-libreelec-linux-gnu/release/build/log-912dbdd2dbc7a629 -L dependency=/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/build/bottom-0.6.6/.x86_64-libreelec-linux-gnu/release/deps --cap-lints allow` (exit status: 1)
warning: build failed, waiting for other jobs to finish...
error: build failed
FAILURE: s/build bottom during make_target (package.mk)
*********** FAILED COMMAND ***********
RUST_LOG=debug cargo build ${CARGO_Z_TARGET_APPLIES_TO_HOST} --all-features --locked --release --verbose
**************************************

@jameshilliard
Copy link
Contributor Author

jameshilliard commented Jan 9, 2022

Maybe needs to be set in the host-config?

You probably need to do something like this to enable it in stable:

__CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS="nightly"
CARGO_UNSTABLE_TARGET_APPLIES_TO_HOST="true"
CARGO_UNSTABLE_HOST_CONFIG="true"

@CvH CvH requested a review from heitbaum January 9, 2022 10:19
@CvH CvH merged commit b725090 into LibreELEC:master Jan 23, 2022
@jameshilliard jameshilliard deleted the target-host-env branch January 25, 2022 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants