!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

723 Members
For discussions and questions about Haskell with Nix, cabal2nix and haskellPackages in nixpkgs | Current Docs: https://haskell4nix.readthedocs.io/ | More Nix: #community:nixos.org | More Haskell: #haskell-space:matrix.org144 Servers

Load older messages


SenderMessageTime
22 Feb 2025
@alexfmpe:matrix.orgalexfmpe
In reply to @alex:tunstall.xyz

Here's an idea: override Haskell's mkDerivation to add all of the function arguments to passthru. Since it's passthru, it shouldn't invalidate caching.

Otherwise, there's also this ugly hack.

nix-repl> (haskell.lib.doJailbreak haskellPackages.lens).postPatch
"echo \"Run jailbreak-cabal to lift version restrictions on build inputs.\"\n/nix/store/7q7kmsirmz061126189935lwjw5yhdlv-jailbreak-cabal-1.4/bin/jailbreak-cabal lens.cabal\n"

nix-repl> (haskell.lib.dontJailbreak haskellPackages.lens).postPatch 
""
Oh, you're saying to disable postPatch all together
22:58:50
@alexfmpe:matrix.orgalexfmpeI guess that's usable22:59:21
@alexfmpe:matrix.orgalexfmpeI did think about shoving 'jailbreak' in passthru, but that only lets me read, not write right?23:00:28
@alexfmpe:matrix.orgalexfmpedoCheck works because the one I can set is the same mkDerivation will read23:00:49
@alexfmpe:matrix.orgalexfmpepassthru just 'mirrors'23:00:59
@alexfmpe:matrix.orgalexfmpeThere's no pass-by-reference23:01:10
@alexfmpe:matrix.orgalexfmpe
In reply to @alexfmpe:matrix.org
I guess that's usable
As in, few false positivirs
23:01:54
@alexfmpe:matrix.orgalexfmpe* As in, few false positives23:02:02
@alex:tunstall.xyzAlex Well you can override mkDerivation to completely ignore doJailbreak too. It's not entirely clear to me what you're trying to do. 23:02:13
@alexfmpe:matrix.orgalexfmpe
In reply to @alexfmpe:matrix.org
As in, few false positives
Vanishingly few if I just sed out the jailbreak-cabal line
23:02:44
@alexfmpe:matrix.orgalexfmpe
In reply to @alex:tunstall.xyz
Well you can override mkDerivation to completely ignore doJailbreak too. It's not entirely clear to me what you're trying to do.
Brute force discovery of needless jailbreaks
23:03:07
@alexfmpe:matrix.orgalexfmpeFind all jailbreaked ones, unjailbreak, attempt build of all, report the ones that worked23:03:38
@alexfmpe:matrix.orgalexfmpeTechnically it can't report the ones whose deps failed, but doing it one at a time takes an eternity of eval23:04:23
@alexfmpe:matrix.orgalexfmpe* Technically it can't report the ones whose deps failed to build due to that change, but doing it one at a time takes an eternity of eval23:04:42
@alexfmpe:matrix.orgalexfmpe
In reply to @alex:tunstall.xyz
Well you can override mkDerivation to completely ignore doJailbreak too. It's not entirely clear to me what you're trying to do.
I guess I could do this for a one off, but the idea is having a fire and forget script one can run whenever
23:06:50
@alexfmpe:matrix.orgalexfmpeRather than some patch to mkDerivation or generic-builder23:07:52
@alexfmpe:matrix.orgalexfmpeThis is why I said 'from the outside'23:08:08
@alexfmpe:matrix.orgalexfmpeeh, I guess you could still have a .patch file and apply it from the script23:08:32
@alexfmpe:matrix.orgalexfmpeThink I can hack a 'getter' and 'setter' for jailbreak by doing invasive surgery to postPatch23:08:53
@alexfmpe:matrix.orgalexfmpeThat lets me use the same overall shape I did for dontCheck hunting23:09:11
@alex:tunstall.xyzAlex
In reply to @alexfmpe:matrix.org
Rather than some patch to mkDerivation or generic-builder
No patching is needed, it can be done like you'd override any other package in the Haskell set.
23:53:12
@alexfmpe:matrix.orgalexfmpenot sure I follow23:54:08
@alexfmpe:matrix.orgalexfmpehow would I unset doJailbreak by overriding mkDerivation23:55:00
@alexfmpe:matrix.orgalexfmpe btw this is how I ended up detecting: v: lib.hasInfix "jailbreak-cabal" v.postPatch; 23:55:39
@alexfmpe:matrix.orgalexfmpestringly hack, but a decent first approximation23:56:07
@alexfmpe:matrix.orgalexfmpealso, I only want to do this for the ones for which it is set, otherwise mass rebuild23:57:16
23 Feb 2025
@alexfmpe:matrix.orgalexfmpe oh I see what you mean, override the jailbreak argument itself 00:09:10
@alexfmpe:matrix.orgalexfmpeok that's working00:26:13
@alexfmpe:matrix.orgalexfmpe
  get = v: lib.hasInfix "jailbreak-cabal" v.postPatch;
  set = x: v: v.overrideAttrs(_: _: { jailbreak = x; });
  reset = set false;
00:26:23
@alexfmpe:matrix.orgalexfmpeok so it's building...511 packages, ouch 300 of which are amazonka ones00:28:58

Show newer messages


Back to Room ListRoom Version: 6