Comments (8)
@nnmm Maybe benz0li/ghc-musl#1 (comment) and the following posts have the answer you are looking for.
from ghc-musl.
IMHO ld-options: -static -pthread
should be sufficient.
@nnmm See also jgm/pandoc#9068 for a similar case.
from ghc-musl.
@benz0li Thanks for your comment. I don't think I'm doing anything all that different from what is suggested in these threads.
I've uploaded a minimal reproducer here: https://github.com/nnmm/stack-musl-repro - I've also tried using a package.yaml
instead of a cabal
file, but the result is the same (segfault during configuring).
from ghc-musl.
On a host with docker installed
docker run --rm -ti glcr.b-data.ch/ghc/ghc-musl:9.8.2 bash
Inside the container
cd /var/tmp/ \
&& git clone https://github.com/nnmm/stack-musl-repro.git \
&& cd stack-musl-repro \
&& cabal build \
&& file /var/tmp/stack-musl-repro/dist-newstyle/build/x86_64-linux/ghc-9.8.2/repro-0.1.0.0/x/repro/build/repro/repro
output:
Cloning into 'stack-musl-repro'...
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 0), reused 6 (delta 0), pack-reused 0
Receiving objects: 100% (6/6), done.
Config file path source is default config file.
Config file not found: /root/.config/cabal/config
Writing default configuration to /root/.config/cabal/config
Warning: The package list for 'hackage.haskell.org' does not exist. Run 'cabal
update' to download it.
Resolving dependencies...
Build profile: -w ghc-9.8.2 -O1
In order, the following will be built (use -v for more details):
- repro-0.1.0.0 (exe:repro) (first run)
Configuring executable 'repro' for repro-0.1.0.0..
Warning: The 'license-file' field refers to the file 'LICENSE' which does not
exist.
Preprocessing executable 'repro' for repro-0.1.0.0..
Building executable 'repro' for repro-0.1.0.0..
[1 of 1] Compiling Main ( app/Main.hs, /var/tmp/stack-musl-repro/dist-newstyle/build/x86_64-linux/ghc-9.8.2/repro-0.1.0.0/x/repro/build/repro/repro-tmp/Main.o )
[2 of 2] Linking /var/tmp/stack-musl-repro/dist-newstyle/build/x86_64-linux/ghc-9.8.2/repro-0.1.0.0/x/repro/build/repro/repro
/var/tmp/stack-musl-repro/dist-newstyle/build/x86_64-linux/ghc-9.8.2/repro-0.1.0.0/x/repro/build/repro/repro: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, BuildID[sha1]=ea4b874dedbf8d2efd08f79aedc237e10c465def, with debug_info, not stripped
👉 statically linked
from ghc-musl.
You may try the following stack.yaml
:
flags: {}
packages:
- '.'
resolver: lts-22.7
# This enables static linking, so that there are no libc problems with the Debian server
docker:
enable: true
image: quay.io/benz0li/ghc-musl:9.6.4
from ghc-musl.
@benz0li That works, thanks so much! Seems like the conclusion is that I should have been looking at https://github.com/benz0li/ghc-musl instead of this repo :)
from ghc-musl.
That is, the configuring error is gone - there is still a linker error. But I can create a separate issue for that if needed.
from ghc-musl.
That is, the configuring error is gone - there is still a linker error. But I can create a separate issue for that if needed.
@nnmm You may create an issue at https://github.com/benz0li/ghc-musl.
If possible: Use a Dev Container so it can be easily reproduced.
from ghc-musl.
Related Issues (20)
- Building with stack fails with "Executable named groupadd not found on path" error HOT 2
- Add sdl2 and sdl2-ttf to the docker images? HOT 48
- build postgrest failed with error message setup: The program 'pg_config' is required but it could not be found HOT 9
- Failed with integer-gmp HOT 3
- Update image to GHC 9.0.2 HOT 8
- Linker problem building a `monomer` app HOT 2
- Alpine package upgrades HOT 12
- Earthfile suggestions HOT 5
- Would you be so kind as to include stack? HOT 6
- Build a statically linked Haskell library with ghc-musl HOT 5
- Build wai-app-static failed with Segfaults HOT 3
- Docker image with GHC 9.2.5 HOT 2
- Affected by binutils bug 23856 HOT 1
- Cannot build 'summoner-tui' HOT 11
- Error encountered while installing GHC HOT 2
- The `--ghc-options` for `stack build` were not recognized correctly. HOT 1
- SSL certificates HOT 19
- adding pcre HOT 2
- add bz2 & openssl HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ghc-musl.