Skip to content

Commit 53e6897

Browse files
committed
workingStackageExecutable now working.
With and without `disableOptimization`.
1 parent 7228102 commit 53e6897

File tree

1 file changed

+59
-17
lines changed

1 file changed

+59
-17
lines changed

survey/default.nix

Lines changed: 59 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -629,23 +629,29 @@ let
629629
# /nix/store/...-musl-iconv-1.2.3
630630
# /nix/store/...-binutils-2.41
631631
# /nix/store/...-bootstrap-tools
632+
#
633+
# Tipp by sterni:
634+
#
635+
# You only want to apply the adapter to the `pkgsHostTarget` package set's `stdenv`.
636+
# There is no clean way to really detect in an overlay what
637+
# "absolute" position in the chained package sets you are modifying.
638+
# `pkgsStatic` uses `isStatic` as an indicator
639+
# (see `adaptStdenv` in `pkgs/stdenv/cross/default.nix`).
640+
# (I suppose this adapter will only work for cross nixpkgs in its current state.)
632641
stdenv = previous.stdenvAdapters.propagateBuildInputs previous.stdenv;
633642
};
634643

635644
# Workaround to the above, overriding packages manually that need it.
636-
propagatedBuildInputsManuallyOverlay = final: previous: {
637-
638-
# Needs
639-
# https://github.com/NixOS/nixpkgs/pull/320105
640-
# to work, but we still have to have `lerc` in `propagatedBuildInputs`
641-
# so that downstream packages such as `libwebp` can see `lerc`'s `.pc` file.
642-
libtiff = previous.libtiff.overrideAttrs (oldAttrs: {
643-
propagatedBuildInputs = (oldAttrs.propagatedBuildInputs or []) ++ [
644-
final.lerc
645-
];
646-
});
647-
648-
};
645+
propagatedBuildInputsManuallyOverlay = final: previous:
646+
let
647+
prop = drv: drv.overrideAttrs (oldAttrs: {
648+
propagatedBuildInputs = (oldAttrs.propagatedBuildInputs or []) ++ (oldAttrs.buildInputs or []);
649+
});
650+
in
651+
{
652+
libtiff = prop previous.libtiff;
653+
gd = prop previous.gd;
654+
};
649655

650656
# pkgsPropagatedBuildInputs = pkgs.extend propagatedBuildInputsOverlay;
651657
pkgsPropagatedBuildInputs = pkgs.extend propagatedBuildInputsManuallyOverlay;
@@ -1168,6 +1174,19 @@ let
11681174
(if disableOptimization then dontCheck else lib.id)
11691175
super.generic-data;
11701176

1177+
# Tests use `inspection-testing` which cannot work on `-O0`.
1178+
# This seems to happen only in nixpkgs, I could not reproduce it with `stack test --fast`.
1179+
#
1180+
# 1) cast correctly fails to extract aChar from A
1181+
# Make sure the expression has an NFData instance! See docs at https://github.com/CRogers/should-not-typecheck#nfdata-a-constraint. Full error:
1182+
# tests/Examples.hs:188:7: error: [GHC-39999]
1183+
# • Ambiguous type variable ‘a0’ arising from a use of ‘shouldNotTypecheck’
1184+
# prevents the constraint ‘(NFData a0)’ from being solved.
1185+
# Probable fix: use a type annotation to specify what ‘a0’ should be.
1186+
records-sop =
1187+
(if disableOptimization then dontCheck else lib.id)
1188+
super.records-sop;
1189+
11711190
# `HsOpenSSL` has a bug where assertions are only triggered on `-O0`.
11721191
# This breaks its test suite.
11731192
# https://github.com/vshabanov/HsOpenSSL/issues/44
@@ -1330,6 +1349,12 @@ let
13301349
# Tests fail with: doctests: <command line>: Dynamic loading not supported
13311350
openapi3 = dontCheck super.openapi3;
13321351

1352+
mysql-json-table =
1353+
addStaticLinkerFlagsWithPkgconfig
1354+
super.mysql-json-table
1355+
[ final.openssl final.zlib_both ]
1356+
"--libs openssl zlib";
1357+
13331358
# TODO For the below packages, it would be better if we could somehow make all users
13341359
# of postgresql-libpq link in openssl via pkgconfig.
13351360
hasql-notifications =
@@ -1360,8 +1385,8 @@ let
13601385
postgresql-schema =
13611386
addStaticLinkerFlagsWithPkgconfig
13621387
super.postgresql-schema
1363-
[ final.openssl ]
1364-
"--libs openssl";
1388+
[ final.openssl final.postgresql ]
1389+
"--libs openssl libpq";
13651390
postgresql-simple-migration =
13661391
addStaticLinkerFlagsWithPkgconfig
13671392
super.postgresql-simple-migration
@@ -1370,8 +1395,8 @@ let
13701395
squeal-postgresql =
13711396
addStaticLinkerFlagsWithPkgconfig
13721397
super.squeal-postgresql
1373-
[ final.openssl ]
1374-
"--libs openssl";
1398+
[ final.openssl final.postgresql ]
1399+
"--libs openssl libpq";
13751400
tmp-postgres =
13761401
addStaticLinkerFlagsWithPkgconfig
13771402
(dontCheck super.tmp-postgres) # flaky/stuck tests: https://github.com/jfischoff/tmp-postgres/issues/273
@@ -1601,6 +1626,18 @@ let
16011626
(if disableOptimization then dontCheck else lib.id)
16021627
super.numeric-prelude;
16031628

1629+
# Assertion failure with `-O0` because then assertions are actually checked:
1630+
# https://github.com/haskell/ghc-events/issues/106
1631+
ghc-events =
1632+
(if disableOptimization then dontCheck else lib.id)
1633+
super.ghc-events;
1634+
1635+
# Test suite uses `timeout` to check performance, bad idea.
1636+
# https://github.com/frasertweedale/hs-jose/blob/c2f6690df5672dc1e089d1fa9ab7a4298f06c55d/test/Perf.hs#L38C16-L38C19
1637+
jose =
1638+
(if disableOptimization then dontCheck else lib.id)
1639+
super.jose;
1640+
16041641
# doctests test suite fails with:
16051642
# /build/trifecta-2.1/src/Text/Trifecta/Util/It.hs:61: failure in expression `let keepIt a = Pure a'
16061643
# expected:
@@ -1775,6 +1812,11 @@ in
17751812
"rhine-gloss" # needs opengl: `cannot find -lGLU` `-lGL`
17761813
"soxlib" # fails `systemd` dependency erroring on `#include <printf.h>`
17771814
"termonad" # needs `glib` which is problematic
1815+
1816+
"audacity" # lots of linker errors, likely lack of pkg-config; needs investigation
1817+
"sound-collage" # like `audacity`
1818+
"align-audio" # like `audacity`
1819+
"split-record" # like `audacity`
17781820
];
17791821

17801822
inherit normalPkgs;

0 commit comments

Comments
 (0)