Skip to content

Add installDirs (datadir, etc) to new-build and remove them from new-install - #8556

Merged
mergify[bot] merged 7 commits into
masterfrom
gb/datadir-newbuild
Jan 4, 2023
Merged

mergify[bot] merged 7 commits into
masterfrom
gb/datadir-newbuild

Conversation

@gbaz

@gbaz gbaz commented Oct 26, 2022 •

Copy link
Copy Markdown
Collaborator

Resolves #3586

Handles the --datadir flag, etc. in new-build. Also adds that flag to those that can be parsed from cabal.project files.

Further, removes those flags, which never worked, from cabal new-install, as the new install command, by design, always places things in a fixed location in the store.

@gbaz
gbaz marked this pull request as draft October 26, 2022 20:06
@gbaz
gbaz marked this pull request as ready for review October 31, 2022 20:54
@jneira jneira changed the title Add installDirs (datadir, etc) to new-build Add installDirs (datadir, etc) to new-build and remove them from new-install Nov 1, 2022

@Mikolaj Mikolaj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems a sensible thing to do.

@jneira

jneira commented Nov 9, 2022

Copy link
Copy Markdown
Member

nice fix, it would need a changelog, no?

@Mikolaj

Mikolaj commented Dec 9, 2022

Copy link
Copy Markdown
Member

@gbaz: could you add a tiny changelog? thank you!

Comment on lines +175 to +177
-- install doesn't take installDirs flags, since it always installs into the store in a fixed way.
notInstallDirOpt x = not $ optionName x `elem` installDirOptNames
installDirOptNames = map optionName installDirsOptions

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this how command line flags are usually filtered out? I would think we would have plenty of of cases of command foo handling some flags that are really just dispatched to the underlying command bar?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The issue is that nixStyleOptions adds these things as options. So in this particular case we have nix style options which we specifically want to filter out from a particular v2 command.

-- too much control!
--projectConfigUserInstall :: Flag Bool,
--projectConfigInstallDirs :: InstallDirs (Flag PathTemplate),
projectConfigInstallDirs :: InstallDirs (Flag PathTemplate),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we want to move this, or does the comment above still apply?

@Mikolaj

Mikolaj commented Dec 21, 2022

Copy link
Copy Markdown
Member

@gbaz: we are waiting in #8520 to test if this solves their use case. Any chance to merge this soon?

@gbaz

gbaz commented Dec 24, 2022

Copy link
Copy Markdown
Collaborator Author

Added a changelog and consider this ready to merge. Just need a second review!

@andreasabel

Copy link
Copy Markdown
Member

Needs SQUASHING.

@Mikolaj Mikolaj added the squash+merge me Tell Mergify Bot to squash-merge label Jan 2, 2023
@Mikolaj

Mikolaj commented Jan 2, 2023

Copy link
Copy Markdown
Member

@gbaz: I've added the label in the interest of swiftness. Please feel free to change the label in the next 2 days, before it gets merged.

@Mikolaj

Mikolaj commented Jan 2, 2023

Copy link
Copy Markdown
Member

Actually, @gbaz, I missed the merge conflict. :(

@mergify mergify Bot added the merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days label Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days squash+merge me Tell Mergify Bot to squash-merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--bindir is ignored without warning or suggestion that --installdir should be used [nix-local-build] Support --prefix, --datadir, etc

5 participants