Skip to content
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

Fix project relative imports #8686

Merged
merged 7 commits into from
Jan 21, 2023

Conversation

sergv
Copy link
Collaborator

@sergv sergv commented Jan 17, 2023

Fix bug where cabal tries to resolve imports by relative paths against the directory cabal executable was invoked in rather than directory of cabal.project file that does the import.

The problem occurs if <toplevel>/cabal.project does something like import: dep/cabal.project and then cabal build is invoked from some subridectory e.g. <toplevel>/dep2. Cabal tries to resolve dep/cabal.project against <toplevel>/dep2 but it probably should do the resolution against the <toplevel> directory that contains cabal.project that does the import.


Please include the following checklist in your PR:

Please also shortly describe how you tested your change. Bonus points for added tests!

@gbaz
Copy link
Collaborator

gbaz commented Jan 17, 2023

Looks good, and like a correct fix. Please fix the warnings on the tests so CI passes :-)

@Mikolaj Mikolaj added attention: needs-review re: project root Concerning what cabal considers the root of the project labels Jan 17, 2023
@Kleidukos Kleidukos added squash+merge me Tell Mergify Bot to squash-merge and removed attention: needs-review labels Jan 19, 2023
@mergify mergify bot added the merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days label Jan 21, 2023
@mergify mergify bot merged commit 0db95ca into haskell:master Jan 21, 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 re: project root Concerning what cabal considers the root of the project squash+merge me Tell Mergify Bot to squash-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants