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

Add support for CROSS_CONFIG environment var #597

Merged
merged 1 commit into from
Jan 25, 2022

Conversation

UebelAndre
Copy link
Contributor

This allows for the use of a CROSS_CONFIG environment variable to explicitly set the path to a Cross.toml file to use for builds.

@UebelAndre UebelAndre requested review from Dylan-DPC-zz and a team as code owners October 7, 2021 23:55
@Emilgardis
Copy link
Member

Emilgardis commented Oct 8, 2021

@UebelAndre
Copy link
Contributor Author

I can't imagine this change introduced that. What would be required to have this merged?

@Emilgardis
Copy link
Member

You can safely bump the MSRV of this binary to 1.47 here https://github.com/rust-embedded/cross/blob/2b2a01220c73ae517129019d436d382412d1928b/azure-pipelines.yml#L17 (and in README)

The regression is in libc, I've reported it upstream rust-lang/libc#2436

@UebelAndre
Copy link
Contributor Author

You can safely bump the MSRV of this binary to 1.47 here

https://github.com/rust-embedded/cross/blob/2b2a01220c73ae517129019d436d382412d1928b/azure-pipelines.yml#L17
(and in README)

The regression is in libc, I've reported it upstream rust-lang/libc#2436

Would that same issue be related to this error?

