-
Notifications
You must be signed in to change notification settings - Fork 710
cabal v2-sdist ignores --ignore-project #7965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
From what you say, it can be useful if |
It is occasionally useful. It seems to be broken though. I can reproduce. The |
Thanks. PR welcome. |
To give a bit of context, I am writing a script to make sdists from a bunch of github repos. Given the repos might have their own Does cabal actually need the source-repository-packages to make an sdist? I guess in case if a custom setup relies on those specific versions? |
You can always override those project files with a flag that sets the project file to a default one. I think that we can't actually make --ignore-project work as designed for this command. It gets ignored on initial read of the project. But then to get the packages to sdist, we have to call So 90% of commands can't take this flag as is, and have it stripped. I think there are very few use cases for this flag, and they can all be resolved by passing in another project file explicitly. If that workaround suffices, I vote we deprecate and then remove it. (There is of course a way to make it work, but it would require substantial rearchitecting, and I question its utility). |
Here is the commands that cannot use the ignore project option already: https://github.com/haskell/cabal/search?q=removeIgnoreProjectOption It includes "configure, build, exec, outdated". That's a pretty big list already, and I bet it works poorly and is possibly broken elsewhere that supports it, which is only "update, install, list-bin, run, repl" (and sdist, which we already know is broken). |
Thanks for the analysis and the suggested workaround @gbaz |
Hrm. there is also a feature request for using ignore-project more widely: #7057 The argument there (which is good) is that this can bypass the behavior of searching ever upwards for a project file. So that makes a case that we should actually push through the more irritating change uniformly and make --ignore-project actually work for everything. 🤔 |
@gbaz I don't think passing A quick
|
In that case the issue I guess is that not all commands can take a --project-file flag properly, and I think we definitely should fix that. |
@Colton-Clemmer good investigation, I guess that's because the cabal packages to build are defined in the local cabal project file (in |
I put up a pr for this issue that should hopefully resolve this problem #8109 |
v2-sdist now respects --ignore-project
With a PR merged, can this issue be closed? |
Except now |
Is this taken care of by the following PR? |
... and #8325 as issue. I suppose is good to link them here, thanks! |
Describe the bug
cabal sdist ignores
--ignore-project
Clearly cabal has read cabal.project and decided to fetch the mentioned source-repository-package.
Expected behavior
I would expect it to not read
cabal.project
files at all.System information
The text was updated successfully, but these errors were encountered: