-
Notifications
You must be signed in to change notification settings - Fork 696
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
Improve error message when multiple .cabal files are in the same directory #7396
base: master
Are you sure you want to change the base?
Conversation
Going to improve the error message as soon as I understood what the |
@fendor i guess your knowledge about |
any chance to make definitive the pr? |
Unfortunately, changing this requires a bit more refactoring than hoped... From
Although the latter is defined in another cabal file named |
I have a fix now, but it feels slightly brittle. We need a better strategy to track where a package originates from... |
Yeah, i think we are not tracking enough information in types across the different build phases. The use of monoids in the config f.e. causes a form of "monoid blindness` and we are losing the origin of each value. If phases, along with its inputs and outputs would be encoded in types keeping their sources until the end i think we could improve error messages and make some bugs harder to arise. There would be a |
Just typing these are probably not enough. It still seems like monkey patching, even if we track the provenancen of FieldDescr entries for this specific issue. |
I think this suffice for now as a clear improvement, and if you resolve the conflicts I think we should seek more reviews and merge. |
-- | An unpacked package in the given dir, or current dir, | ||
-- with the given .cabal file name within the given dir. | ||
-- If Nothing, this will default to @'PackageId' <.> "cabal"@. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like someone had a stroke while writing this comment.
I currently do not understand why the test has changed, while it might be benign, I would like to understand why we resolve to a different target now. |
0c87ca2
to
43dbb04
Compare
-- Test that we can resolve a module name ambiguity when reexporting | ||
-- by explicitly specifying what package we want. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- Test that we can resolve a module name ambiguity when reexporting | |
-- by explicitly specifying what package we want. |
I have no idea why the test fails... must be some tricky interaction... |
The error is here, right?
|
Perhaps the version is expected and should just be committed as the new results of the test? Aren't you changing just these bits of the code? |
Right
As long as I don't understand why the value has changed, it is not expected.
Yeah, that might be the solution, but I at least would feel better if I understood the reason for the changed value. |
As it turns out, the failing test-case is genuine. |
6187bee
to
b5f73f7
Compare
-- If @mCabalFile@ is 'Nothing', then the '.cabal' file can be assumed to | ||
-- be '<package-name>.cabal'. | ||
-- Otherwise, @mCabalFile@ points to the '.cabal' file within @directory@. | ||
LocalUnpackedPackage FilePath (Maybe FilePath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make this a record would suppose lot of changes? field names would help a lot in understand the two params
How about a changelog? |
I am not sure why, but I think like my tests are not picked up by CI |
borked rebase? |
cause they are succesful? they are not printed out in logs, only failed, known broken and skipped ones:
https://github.com/haskell/cabal/runs/5316369875?check_suite_focus=true make them fail cherry picking tests in a branch based on master to check ;-) |
But the test doesn't succeed locally any more T_T I am so confused |
Not sure if it can help but last master workflow run has 305 tests and no 306:
https://github.com/haskell/cabal/runs/5315945053?check_suite_focus=true |
borked local rebase? |
I rebased again to make sure, but I think everything's "in order" locally. |
This looked very close to completion. @fendor how do you feel about bringing it over the line? |
Unfortunately, it is not that close, I am failing to write a proper integration test that proves that this PR actually achieves what it sets out to do. |
closes #7395
Please include the following checklist in your PR: