Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion pkgs/development/haskell-modules/configuration-common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,20 @@ self: super:
}
+ "/${name}";
# 2025-04-09: jailbreak to allow bytestring >= 0.12, text >= 2.1
jailbreak = true;
# Note: jailbreak ignores constraints under an if(flag)
postPatch = ''
check_sed() {
if ! test -s "$1"; then
echo "sed: pattern '$2' doesn't match anything" >&2
exit 1
fi
}
sed -i ${name}.cabal \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a weak preference for substituteInPlace --replace-fail since that would let us know when to remove this.

FTR, we intentionally leave conditionals alone NixOS/jailbreak-cabal@99eac40.

Copy link
Contributor

@wolfgangwalther wolfgangwalther May 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FTR, we intentionally leave conditionals alone NixOS/jailbreak-cabal@99eac40.

I'm not sure I'm buying the argument made in that commit. The constraints under the flag are required to pick the correct version for a solver - and then to add another peer dependency at the same time for this case.

But none of that applies to us in nixpkgs. The versions we provide are set. The flag configuration is as well. When you hit a constraint and want to jailbreak it, it doesn't matter for us whether it's behind a flag or not.

What am I missing?

Edit: Maybe I am missing some kind of reverse mechanism that sets the flags based on the provided dependencies? I guess I just don't know about this feature.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A flag conditional may, besides restricting the version ranges, set any number of things including e.g. compilation flags. If the flag is marked as automatic, Cabal will attempt to automatically set it based on the preinstalled (by us) versions of packages. If we remove those constraints, it just has to go with the default value of the flag, which may mean incorrect settings and the build failing incorrectly, e.g. because a CPP var isn't set.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a weak preference for substituteInPlace --replace-fail since that would let us know when to remove this.

It's not possible with substituteInPlace: this code applies to 3 packages and the whitespace is different in each .cabal file, so you need a regex. However we can make sed fail too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I guess 3x replace-fail would be easiest to maintain for us (?)

-e 's/\(bytestring\) .*/\1/w c1' \
-e 's/\(text\) .*/\1/w c2'
check_sed c1 'bytestring .*'
check_sed c2 'text .*'
'';
}) super.${name};
in
lib.genAttrs [ "selda" "selda-sqlite" "selda-json" ] mkSeldaPackage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5370,7 +5370,6 @@ broken-packages:
- secureUDP # failure in job https://hydra.nixos.org/build/233215410 at 2023-09-02
- SegmentTree # failure in job https://hydra.nixos.org/build/233216161 at 2023-09-02
- selda-postgresql # failure in job https://hydra.nixos.org/build/245539286 at 2024-01-02
- selda-sqlite # failure in job https://hydra.nixos.org/build/295096791 at 2025-04-22
- selectors # failure in job https://hydra.nixos.org/build/233227433 at 2023-09-02
- selenium # failure in job https://hydra.nixos.org/build/233214276 at 2023-09-02
- sel # failure in job https://hydra.nixos.org/build/255671988 at 2024-04-16
Expand Down