Repository navigation
List each datadir variable once in the setup environment - #12552
Open
ulysses4ever wants to merge 4 commits into
Open
ulysses4ever wants to merge 4 commits into
ulysses4ever wants to merge 4 commits into
Conversation
dataDirsEnvironmentForPlan made an entry for each in-place unit of the plan, and each component of a package is a unit of its own, with the same variable and directory. The list goes to the setup of every component and into the environment of each program it configures, so setup-config grew with the square of the number of components. Drop the duplicates. Found while looking into haskell#12544. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0176vAefrw8jPKXdh9h1wKuj
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0176vAefrw8jPKXdh9h1wKuj
Instead of removing the duplicate entries afterwards, take one variable for each package in the plan: the plan has a unit for each component of a package, and the variable is the package's. The variables and their values stay the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0176vAefrw8jPKXdh9h1wKuj
5 of 6 tasks
ulysses4ever
marked this pull request as ready for review
November 14, 2026 14:03
sheaf
approved these changes
Dec 4, 2026
Co-authored-by: sheaf <sam.derbyshire@gmail.com>
Collaborator
Author
|
@michaelpj this works on improving situation with your #12544. Could you provide a review and/or approve? Just one approval left. |
michaelpj
approved these changes
Dec 4, 2026
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.
A local package's
<name>_datadirvariable now appears once in the environment of each setup, instead of once for every component of the package. For #12544. Below is the longer story from your friendly AI engine (Opus 5.5).dataDirsEnvironmentForPlanmakes an entry for each in-place unit of the plan, and each component of a package is a unit of its own, with the same variable and the same directory. The list goes to the setup of every component and into the environment of each program it configures, so it is stored in everysetup-configabout twenty times. As a result, thesetup-configfiles grew with the square of the number of components. This takes the variable once for each package in the plan instead of once for each unit; the variables and their values stay the same.On a project of 10 packages with 10 components each, after a build:
setup-configsetup-configfilesThe time of a build did not change measurably at this size (12.9 s and 12.6 s).
Testing
DataDirEnvOncebuilds a package with three components and checks that each list of environment overrides in the log has the package's datadir variable once; with master's cabal, each list has it three times.DataDirSetupTest,BuildToolDependsandPathRecomppass locally.significance: significantin the changelog file.QA Notes
In a package with several components,
cabal build -v2prints "Including the following environment variable overrides:" before each component; each list now has the package's<name>_datadironce, instead of once per component.🤖 Generated with Claude Code
https://claude.ai/code/session_0176vAefrw8jPKXdh9h1wKuj