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 #6142 Build statically-linked Linux/Aarch64 Stack #6212

Merged
merged 1 commit into from
Aug 19, 2023
Merged

Conversation

mpilgrem
Copy link
Member

This pull request is draft while I experiment with the CI.

  • 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! Relying on CI.

@mpilgrem mpilgrem marked this pull request as draft August 18, 2023 21:52
@mpilgrem mpilgrem force-pushed the fix6142 branch 3 times, most recently from f45b33e to 6527c85 Compare August 18, 2023 22:04
@mpilgrem
Copy link
Member Author

@benz0li, I have probably got the wrong end of the stick, but I thought I could simply use the Stack that comes with the self-hosted Linux Aarch64 runner to run stack etc/scripts/release.hs build --alpine, which would then build Stack in your glcr.b-data.ch/ghc/ghc-musl:9.2.8 Docker container. However, it falls over with (extracts):

...
Error: [S-7282]
       Stack failed to execute the build plan.
       
       While executing the build plan, Stack encountered the error:
       
       [S-7011]
       While building package digest-0.0.1.7 (scroll up to its section to see the error) using:
...

I tend to associate problems with building digest-0.0.1.7 with a missing pkg-config dependency. May I ask, does your Docker container come with pkg-config? If it does not, could it be modified to supply it?

@benz0li
Copy link
Contributor

benz0li commented Aug 19, 2023

May I ask, does your Docker container come with pkg-config? If it does not, could it be modified to supply it?

The package pkgconfig is already available in the image.

@benz0li
Copy link
Contributor

benz0li commented Aug 19, 2023

Stack builds fine using glcr.b-data.ch/ghc/ghc-musl:9.2.8:

Host

docker run --rm -ti glcr.b-data.ch/ghc/ghc-musl:9.2.8 bash

Docker container

cd /tmp && git clone https://github.com/commercialhaskell/stack.git
Cloning into 'stack'...
remote: Enumerating objects: 66913, done.
remote: Counting objects: 100% (6851/6851), done.
remote: Compressing objects: 100% (1010/1010), done.
remote: Total 66913 (delta 5950), reused 6472 (delta 5796), pack-reused 60062
Receiving objects: 100% (66913/66913), 22.37 MiB | 17.51 MiB/s, done.
Resolving deltas: 100% (46648/46648), done.
cd stack && stack install stack --flag=stack:static --no-install-ghc --system-ghc

Build log

build_log.txt

@benz0li
Copy link
Contributor

benz0li commented Aug 19, 2023

With Stack v2.11.1 installed on the host, I am able to build Stack v2.12.0 (master) using stack install stack --docker --docker-stack-exe=image --flag=stack:static --no-install-ghc --system-ghc for both Linux/x86_64 and Linux/AArch64.

@benz0li
Copy link
Contributor

benz0li commented Aug 19, 2023

@mpilgrem Using the same steps for Linux/AArch64 as for Linux/x86_64 should give the same result.

The images for both architectures are built with the same Dockerfile: https://gitlab.b-data.ch/ghc/ghc-musl/-/blob/main/prior/9.2.8.Dockerfile

@benz0li
Copy link
Contributor

benz0li commented Aug 19, 2023

docker run --rm -ti glcr.b-data.ch/ghc/ghc-musl:9.2.8 bash -c 'uname -m && which pkg-config && pkg-config --version'
aarch64
/usr/bin/pkg-config
1.8.1

@mpilgrem mpilgrem force-pushed the fix6142 branch 3 times, most recently from 3096a07 to 6cf98bb Compare August 19, 2023 13:08
@mpilgrem mpilgrem marked this pull request as ready for review August 19, 2023 13:08
@mpilgrem
Copy link
Member Author

@benz0li, thanks for your help, and patience. The pkg-config was a problem with the self-hosted runner's software. --docker-stack-exe=image was missing from my Docker set up. I think I am almost there ...

@benz0li
Copy link
Contributor

benz0li commented Aug 19, 2023

@benz0li, thanks for your help, and patience.

No worries. Thank you for looking into this.

The pkg-config was a problem with the self-hosted runner's software.

OK.

--docker-stack-exe=image was missing from my Docker set up. I think I am almost there ...

ℹ️ After a new release I will update Stack in the images asap.

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.

2 participants