Skip to content

ghc on musl: Crude hack to allow integer-simple#138429

Closed
nomeata wants to merge 2 commits intoNixOS:masterfrom
nomeata:ghc-musl-integer-simple
Closed

ghc on musl: Crude hack to allow integer-simple#138429
nomeata wants to merge 2 commits intoNixOS:masterfrom
nomeata:ghc-musl-integer-simple

Conversation

@nomeata
Copy link
Copy Markdown
Contributor

@nomeata nomeata commented Sep 18, 2021

as per discussion on
#130441 (comment) this
seems to be enough to make

nix-build -A pkgsMusl.haskell.packages.integer-simple.ghc884.hello

work again.

This is likely not the right patch (maybe gmp should be
nativeBuildInput? Or a propagated build input from the boot ghc?), but
this way I we can discuss (and I can pull the patch into my project...)

as per discussion on
NixOS#130441 (comment) this
seems to be enough to make
```
nix-build -A pkgsMusl.haskell.packages.integer-simple.ghc884.hello
```
work again.

This is likely not the right patch (maybe `gmp` should be
`nativeBuildInput`? Or a propagated build input from the boot ghc?), but
this way I we can discuss (and I can pull the patch into my project...)
@github-actions github-actions bot added the 6.topic: haskell General-purpose, statically typed, purely functional programming language label Sep 18, 2021
@nomeata
Copy link
Copy Markdown
Contributor Author

nomeata commented Sep 18, 2021

@ofborg build pkgsMusl.haskell.packages.integer-simple.ghc884.hello pkgsMusl.haskell.packages.integer-simple.ghc8107.hello

@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Sep 18, 2021
nomeata added a commit to nomeata/ic-hs that referenced this pull request Sep 18, 2021
@cdepillabout
Copy link
Copy Markdown
Member

cc @nh2 about this as well

@nh2
Copy link
Copy Markdown
Contributor

nh2 commented Sep 19, 2021

Answering #130441 (comment)

is a fix along the lines of #138429 the wrong direction?

Based on my write-up #130441 (comment) just now, this PR is probably not the "proper fix".

It is pkgsMusl.haskell.compiler.ghc8102BinaryMinimal that should be fixed (it forgets its GMP path), not the compilers that are compiled with it.

That said, ghc8102BinaryMinimal is mainly used to bootstrap other compilers, so injecting the GMP dependencies into the derivations of those compilers looks like a reasonable workaround.

It would be very beneficial though to check that gmp is no longer referred to at all by the bootstrapped compilers, or leaked into the outputs built with them (as people use integer-simple specifically to be sure not to have a gmp dependency). Even better to assert it programmatically, but I don't know how to do that; #130441 (comment) mentioned disallowedRequisites but I don't know yet what that is.

@nh2
Copy link
Copy Markdown
Contributor

nh2 commented Sep 19, 2021

I have put out an alternative PR #138524, which switches ghc8102Binary -> ghc8107Binary as the bootstrap compiler instead.

If it works, that should be cleaner than this workaround.

@nomeata
Copy link
Copy Markdown
Contributor Author

nomeata commented Sep 19, 2021

Thanks for your help! I’ll close this then

@nomeata nomeata closed this Sep 19, 2021
marcin-dziadus pushed a commit to dfinity/ic-hs that referenced this pull request Sep 20, 2021
* Experiment: Bump nixpkgs to latest master

This is to see if there are problems coming up. Some of the things in
nix/haskell-packages.nix can probably be cleaned up now.

Originally https://github.com/dfinity-lab/ic-ref/commit/dce1286a900525607fcc21171b82940e3ec3385f

* Bump again

Originally https://github.com/dfinity-lab/ic-ref/commit/b43f83609fd3a99e0a8ecd8700f4baee0c53b863

* Bump once more

Originally https://github.com/dfinity-lab/ic-ref/commit/a0746ed7be49c8f1619e5b75ba84d5c832730cf8

* Fix merge issue

* Fix path

* Back to master

* Try winter master

* Remove many haskell package changes

* More simplification and upstream cache use

* Update freeze file

* Less versionoverrides needed

* Remove nix/haskell-packages, more DNRY

* Fix patch handling

* Add .gitattributes to mark generated files as such

* s/	/        /

* Run github actions with ghc-8.10.7

* Fix docs jobs

* Fix docs jobs some more

* Update cabal.project

* Bump candid some more

* Checkout before setting up the cache

* Fix cabal keys

* Don’t set active-repositories in freeze file

* Rename workflow

* naersk changed it seems

* Try pkgsStatic, not pkgsMusl

as the latter doesn’t seem to work any more since
NixOS/nixpkgs#130441

* Fix static cborg build

* Try static-haskell-nix

* Revert "Try static-haskell-nix"

This reverts commit b375ad4.

* Revert "Try pkgsStatic, not pkgsMusl"

This reverts commit d1f64f1.

* Try pkgsMusl again

pulling in NixOS/nixpkgs#138429

* Update freeze file

* Right GHC version

* Try NixOS/nixpkgs#138524
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: haskell General-purpose, statically typed, purely functional programming language 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants