Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Re #6531 Allow cross-OS use of release.hs #6535

Merged
merged 6 commits into from
Mar 29, 2024
Merged

Re #6531 Allow cross-OS use of release.hs #6535

merged 6 commits into from
Mar 29, 2024

Conversation

mpilgrem
Copy link
Member

This pull request folds the idea of #6533 into etc/scripts/release.hs itself, and extends it.

Currently, the Linux/AArch64 job in integration-tests.yml makes use of:

/usr/local/bin/stack etc/scripts/release.hs build --alpine --build-args --docker-stack-exe=image

You can't use a Docker container on GitHub's macOS/M1-based macos-14, but the idea is that you could use on macOS/AArch64 locally:

stack etc/scripts/release.hs build --alpine --stack-args --docker-stack-exe=image

It also seeks to do the same with release.hs check, so that you can use on macOS/AArch64 locally:

stack etc/scripts/release.hs check --alpine --stack-args --docker-stack-exe=image

The pull request introduces --stack-args, as --docker-stack-exe is a global flag, not a stack build flag. As before, when --alpine is passed the global flags --docker, --system-ghc and --no-install-ghc are specified.

The pull request distinguishes the target OS from the platform OS. When --alpine is passed, the target OS is set to Linux.

In the case of release.hs check, the commands are run by the platform's Stack (with stack exec) so that they can be run in a Docker container, if necessary. This is also done when stack --version is examined.

With:

stack --docker --docker-stack-exe-image --system-ghc --no-install-ghc exec stack -- ...

the second Stack (the one provided by the Docker image) needs its own --system-ghc --no-install-ghc, so those flags are added to gCheckStackArgs when --alpine is passed.

The deprecated putNormal is replaced by putInfo.

This is being tested locally on a Mac mini/M1. The 4095-utf8-pure-nix was failing because Nix can't be used in a Docker container. So, a guard has been added.

One other test was failing: 4783-doctest-deps. That is still being investigated and so this pull request is still draft.

Please include the following checklist in your pull request:

  • Any changes that could be relevant to users have been recorded in ChangeLog.md.
  • The documentation has been updated, if necessary

Please also shortly describe how you tested your change. Bonus points for added tests! Local testing and also relying on CI.

@mpilgrem
Copy link
Member Author

mpilgrem commented Mar 27, 2024

The 4783-doctest-deps failure comes at the linking stage for the doctest executable (extract):

doctest  > Preprocessing executable 'doctest' for doctest-0.22.2..
doctest  > Building executable 'doctest' for doctest-0.22.2..
doctest  > [1 of 2] Compiling Main
doctest  > [2 of 2] Compiling Paths_doctest
doctest  > [3 of 3] Linking .stack-work/dist/aarch64-linux-dkc042e302e26590e0ec6157676b3df5ee/ghc-9.6.4/build/doctest/doctest
doctest  > collect2: fatal error: ld terminated with signal 9 [Killed]
doctest  > compilation terminated.
doctest  > ghc-9.6.4: `gcc' failed in phase `Linker'. (Exit code: 1)

EDIT: That error is due to memory exhaustion. It is fixed by giving colima more memory than its default 2 GB.

@mpilgrem mpilgrem marked this pull request as ready for review March 27, 2024 20:32
@mpilgrem mpilgrem merged commit b0c7218 into master Mar 29, 2024
14 checks passed
@mpilgrem mpilgrem deleted the fix6531 branch March 29, 2024 20:10
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant