Repository navigation
maintainers/scripts/haskell: Fix relative imports to work with nix and lix - #581707
Conversation
…nd_ lix Running these scripts with lix has regressed in NixOS#554512 This is because nix changed the way it resolves relative imports after lix was forked. This PR uses an import method which behaves identically on nix and lix. AI Disclaimer: I typed and tested all of this myself but an LLM helped me debug and suggest the solution.
wolfgangwalther
left a comment
There was a problem hiding this comment.
I was just looking to fix the script myself as well...
TIL, that nix-shell -p also takes expressions.
LGTM.
|
@wolfgangwalther Are you also looking at the follow-up problem with the transitive-broken going wrong? Because I would look into that next, if you are not. |
I am just right now looking at that, yes. |
I give up - again. On my first attempt (#572089 (comment)), I concluded that In my second attempt today, I discovered, that there seems to be a difference between packages using Observe:
I think #557381 is just faulty. There's probably a simple way to work around this, but I didn't immediately find it. |
|
Or maybe... Seems like there is |
| @@ -1,5 +1,5 @@ | |||
| #! /usr/bin/env nix-shell | |||
| #! nix-shell -i bash -E 'with import ../../.. {}; mkShell { packages = [ bash coreutils haskellPackages.cabal2nix-unstable.bin git (import ../../../ci {}).fmt.pkg ]; }' | |||
| #! nix-shell -i bash -I nixpkgs=. -p bash coreutils haskellPackages.cabal2nix-unstable.bin git "(import <nixpkgs/ci> {}).fmt.pkg" | |||
There was a problem hiding this comment.
Yeah, that's not pretty. Any idea how we can solve Bothe problems at once?
Running these scripts with lix has regressed in #554512 This is because nix changed the way it resolves relative imports after lix was forked.
This PR uses an import method which behaves identically on nix and lix.
AI Disclaimer: I typed and tested all of this myself but an LLM helped me debug and suggest the solution.
Things done
./result/bin/.nixpkgs-reviewon this PR. See nixpkgs-review usage.passthru.tests.