nh2 / static-haskell-nix

easily build most Haskell programs into fully static Linux executables
388 stars 36 forks source link

ICU #87

Closed tek closed 3 years ago

tek commented 4 years ago

Static configure flag for icu, pulled in by text-icu. Since I've been encountering this when trying to build a project with reflex-vty, I threw the fix for that in as well.

icu has multiple versions, with icu being an alias for icu64 at the moment. Should there be an override for each of the other versions?

nh2 commented 4 years ago

Thanks!

icu has multiple versions, with icu being an alias for icu64 at the moment. Should there be an override for each of the other versions?

If one is an override of the other, then I think it makes sense to do our override for the more basic one.

Which app can I build to test this change? reflex-vty itself, or an app that uses it?

tek commented 4 years ago

If one is an override of the other, then I think it makes sense to do our override for the more basic one.

By "override" I meant the overlay I added for icu rather than icu64. There are icu58, icu59, icu60, icu63 and icu64, with icu pointing to the newest. I assume this will be updated when a new release is added. I'd assume that people would mostly use icu rather than a specific version, but I don't know what would be the best practice. Would it break to supply overrides for both icu64 and icu?

Which app can I build to test this change? reflex-vty itself, or an app that uses it?

here is my test project: https://github.com/tek/static-icu

s2n.bash runs stack2nix and build.bash runs static-haskell-nix

tek commented 4 years ago

@nh2 :wave:

nh2 commented 4 years ago

Sorry for the delay @tek, I've tested this now and I'm happy to merge this.

here is my test project: https://github.com/tek/static-icu

This works for me. I've added commit https://github.com/nh2/static-haskell-nix/pull/87/commits/829b950bc854ca0e87b1fd00100627c32a3bc428 to add or [] to the expression like so:

configureFlags = (old.configureFlags or []) ++ ["--enable-static"];

which is a slightly better way to override attributes because it will not break even when old does not have configureFlags set at all.

What doesn't work for me is the added reflex-vty though. If I try to nix-build --no-link survey/default.nix --arg disableOptimization true -A haskellPackages.reflex-vty, I get this error:

configureFlags: --verbose --prefix=/nix/store/l7xcjpzmc7gl9jb7zaw2sa3jdk3k1cjx-patch-0.0.2.0 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --with-gcc=gcc --package-db=/tmp/nix-build-patch-0.0.2.0.drv-0/package.conf.d --ghc-option=-j4 --disable-split-objs --disable-library-profiling --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --enable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-option=-split-sections --extra-lib-dirs=/nix/store/x1kcjwlc5ykhns1qvkcpj5464m1vx4cf-ncurses-6.1-20190112/lib --extra-lib-dirs=/nix/store/02a76sbyi6k112ha6nyvs02kpxka732b-libffi-3.3/lib --extra-lib-dirs=/nix/store/pmail2mg8ybrygr1m3izzc0klvr1mgkz-gmp-6.1.2/lib --extra-include-dirs=/nix/store/8davc1jj988yjzgrc4nlgslz0q6lwdna-musl-iconv-1.1.24/include
Using Parsec parser
Configuring patch-0.0.2.0...
CallStack (from HasCallStack):
  die', called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:950:20 in Cabal-2.4.0.1:Distribution.Simple.Configure
  configureFinalizedPackage, called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:460:12 in Cabal-2.4.0.1:Distribution.Simple.Configure
  configure, called at libraries/Cabal/Cabal/Distribution/Simple.hs:596:20 in Cabal-2.4.0.1:Distribution.Simple
  confHook, called at libraries/Cabal/Cabal/Distribution/Simple/UserHooks.hs:67:5 in Cabal-2.4.0.1:Distribution.Simple.UserHooks
  configureAction, called at libraries/Cabal/Cabal/Distribution/Simple.hs:178:19 in Cabal-2.4.0.1:Distribution.Simple
  defaultMainHelper, called at libraries/Cabal/Cabal/Distribution/Simple.hs:115:27 in Cabal-2.4.0.1:Distribution.Simple
  defaultMain, called at Setup.hs:2:8 in main:Main
Setup: Encountered missing dependencies:
dependent-map ==0.3.*,
dependent-sum ==0.6.*,
witherable >=0.3 && <0.3.2

builder for '/nix/store/1n2d17z0kb8bqiaah7jjrpc63cpz589z-patch-0.0.2.0.drv' failed with exit code 1
principal> process result: Terminated 199
3628: failed: NixPermanentFailure builder for '/nix/store/1n2d17z0kb8bqiaah7jjrpc63cpz589z-patch-0.0.2.0.drv' failed with exit code 1
error: build of '/nix/store/1n2d17z0kb8bqiaah7jjrpc63cpz589z-patch-0.0.2.0.drv' on 'ssh://beta.nixbuild.net' failed: builder for '/nix/store/1n2d17z0kb8bqiaah7jjrpc63cpz589z-patch-0.0.2.0.drv' failed with exit code 1
builder for '/nix/store/1n2d17z0kb8bqiaah7jjrpc63cpz589z-patch-0.0.2.0.drv' failed with exit code 1
cannot build derivation '/nix/store/jwpv8hfwpqv6lrsxj4rgmblsvqrflmyj-reflex-0.6.4.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/2ckxdc6p55xmnir1ccsmcjj1l2grwy4c-reflex-vty-0.1.3.0.drv': 1 dependencies couldn't be built
error: build of '/nix/store/2ckxdc6p55xmnir1ccsmcjj1l2grwy4c-reflex-vty-0.1.3.0.drv' failed

Does that work for you?

tek commented 4 years ago

right, I have those in the stack.yaml. Since that isn't directly related to static libraries, should it be fixed in survey?

Or should the reflex-vty derivation be unbroken at all?

tek commented 3 years ago

closing this since the icu stuff is in master.