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

[windows-gnu] Build fails in linking stage #12067

Open
RivenSkaye opened this issue Nov 14, 2024 · 0 comments
Open

[windows-gnu] Build fails in linking stage #12067

RivenSkaye opened this issue Nov 14, 2024 · 0 comments
Labels
C-bug Category: This is a bug

Comments

@RivenSkaye
Copy link

Summary

I don't know where the issue comes from, but I'm going to guess it's build system shenanigans.
Building on Windows 10 in an MSYS2/MingGW64 env produces an error in the final linker stage:

  = note: <truncated>\helix\target\release\build\helix-term-d7030b67b0042c85\out/resource.lib: file not recognized: file format not recognized
          collect2.exe: error: ld returned 1 exit status


error: could not compile `helix-term` (bin "hx") due to previous error
error: failed to compile `helix-term v24.7.0 (<truncated>\helix\helix-term)`, intermediate artifacts can be found at `<truncated>\helix\target`.

I'm sure the path itself is not the issue, I avoided all manner of spaces because there's more tools that don't play nice with them. And tbh, neither do I because spaces should just be arg separators.
To save myself the time, I was already building without grammar builds - but here's the kicker, it worked once I decided to run it through clang.
RUSTFLAGS="-C linker=clang -C link-args=-fuse-ld=lld" HELIX_DISABLE_AUTO_GRAMMAR_BUILD=1 cargo install --path helix-term --locked
Finished release [optimized] target(s) in 7m 07s.

Judging by the upstream packagers for MSYS2/MinGW64, it's something to do with LTO maybe? as they patch it out of the cargo.toml.

Reproduction Steps

  1. Clone the repo
  2. cd helix
  3. HELIX_DISABLE_AUTO_GRAMMAR_BUILD=1 cargo install --path helix-term --locked

I expected this to happen: successful compilation and installation

Instead, this happened: Linker failures

Helix log

Forgot to grab logs before retrying with clang, sorry

Platform

Windows 10 @ latest, with up to date MSYS2/MinGW env

Terminal Emulator

Installation Method

source

Helix Version

24.07-221-g6cca9826

@RivenSkaye RivenSkaye added the C-bug Category: This is a bug label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

1 participant