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

Fix U+2010 typo which prevents successful building on MSYS2 CLANGARM64 #334

Merged
merged 1 commit into from
Jan 5, 2025

Conversation

GulinSS
Copy link
Contributor

@GulinSS GulinSS commented Jan 4, 2025

GHC JS Backend does not support TemplateHaskell and Windows. To investigate this issue I was needed first to build GHC itself to run on Windows 11 ARM (because this hardware is available for me). It was done here. And it allowed me to dive in the main issue.

This change allows running a build of GHC JS Backend cross-crompiler by using Windows 11 ARM and a non-cross GHC build for Aarch64.

Without this change LLVM compilers at Windows are unable process the build.

@hasufell
Copy link
Member

hasufell commented Jan 4, 2025

How do we test this?

@GulinSS
Copy link
Contributor Author

GulinSS commented Jan 5, 2025

  1. Take Aarch64 hardware. I use Apple aarch64 with UTM and Windows for ARM 11 installed. It works surprisingly fine.
  2. Use fresh bindist ghc-9.12.1-aarch64-unknown-mingw32.tar.xz as a bootstrap compiler (you can also download the archive, move it to more stable place and add to ghcup metadata).
  3. Install MSYS2 with CLANGARM64 support. LLVM would be installed already.
  4. Install git-for-windows (or pacman -S git).
  5. Take cabal https://github.com/haskell/ghcup-metadata/blob/develop/ghcup-0.0.9.yaml#L6261. X86 is ok for it.
  6. Prepare your build environment (you will need at least happy, alex, python, nodejs, emscripten).
  7. Patch cabal files of built-in libraries to work with ghc-12.1 (it should support ghc-13...)
  8. Run build of `ghc js backend.

At stage1 your will meet the error about this strange symbol which I removed from sources by this PR.

Also, to build stage0 you will need apply these patches to built-in libs: https://gitlab.haskell.org/ghc/ghc/-/issues/24603#note_602554


I am not sure does it present at x86 windows but I think that LLVM usage at Windows is somehow related to this issue because earlier GCC was used instead.

@hasufell
Copy link
Member

hasufell commented Jan 5, 2025

Well, I'm not sure I have time for that. And it's hard for unix to maintain aarch64 windows compatibility if there is no CI that tells us when we break things.

@GulinSS
Copy link
Contributor Author

GulinSS commented Jan 5, 2025

Depends on requested changes. It looks like a typo which breaks compiling stage. Somebody wanted to use - but substituted something from UTF. 🤔

It was (https://www.compart.com/en/unicode/U+2010) not just - (https://www.compart.com/en/unicode/U+002D). I just removed it because it looked like a typo.


I have no x86 hardware around. You could try to build GHC JS Backend by usual way at Windows but use LLVM as a compiler instead of GCC. May be it could help to reduce lots of steps from my origin message and save your time on reproduction.


I've renamed the PR to reflect better sense of these changes.

@GulinSS GulinSS changed the title Add Support GHC JS Backend build at Windows Aarch64 Fix U+2010 typo which prevents successful building on MSYS2 CLANGARM64 Jan 5, 2025
@hasufell hasufell requested a review from Bodigrim January 5, 2025 09:44
@Bodigrim Bodigrim merged commit b6b575b into haskell:master Jan 5, 2025
26 checks passed
@GulinSS GulinSS deleted the wip/T25619 branch January 5, 2025 10:40
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

Successfully merging this pull request may close these issues.

3 participants