error: linking with `emcc` failed: exit code: 1
  |
  = note: "emcc" "-s" "DISABLE_EXCEPTION_CATCHING=0" "-L" "/rust/lib/rustlib/asmjs-unknown-emscripten/lib" "-L" "/rust/lib/rustlib/asmjs-unknown-emscripten/lib/self-contained" "/target/asmjs-unknown-emscripten/debug/deps/hello-a5dd14cceb9ca813.1z9a5f30iaevemzj.rcgu.o" "/target/asmjs-unknown-emscripten/debug/deps/hello-a5dd14cceb9ca813.2i0g57tmb9o7lxa9.rcgu.o" "/target/asmjs-unknown-emscripten/debug/deps/hello-a5dd14cceb9ca813.2wqjtf41dm2feqr1.rcgu.o" "/target/asmjs-unknown-emscripten/debug/deps/hello-a5dd14cceb9ca813.3ctwz101gbmmyf3x.rcgu.o" "/target/asmjs-unknown-emscripten/debug/deps/hello-a5dd14cceb9ca813.4mdx1bj9pj046nkg.rcgu.o" "/target/asmjs-unknown-emscripten/debug/deps/hello-a5dd14cceb9ca813.immp4iemvqu7pim.rcgu.o" "/target/asmjs-unknown-emscripten/debug/deps/hello-a5dd14cceb9ca813.rt6nfu250v8n96p.rcgu.o" "/target/asmjs-unknown-emscripten/debug/deps/hello-a5dd14cceb9ca813.zw2yn2wcclgzi79.rcgu.o" "-o" "/target/asmjs-unknown-emscripten/debug/deps/hello-a5dd14cceb9ca813.js" "-s" "EXPORTED_FUNCTIONS=[\"_main\",\"_rust_eh_personality\"]" "/target/asmjs-unknown-emscripten/debug/deps/hello-a5dd14cceb9ca813.4o6t09uubnf1yox7.rcgu.o" "-O0" "--memory-init-file" "0" "-g0" "-s" "DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=[]" "-L" "/target/asmjs-unknown-emscripten/debug/deps" "-L" "/target/debug/deps" "-L" "/rust/lib/rustlib/asmjs-unknown-emscripten/lib" "/rust/lib/rustlib/asmjs-unknown-emscripten/lib/libstd-e7f636581c0e4496.rlib" "/rust/lib/rustlib/asmjs-unknown-emscripten/lib/libpanic_unwind-e48fa0950e5d5420.rlib" "/rust/lib/rustlib/asmjs-unknown-emscripten/lib/librustc_demangle-27cb19c3fd5f8feb.rlib" "/rust/lib/rustlib/asmjs-unknown-emscripten/lib/libhashbrown-1ddbf30497fbe083.rlib" "/rust/lib/rustlib/asmjs-unknown-emscripten/lib/librustc_std_workspace_alloc-ba9b98c8fb8edf84.rlib" "/rust/lib/rustlib/asmjs-unknown-emscripten/lib/libunwind-1b385716cbe67738.rlib" "/rust/lib/rustlib/asmjs-unknown-emscripten/lib/libcfg_if-4c86c9da4d788170.rlib" "/rust/lib/rustlib/asmjs-unknown-emscripten/lib/liblibc-d89223679008c3ff.rlib" "/rust/lib/rustlib/asmjs-unknown-emscripten/lib/liballoc-5dd772569648ca0f.rlib" "/rust/lib/rustlib/asmjs-unknown-emscripten/lib/librustc_std_workspace_core-de6ce0209a89d692.rlib" "/rust/lib/rustlib/asmjs-unknown-emscripten/lib/libcore-870a8fccfe819f16.rlib" "/rust/lib/rustlib/asmjs-unknown-emscripten/lib/libcompiler_builtins-38e90ef5c6ec8d7c.rlib" "-l" "c" "-s" "ERROR_ON_UNDEFINED_SYMBOLS=1" "-s" "ASSERTIONS=1" "-s" "ABORTING_MALLOC=0" "-Wl,--fatal-warnings" "-s" "WASM=0"
  = note: cache:INFO: generating system library: libc++abi.a... (this will be cached in "/emsdk_portable/.data/cache/wasm-obj/libc++abi.a" for subsequent builds)
          cache:INFO:  - ok
          wasm-ld: error: std-e7f636581c0e4496.std.50xlqypk-cgu.0.rcgu.o: Bad relocation type: 
          shared:ERROR: '/emsdk_portable/upstream/bin/wasm-ld -o /tmp/emscripten_temp_CsyqHo/hello-a5dd14cceb9ca813.wasm --allow-undefined --lto-O0 -L/rust/lib/rustlib/asmjs-unknown-emscripten/lib -L/rust/lib/rustlib/asmjs-unknown-emscripten/lib/self-contained /target/asmjs-unknown-emscripten/debug/deps/hello-a5dd14cceb9ca813.1z9a5f30iaevemzj.rcgu.o /target/asmjs-unknown-emscripten/debug/deps/hello-a5dd14cceb9ca813.2i0g57tmb9o7lxa9.rcgu.o /target/asmjs-unknown-emscripten/debug/deps/hello-a5dd14cceb9ca813.2wqjtf41dm2feqr1.rcgu.o /target/asmjs-unknown-emscripten/debug/deps/hello-a5dd14cceb9ca813.3ctwz101gbmmyf3x.rcgu.o /target/asmjs-unknown-emscripten/debug/deps/hello-a5dd14cceb9ca813.4mdx1bj9pj046nkg.rcgu.o /target/asmjs-unknown-emscripten/debug/deps/hello-a5dd14cceb9ca813.immp4iemvqu7pim.rcgu.o /target/asmjs-unknown-emscripten/debug/deps/hello-a5dd14cceb9ca813.rt6nfu250v8n96p.rcgu.o /target/asmjs-unknown-emscripten/debug/deps/hello-a5dd14cceb9ca813.zw2yn2wcclgzi79.rcgu.o /target/asmjs-unknown-emscripten/debug/deps/hello-a5dd14cceb9ca813.4o6t09uubnf1yox7.rcgu.o -L/target/asmjs-unknown-emscripten/debug/deps -L/target/debug/deps -L/rust/lib/rustlib/asmjs-unknown-emscripten/lib /rust/lib/rustlib/asmjs-unknown-emscripten/lib/libstd-e7f636581c0e4496.rlib /rust/lib/rustlib/asmjs-unknown-emscripten/lib/libpanic_unwind-e48fa0950e5d5420.rlib /rust/lib/rustlib/asmjs-unknown-emscripten/lib/librustc_demangle-27cb19c3fd5f8feb.rlib /rust/lib/rustlib/asmjs-unknown-emscripten/lib/libhashbrown-1ddbf30497fbe083.rlib /rust/lib/rustlib/asmjs-unknown-emscripten/lib/librustc_std_workspace_alloc-ba9b98c8fb8edf84.rlib /rust/lib/rustlib/asmjs-unknown-emscripten/lib/libunwind-1b385716cbe67738.rlib /rust/lib/rustlib/asmjs-unknown-emscripten/lib/libcfg_if-4c86c9da4d788170.rlib /rust/lib/rustlib/asmjs-unknown-emscripten/lib/liblibc-d89223679008c3ff.rlib /rust/lib/rustlib/asmjs-unknown-emscripten/lib/liballoc-5dd772569648ca0f.rlib /rust/lib/rustlib/asmjs-unknown-emscripten/lib/librustc_std_workspace_core-de6ce0209a89d692.rlib /rust/lib/rustlib/asmjs-unknown-emscripten/lib/libcore-870a8fccfe819f16.rlib /rust/lib/rustlib/asmjs-unknown-emscripten/lib/libcompiler_builtins-38e90ef5c6ec8d7c.rlib -lc --fatal-warnings -L/emsdk_portable/upstream/emscripten/system/local/lib -L/emsdk_portable/upstream/emscripten/system/lib -L/emsdk_portable/.data/cache/wasm-obj /emsdk_portable/.data/cache/wasm-obj/libc.a /emsdk_portable/.data/cache/wasm-obj/libcompiler_rt.a /emsdk_portable/.data/cache/wasm-obj/libc-wasm.a /emsdk_portable/.data/cache/wasm-obj/libc++abi.a /emsdk_portable/.data/cache/wasm-obj/libdlmalloc.a /emsdk_portable/.data/cache/wasm-obj/libpthread_stub.a /emsdk_portable/.data/cache/wasm-obj/libc_rt_wasm.a --import-memory --import-table -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-cxx-exceptions -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --export __wasm_call_ctors --export __data_end --export main --export rust_eh_personality --export malloc --export free --export setThrew --export __errno_location --export fflush --export __cxa_is_pointer_type --export __cxa_can_catch -z stack-size=5242880 --initial-memory=16777216 --no-entry --max-memory=16777216 --global-base=1024' failed (1)

@Emilgardis
Copy link
Member

That seems to be
rust-lang/rust#76679

There is a suggested fix in that issue, not certain it works though

@UebelAndre
Copy link
Contributor Author

That seems to be rust-lang/rust#76679

There is a suggested fix in that issue, not certain it works though

Seems like folks are commenting out the target. Or maybe I missed the suggested fix. What is it?

@UebelAndre
Copy link
Contributor Author

@Emilgardis seems like the work-around didn't work?

@UebelAndre
Copy link
Contributor Author

@Emilgardis do you have some time to take another look at this?

Copy link
Member

@Emilgardis Emilgardis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

can merge now since CI is crippled :)

bors r+

bors bot added a commit that referenced this pull request Jan 24, 2022
597: Add support for `CROSS_CONFIG` environment var r=Emilgardis a=UebelAndre

This allows for the use of a `CROSS_CONFIG` environment variable to explicitly set the path to a `Cross.toml` file to use for builds.

Co-authored-by: UebelAndre <[email protected]>
@UebelAndre
Copy link
Contributor Author

@Emilgardis does the merge work? I don't see the change on master

@Emilgardis
Copy link
Member

wierd

bors cancel

bors r+

@bors
Copy link
Contributor

bors bot commented Jan 25, 2022

Build succeeded:

@bors bors bot merged commit 95739b6 into cross-rs:master Jan 25, 2022
@UebelAndre UebelAndre deleted the config branch January 25, 2022 06:48
@Emilgardis Emilgardis added this to the v0.2.2 milestone Jun 15, 2022
@Alexhuszagh Alexhuszagh added enhancement A-config Area: cross-toml config no-ci-targets PRs that do not affect any cross-compilation targets. labels Nov 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-config Area: cross-toml config enhancement no-ci-targets PRs that do not affect any cross-compilation targets.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants