Repository navigation
v2-sdist now respects --ignore-project - #8109
Conversation
|
I didn't see the errors on validate.sh when I made the PR. I'm working on fixing them. It looks like the |
|
There have been some CI (validate) breakage in the last days, just fixed. If you rebase, perhaps some errors are going to vanish? |
|
@Mergifyio rebase master |
✅ Branch has been successfully rebased |
f1b28ff to
5255244
Compare
b3bded9 to
d2ad54a
Compare
|
Ok, I think I have it ironed out. The reason the tests were failing is because the tests implicitly use the "--project-file" flag that is not given in the test file but in configuring the Also, just so I know I'm fixing the issue at hand I made the example project given by @andreabedini in #7965 and this was the result. |
|
I also added two "cabal.project" files to two of the tests because the "--project-file" flag is always set to "cabal.project". This made it look for the "cabal.project" file and found it in the root cabal directory. I assume that using the "--ignore-project" flag was an attempt to mitigate this behavior but it isn't its intended functionality and whenever I fixed it, it broke what I assume was a less than perfect solution. I hope my changes better reflect the way it's supposed to work. It if doesn't I can change the functionality. |
|
I have no idea why these tests are failing now |
|
Yes, apologies. Probably some problems with GHA cache: #8120 (comment) |
|
Now the cache fixed itself. Let's hope it won't repeat. |
|
@Colton-Clemmer, @jneira: are you fine to merge? |
thanks for the ping, only a minor comment, marked as resolved the previous ones |
|
@Mikolaj Thanks for letting me know that cleared up |
|
Apparently some validates timed out (1h, cancelled). I blame GHA until proven innocent. Will restart once it finishes. |
|
Can someone help this PR along? not sure what's wrong with it. |
|
@Colton-Clemmer It looks like the workflow had failed for some network issue, then it got rerun but mergify still thinks it had failed. Let's try this: @Mergifyio refresh |
|
I don't think it worked :-/ |
|
Strange. Let's be insistent. |
|
@Mergifyio rebase |
✅ Branch has been successfully rebased |
|
@Mergifyio refresh |
✅ Pull request refreshed |
|
@Mergifyio requeue |
✅ The queue state of this pull request has been cleaned. It can be re-embarked automatically |
|
I think the problem may be that the docs/readthedocs.org:cabal job failed randomly and we have no way of restarting it (unlike all other tests). So we need to make some fake commits or ammends to restart all tests. I will try something. |
|
@Mergifyio update |
✅ Branch has been successfully updated |
|
This seems to have done the trick (that is, restarted all tests). This merge commit I added is probably going to vanish after the next rebase, but if not, please remove it, because it pollutes git history |
|
O dear, I haven't noticed the merge_me label. But, luckily, the git history pollution is minimal. Thank you for this contribution! |
|
Thank you @Colton-Clemmer ! |
It seems that many commands did not respect the
--ignore-projectflag at all and always built from thecabal.projectfile that the program can find either in it's current directory or the parent directories. This PR changes thereadProjectConfigfunction of theDistribution.Client.ProjectConfigto accept a boolean that will determine if the function will return the only the global project config or the settings found in the localcabal.projectfile. Whatever is returned gets merged with the localfoo.cabalfile and the package config is returned. This should make it so that if the--ignore-projectflag is set then the localcabal.projectfile will be ignored and the global config and thefoo.cabalfile are merged together and thesdistcommand is run with that configuration.There was some discussion about the other commands that may or may not work with this flag. It was unclear to me whether or not they should be fixed and to what extent. This pr is just to have a proof of concept for the other commands so that I know that this flag is now doing what it is supposed to do and more work can be done later to the other commands making it behave the same way.
I wrote a test for this that tests the
readProjectConfigwith the flag set to true (all other tests that use this command were set to false for consistency). I'm not sure how to abstract this test any farther up the chain but that may not be needed since thereadProjectConfigfunction is the only one with any significant change.Below is some output with the new changes showing that the

--ignore-projectflag ignores thecabal.projectfile for the "cabal" project when in the "cabal-install" folder.