Repository navigation
Fix assorted bugs found in code review (v2/v1 builders, parser, modules, overlays, hix, nix-tools) - #2610
Open
hamishmack wants to merge 7 commits into
Open
Fix assorted bugs found in code review (v2/v1 builders, parser, modules, overlays, hix, nix-tools)#2610hamishmack wants to merge 7 commits into
hamishmack wants to merge 7 commits into
Conversation
Contributor
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
* build-cabal-slice: `builtins.toFile` rejects text that references a derivation output, so per-package `configureOptions`/`ghcOptions` mentioning a store path (or darwin framework `extra-lib-dirs`) failed eval. Use `writeText` only when the text carries derivation context; context-free text keeps `toFile` and identical hashes. * comp-v2-builder: fail when an exe slice did not produce its binary instead of caching a placeholder script that exits 1. * configure-args: stop re-emitting `--<prog>-option=` under `configure-options:`. cabal hashes that field into `pkgHashConfigureScriptArgs` and only passes it to ./configure, so it forked the slice UnitId from plan-nix without reaching the program. These options already round-trip via `<prog>-options:`.
* haddock-builder: propagate the dependencies' haddock derivations (`docsConfigFiles.libDeps`) so the docs package DB has working `haddock-interfaces`/`haddock-html` for cross-package links (regressed in cfd757a). Also pass backpack `instantiations` and `prebuilt-depends` as the build derivation does. * make-config-files: the fallback when `ghc.cachedDeps` is missing interpolated the GHC store path rather than the `cachedDeps` drv. * shell-for: `propagateBuildInputs` typo silently dropped the user's `propagatedBuildInputs`. * check: don't inherit `cleanSrc` (never present) or `configFiles` (only with `keepConfigFiles`) into passthru; correct the stale comment about `doCrossCheck`.
…ponent keep flags * cabal-project-parser: only treat whole-line or whitespace-preceded `--` as a comment. A commented-out `-- --sha256:` line corrupted the preceding `tag`, and URLs containing `--` were truncated. Add a unit test. * clean-cabal-component: match source/include/data dirs on path boundaries (`src` no longer pulls in `src-gen`), and keep `package.yaml` for packages in a subdirectory. * package.nix: the `keep*` flags were `//`-ed onto a `mkMerge` value and ignored by the module system; make them part of the merge. * hackage-quirks: lsp-test and postgrest replaced the generated `cabal.project` with `packages: .`, dropping the package from the plan; put their flags in `cabalProjectLocal` instead.
* hix: `--supportedSystems`, `--overlays` and `--config` were ignored unless `--projectArgs` was also given. * flake: exclude GHC < 9.6 from devShells; those compilers throw and broke `nix flake check`. * mingw_w64: quote "$@" in the wine iserv and test wrappers, don't abort on `libX.dll`/`X.dll` clashes or an unmatched glob, respect a caller's WINEPREFIX, drop dead assignments. * windows: remove the `mfpr` override (a typo for mpfr that never applied).
…output fetchWith now reads the prefetch output before waiting for the process (avoids a pipe-buffer deadlock) and handles empty output without a partial pattern. Applied to both nix-tools and the nix-tools-sh mirror. (The cache-reader fix originally in this commit is superseded by NixTools.Cache from #2544.)
* haddock-builder: revert to master. Propagating the deps' `.haddock` derivations also pulled in `.profiled.haddock` when profiling is enabled, and forced a haddock derivation per dependency even with `doHaddock = false`. Needs a separate design. * Move `textFile` to haskellLib (using `pkgs.writeText`, matching the neighbouring `source-repo-block`) and use it for the cabal file in comp-v2-builder too. * package.nix: remove the `allComponent` keep* merge. comp-builder reads keep* from the component being built, not `allComponent`, so the merge was dead and could conflict with user definitions. * mingw_w64: keep the hermetic `WINEPREFIX=$TMP` for iserv. * flake: filter devShells with `tryEval` on the compiler version so the cut-off tracks `traceWarnOld` rather than a hardcoded regex.
hamishmack
force-pushed
the
hkm/tier1-bug-fixes
branch
from
October 26, 2026 10:25
fa93f0d to
4dc1104
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bugs found during a review of the codebase. They are grouped into one PR to keep CI runs down, with one commit per area.
v2 builder
builtins.toFilerejects text that references a derivation output. Per-packageconfigureOptions/ghcOptionscontaining a store path, and darwin framework dirs, therefore failed eval.writeTextis now used only when the text has derivation context, so the hashes of context-free text are unchanged.--<prog>-option=is no longer re-emitted underconfigure-options:. cabal hashes that field intopkgHashConfigureScriptArgsand only passes it to./configure, so the slice's UnitId diverged from plan-nix's. These options still reach the program via<prog>-options:.v1 builder
ghc.cachedDepsis missing pointed at the GHC store path.propagateBuildInputstypo dropped the user'spropagatedBuildInputs.cleanSrc,configFiles). The comment aboutdoCrossChecknow matches what it does; its behaviour is unchanged.Eval / modules
-- --sha256:line corruptedtag, and URLs containing--were truncated. Includes a unit test.hs-source-dirs: srcalso matchedsrc-gen/, andpackage.yamlwas dropped for packages in a subdirectory.cabal.projectwithpackages: ., which dropped the package from the plan.Overlays / hix / flake
--supportedSystems,--overlaysand--configwere ignored unless--projectArgswas also passed.devShells: GHC < 9.6 is now excluded, because those compiler attributes throw and breaknix flake check."$@"libX.dllandX.dll, and a glob that matches nothingWINEPREFIXmfproverride, a typo formpfrthat has never applied.nix-tools
These fixes take effect once a new static nix-tools release is published.
fetchWith: read the output before waiting for the process, which avoids a deadlock, and handle empty output.NixTools.Cachefrom nix-tools: share the git-fetch cache between plan2nix and stack2nix (#1689) #2544 already covers it. ThefetchWithfix is applied to bothnix-toolsandnix-tools-sh.Expected hash changes
<prog>-options.Testing
.nixfile parses.unittests pass.plan-to-nixandstack-to-nixbuild.Changes after review
The changes below are in fa93f0d, made after a
/code-reviewpass; Copilot couldn't review because of quota..profiled.haddock, and it built a haddock derivation for every dependency, even those withdoHaddock = false. It will come in a separate PR.allComponentkeep-flag merge. Nothing reads it, and it could conflict with user definitions.textFileis now in haskellLib and is also used for the cabal file in comp-v2-builder.devShellsfilter now usestryEval, so it followstraceWarnOld.WINEPREFIX=$TMP.