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

New feature required to work around platform-specific source-repository-package issue #7083

Closed
newhoggy opened this issue Sep 22, 2020 · 5 comments

Comments

@newhoggy
Copy link

newhoggy commented Sep 22, 2020

Describe the bug
Sometimes we have the situation where a package we depend only builds on a specific platform. For example libsystemd-journal only builds on Linux. We can if os(linux) in the cabal file, so that much is fine, but let's say the package has a bug in it and we want to fork it and used the fork until the bug is upstreamed. This does not work because source-repository-package adds the project to the list of local packages to always build, so cabal all no longer works, which breaks CI.

To Reproduce
Described above.

Expected behavior
This could be fixed in a number of ways. Add support for if in cabal.project would allow us to conditionally add source-repository-package. Or we could make source-repository-package not add to the list of local projects to build.

System information
Affects all versions of cabal currently.

Additional context
Work arounds include using allow-newer, for example allow-newer: libsystemd-journal:base if the problem is just a version bound adjustment.

But this does not solve the problem if the problem preventing the build from succeeding is not a bounds issue.

iohk-bors bot added a commit to input-output-hk/iohk-monitoring-framework that referenced this issue Sep 22, 2020
588: Fix build for MacOS r=deepfire a=newhoggy

description
-----------
See haskell/cabal#7083 for an explanation of why `source-repository-package` stanzas that reference packages on a specific platform causes problems for platforms where the package doesn't build.

checklist
---------

- [x] compiles (`cabal v2-build` or `stack build`)
- [x] tests run successfully (`cabal v2-test` or `stack test`)
- [ ] documentation added
- [ ] link to an issue
- [ ] add milestone (the current sprint)


Co-authored-by: John Ky <john.ky@iohk.io>
georgefst added a commit to georgefst/monpad that referenced this issue Jan 2, 2022
…on Windows

This is necessary due to haskell/cabal#7083.

I'm not actually sure why `rawfilepath` isn't building on Windows (with GHC 9.2), but seeing as I already have one unaddressed PR there, I don't really want to investigate further. And `rawfilepath` is only a dependency via `unix`, which obviously shouldn't be built on Windows.
@georgefst
Copy link

I've just hit this, as you can see above. I guess ideally it would be closed via #5444?

@gbaz
Copy link
Collaborator

gbaz commented Jan 2, 2022

Yeah, looks like the same exact issue in fact. Can we close this one as a dup?

@georgefst
Copy link

I wouldn't call it the exact same issue. But #5444 is a solution to this one, and probably the best one. I guess if maintainers agree that this should be fixed by implementing #5444, then there's an argument for closing it.

@gbaz
Copy link
Collaborator

gbaz commented Jan 4, 2022

ok lets just note this will be resolved by #7783

@jneira
Copy link
Member

jneira commented May 6, 2022

...and as #7783 adding conditionals to cabal
project has been merged, we can close this
thanks all!

@jneira jneira closed this as completed May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants