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

Broken ci for aarch64 windows build #1633

Closed
DenuxPlays opened this issue Dec 12, 2024 · 7 comments · Fixed by #1635
Closed

Broken ci for aarch64 windows build #1633

DenuxPlays opened this issue Dec 12, 2024 · 7 comments · Fixed by #1635
Labels
bug Something isn't working

Comments

@DenuxPlays
Copy link

See logs here: https://github.com/DenuxPlays/dyncloud/actions/runs/12304496065/job/34342058658

@DenuxPlays
Copy link
Author

image

@ashleygwilliams ashleygwilliams added the bug Something isn't working label Dec 12, 2024
@mistydemeo
Copy link
Contributor

Sorry for the inconvenience. I think I know what caused this, and I'm looking into fixing it.

In the meantime, you can fix this by specifying a cargo-xwin container for the aarch64-pc-windows-msvc target:

[dist.github-custom-runners.aarch64-pc-windows-msvc]
container = "messense/cargo-xwin"

@DenuxPlays
Copy link
Author

Is it possible to make ring compile at aarch64 windows.
Here are the current logs:

image

image

In text form:

error: failed to run custom build command for `ring v0.17.8`

Caused by:
  process didn't exit successfully: `/__w/dyncloud/dyncloud/target/dist/build/ring-[52](https://github.com/DenuxPlays/dyncloud/actions/runs/12305224895/job/34344358806#step:9:53)4ab4a82563183a/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=RING_PREGENERATE_ASM
  cargo:rustc-env=RING_CORE_PREFIX=ring_core_0_17_8_
  OPT_LEVEL = Some(3)
  OUT_DIR = Some(/__w/dyncloud/dyncloud/target/aarch64-pc-windows-msvc/dist/build/ring-bdcbb9dd337[53](https://github.com/DenuxPlays/dyncloud/actions/runs/12305224895/job/34344358806#step:9:54)af3/out)
  TARGET = Some(aarch64-pc-windows-msvc)
  cargo:rerun-if-env-changed=VCINSTALLDIR
  VCINSTALLDIR = None
  HOST = Some(x86_64-unknown-linux-gnu)
  cargo:rerun-if-env-changed=CC_aarch64-pc-windows-msvc
  CC_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CC_aarch64_pc_windows_msvc
  CC_aarch64_pc_windows_msvc = Some(clang-cl)
  cargo:rerun-if-env-changed=CC_KNOWN_WRAPPER_CUSTOM
  CC_KNOWN_WRAPPER_CUSTOM = None
  RUSTC_WRAPPER = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some(crt-static,neon)
  DEBUG = Some(false)
  cargo:rerun-if-env-changed=CFLAGS_aarch64-pc-windows-msvc
  CFLAGS_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64_pc_windows_msvc
  CFLAGS_aarch64_pc_windows_msvc = Some(--target=aarch64-pc-windows-msvc -Wno-unused-command-line-argument -fuse-ld=lld-link /imsvc/github/home/.cache/cargo-xwin/xwin/crt/include /imsvc/github/home/.cache/cargo-xwin/xwin/sdk/include/ucrt /imsvc/github/home/.cache/cargo-xwin/xwin/sdk/include/um /imsvc/github/home/.cache/cargo-xwin/xwin/sdk/include/shared  )
  cargo:rerun-if-env-changed=CC_SHELL_ESCAPED_FLAGS
  CC_SHELL_ESCAPED_FLAGS = None
  CARGO_ENCODED_RUSTFLAGS = Some(-Ctarget-feature=+crt-static-Clinker-flavor=lld-link-Lnative=/github/home/.cache/cargo-xwin/xwin/crt/lib/aarch64-Lnative=/github/home/.cache/cargo-xwin/xwin/sdk/lib/um/aarch64-Lnative=/github/home/.cache/cargo-xwin/xwin/sdk/lib/ucrt/aarch64)

  --- stderr
  running LC_ALL="C" "clang" "-O3" "-ffunction-sections" "-fdata-sections" "--target=aarch64-pc-windows-msvc" "-I" "include" "-I" "/__w/dyncloud/dyncloud/target/aarch64-pc-windows-msvc/dist/build/ring-bdcbb9dd33753af3/out" "--target=aarch64-pc-windows-msvc" "-Wno-unused-command-line-argument" "-fuse-ld=lld-link" "/imsvc/github/home/.cache/cargo-xwin/xwin/crt/include" "/imsvc/github/home/.cache/cargo-xwin/xwin/sdk/include/ucrt" "/imsvc/github/home/.cache/cargo-xwin/xwin/sdk/include/um" "/imsvc/github/home/.cache/cargo-xwin/xwin/sdk/include/shared" "-fvisibility=hidden" "-std=c1x" "-Wall" "-Wbad-function-cast" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wnested-externs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wstrict-prototypes" "-Wundef" "-Wuninitialized" "-g3" "-DNDEBUG" "-c" "-o/__w/dyncloud/dyncloud/target/aarch64-pc-windows-msvc/dist/build/ring-bdcbb9dd33753af3/out/aesv8-armx-win64.o" "/usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/ring-0.17.8/pregenerated/aesv8-armx-win64.S"
  clang: error: no such file or directory: '/imsvc/github/home/.cache/cargo-xwin/xwin/crt/include'
  clang: error: no such file or directory: '/imsvc/github/home/.cache/cargo-xwin/xwin/sdk/include/ucrt'
  clang: error: no such file or directory: '/imsvc/github/home/.cache/cargo-xwin/xwin/sdk/include/um'
  clang: error: no such file or directory: '/imsvc/github/home/.cache/cargo-xwin/xwin/sdk/include/shared'
  thread 'main' panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/ring-0.17.8/build.rs:670:9:
  execution failed
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

  × failed to find bin dyncloud.exe for path+file:///__w/dyncloud/dyncloud#1.5.0
  help: did the above build fail?

Error: Process completed with exit code 2[55](https://github.com/DenuxPlays/dyncloud/actions/runs/12305224895/job/34344358806#step:9:56).

@mistydemeo
Copy link
Contributor

mistydemeo commented Dec 12, 2024

I personally haven't been able to get that to work either, sorry. ring is very hard to build for Windows on that arch. :/ While I can get a native build to work with some fiddling, I haven't gotten the cross-compile to work.

Here's an upstream issue in cargo-xwin, which is the tool we're using to do the cross-compile: rust-cross/cargo-xwin#76

@DenuxPlays
Copy link
Author

Yeah already thought that...

Ring was the reason for quite a lot of cross compiling troubles I've had.

Thank you I'll take a look at the issue.

@messense
Copy link

FYI, the ring aarch64 windows cross compile issue can be fixed now when using cargo-xwin, see rust-cross/cargo-xwin#76 (comment)

@DavisVaughan
Copy link
Contributor

DavisVaughan commented Jan 26, 2025

@mistydemeo I also ran into this while working to add ARM Windows support to our builds posit-dev/air#205.

We were mistakenly compiling our xtask/ crates in the dist release CI, which brought in rusttls and therefore ring. Luckily this was easy to fix with precise-builds, and we removed our ring dependency and were able to get past this.

I imagine one solution for people facing this issue (because they really do require ring) is for dist to offer some way for people to set the new XWIN_CROSS_COMPILER environment variable, or the --cross-compiler cli argument, which @messense referred to above. I doubt you'd want to set it unconditionally when cross compiling to ARM Windows using cargo-xwin, right? As its only needed when ring is in the dependency list.

IIUC, you only need to care about this when cross compiling to ARM Windows from Linux using cargo-xwin. In other words, if dist switched to cross compiling to ARM Windows from the x86_64 Windows runner provided by github actions (as suggested here #1644), then that might just magically fix this?

I know that the biome project does this, using a simple cargo build --target aarch64-pc-windows-msvc from a windows-2022 github runner to build their cli binaries, so at least someone out there is doing is successfully! https://github.com/biomejs/biome/blob/92d3fbe59f48530b833af7fce5c4ee0940b7f5f6/.github/workflows/release_cli.yml#L124

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants