-
Notifications
You must be signed in to change notification settings - Fork 89
feat(ghc): add GHC 9.10.3 support for ARM64 macOS #2359
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
base: master
Are you sure you want to change the base?
Conversation
Add support for GHC 9.10.3 on ARM64 macOS platform: - Add stackage snapshot using LTS 24.19 - Update CI workflow to test GHC 9.10.3 on supported platforms - Exclude Windows and bzlmod for 9.10.3 (consistent with other recent GHC versions) The GHC 9.10.3 bindist configuration already exists in ghc_bindist_generated.json. Co-Authored-By: Claude <[email protected]> Signed-off-by: Aleksei Sviridkin <[email protected]>
5e90581 to
0aee9b8
Compare
GHC 9.10.3 is not available in the current nixpkgs pin (2024-07-02). Exclude it from test-nixpkgs job while keeping bindist tests which work. Co-Authored-By: Claude <[email protected]> Signed-off-by: Aleksei Sviridkin <[email protected]>
Add generated stackage snapshot JSON files for GHC 9.10.3: - stackage_snapshot_9.10.3.json in root and rules_haskell_tests/ - Additional test snapshot YAML files (ghcide, pinning-test) - Update test_haddock.bzl with expected values for GHC 9.10.3 Also add CLAUDE.md with project guidance for Claude Code. Co-Authored-By: Claude <[email protected]> Signed-off-by: Aleksei Sviridkin <[email protected]>
avdv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, that looks good!
The only real error on CI (apart from the ones due to haskell/hackage-server#1366 and because of #2346) is this:
ERROR: /Users/runner/work/rules_haskell/rules_haskell/rules_haskell_tests/tests/ghcide/BUILD.bazel:5:9: no such package '@ghcide-exe//ghcide': no such package '@ghcide//': Not a regular file: /Users/runner/work/rules_haskell/rules_haskell/rules_haskell_tests/ghcide-snapshot_9.10.3.json and referenced by '//tests/ghcide:ghcide'
You need to run GHC_VERSION=9.10.3 bazel @ghcide-unpinned//:pin and commit the ghcide-snapshot_9.10.3.json file.
Fix ghcide-stack-snapshot_9.10.3.yaml to use correct nightly resolver (nightly-2024-12-11 instead of non-existent nightly-2024-12-10) and add missing lsp and lsp-types packages. Generate ghcide-snapshot_9.10.3.json for GHC 9.10.3 test support. Co-Authored-By: Claude <[email protected]> Signed-off-by: Aleksei Sviridkin <[email protected]>
|
@avdv Thanks for the review! Fixed and pushed. The
|
Thanks, that makes sense. I just pushed some changes to use an lts revision instead of a nightly and pinned the two other snapshots. Hopefully, these will succeed now. 🤞 \edit: it failed for the |
790d259 to
c147c8c
Compare
c147c8c to
b10d39d
Compare
Keeping the expected output files in sync with the different GHC versions and platforms has always been a tedious task. Also, we did not expect these files because we knew these would manifest, but only updated the values after a test failed. So, this adds a unittest which strips off the version suffixes from the output files before checking. Now updating / adding a new GHC version should be easier.
b10d39d to
31f544d
Compare
The ghc-check code needs access to the ghc binary in order to check the version. In previous GHC versions there was a `bin` folder in the libdir; and the bin folder of the distribution just contained shell scripts calling these binaries. This has changed now, and the binaries are directly placed into the `bin` folder and are no longer avaialable inside of `lib`.
6062290 to
37ebeb3
Compare
|
I fixed a few of the remaining test failures but there are some left. Could you look into them, I probably won't be able to on the next days?! |
|
I had a deeper look as into why the tests fail.
this fails on linux and macOS. The reason is that Cabal 3.12.0 (which comes with ghc 9.10) behaves a bit differently than prior versions. Instead of using The test checks whether our generated path information (with I am not sure what we should do here, This difference can probably lead to problems later. Maybe we could inspect the version of Cabal in order to decide whether to append a suffix or not.
this test only fails on linux (as it is OS specific). It fails to locate in This is probably caused by changes in GHC itself, since with previous versions the $ lddtree indirect-link/indirect-link-dynamic
indirect-link-dynamic => indirect-link/indirect-link-dynamic (interpreter => /lib64/ld-linux-x86-64.so.2)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6
ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
libHStestsZSindirect-linkZSmypkg-ghc9.8.2.so => indirect-link/../../_solib_k8/libHStestsZSindirect-linkZSmypkg-ghc9.8.2.so
libHSbase-4.19.1.0-179c-ghc9.8.2.so => not found
libHSghc-bignum-1.3-b9ac-ghc9.8.2.so => not found
libHSghc-prim-0.11.0-7523-ghc9.8.2.so => not found
libHSrts-1.0.2_thr-ghc9.8.2.so => not found
libffi.so.8 => /lib/x86_64-linux-gnu/libffi.so.8
libtests_Sindirect-link_Slibcbits.so => indirect-link/../../_solib_k8/libtests_Sindirect-link_Slibcbits.so
libtests_Sindirect-link_Slibcbits-indirect.so => indirect-link/../../_solib_k8/libtests_Sindirect-link_Slibcbits-indirect.so
libgmp.so.10 => /lib/x86_64-linux-gnu/libgmp.so.10
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1but now, with GHC 9.10.3, the cbits library is just a transitive runtime dependency of $ lddtree indirect-link/indirect-link-dynamic
indirect-link-dynamic => indirect-link/indirect-link-dynamic (interpreter => /lib64/ld-linux-x86-64.so.2)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6
ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
libHStestsZSindirect-linkZSmypkg-ghc9.10.3.so => indirect-link/../../_solib_k8/libHStestsZSindirect-linkZSmypkg-ghc9.10.3.so
libtests_Sindirect-link_Slibcbits.so => not found
libHSghc-internal-9.1003.0-a081-ghc9.10.3.so => not found
libHSghc-prim-0.12.0-957b-ghc9.10.3.so => not found
libHSrts-1.0.2_thr-ghc9.10.3.so => not found
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1We are setting $ readelf -d indirect-link-dynamic | grep NEEDED
0x0000000000000001 (NEEDED) Shared library: [libm.so.6]
0x0000000000000001 (NEEDED) Shared library: [libHStestsZSindirect-linkZSmypkg-ghc9.8.2.so]
0x0000000000000001 (NEEDED) Shared library: [libHSbase-4.19.1.0-179c-ghc9.8.2.so]
0x0000000000000001 (NEEDED) Shared library: [libHSghc-bignum-1.3-b9ac-ghc9.8.2.so]
0x0000000000000001 (NEEDED) Shared library: [libHSghc-prim-0.11.0-7523-ghc9.8.2.so]
0x0000000000000001 (NEEDED) Shared library: [libHSrts-1.0.2_thr-ghc9.8.2.so]
0x0000000000000001 (NEEDED) Shared library: [libffi.so.8]
0x0000000000000001 (NEEDED) Shared library: [libtests_Sindirect-link_Slibcbits.so]
0x0000000000000001 (NEEDED) Shared library: [libtests_Sindirect-link_Slibcbits-indirect.so]
0x0000000000000001 (NEEDED) Shared library: [libgmp.so.10]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6]
$ readelf -d indirect-link-dynamic | grep RUNP
0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN/../../_solib_k8:$ORIGIN/../../_solib_k8/external_Srules_Uhaskell_Ughc_Ulinux_Uamd64]
$ cd ../../_solib_k8 # follow the first RUNPATH entry
$ readelf -d libHStestsZSindirect-linkZSmypkg-ghc9.8.2.so | grep RUNPATH
0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN/../../_solib_k8:$ORIGIN/../../_solib_k8/external_Srules_Uhaskell_Ughc_Ulinux_Uamd64]
$ ls ../../_solib_k8
ls: cannot access '../../_solib_k8': No such file or directory
$ ls ../../_solib_k8/external_Srules_Uhaskell_Ughc_Ulinux_Uamd64
ls: cannot access '../../_solib_k8/external_Srules_Uhaskell_Ughc_Ulinux_Uamd64': No such file or directoryTo fix this, we probably need to add the current directory (i.e. |
Summary
Add support for GHC 9.10.3 across supported platforms (Linux and macOS).
Changes
stackage_snapshot_9.10.3.yamlwith LTS 24.19 resolverrules_haskell_tests/for test snapshotNotes
The GHC 9.10.3 binary distributions already exist in
ghc_bindist_generated.jsonfor all platforms (darwin_amd64, darwin_arm64, linux_amd64, linux_arm64, windows_amd64).Windows and bzlmod support excluded following the pattern of GHC 9.6.5 and 9.8.2.
Test Plan