-
Notifications
You must be signed in to change notification settings - Fork 704
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
source-repository-package seems to be treated as local #5586
Comments
Fwiw, I consider having source-repository-package cached in the global store a killer feature; and I feel like in the majority of use-cases you'd want to err on caching it globally rather than not. That being said, I welcome the ability to opt-out and force it to be treated as local if the user wishes so. Something I think I briefly discussed with Duncan in the context of the source-repo-package UI was to have a generic uniform "package" syntax where you could explicitly force/control whether a package in the build-plan is demoted to a |
How do packages that are in an index that is referenced in a specific |
What is the status of this ticket after #5708 was merged into |
@RyanGlScott this ticket is still relevant insofar as the |
In a CI build |
@harendra-kumar is this workaroundable by adding a
? (if yes, maybe we can have this "hack" wired into |
@hvr this will work for me. I guess it makes sense to do it only if this is significantly easier/faster to do compared to the right long term fix. |
Using the incredibly simple but effective trick here: haskell/cabal#5586 (comment) This is yet another hack needed to work around haskell-CI/haskell-ci#184, which in turn is needed because of haskell/cabal#5586.
@hvr thanks for that workaround, works great! |
I just hit something that I suspect is another effect of this: packages that are included as a Why would you want this? If you are using Nix and you are in a shell which has been prepared with your dependencies (including the But I think this is just a consequence of |
Another consequence of this: if we have a freeze file (e.g. from stackage) and then a source dependency where the source version has move the version forward, then the constraint solver fails to find a solution. I think the constraint solver should ignore the constraint on the package in the case that there is an explicit source dependency (this is what stack does). |
I just hit precisely the issue Sam mentions today. |
So, from discussion with @dcoutts, it has been further confirmed, that this shadowing is by design -- the If we follow this design, then the proper solution for package DB un-shadowing would be conditionalisation of the clauses -- as per #6249 |
Just as a matter of recording here the information: Duncan says that to change "what is considered local for the purpose of applying project-wide flags/settings", the place to modify is ..and so we want to drop the repositories there -- and further, that:
|
…edPackage Also calculate hashes for all locally available tarballs.
With the issue closed, is a source-repository-package now supposed to be cached in the global store? I just ran |
The repository is cloned, but should be built only once. We decide whether it's the same via the contents, i.e. if you clone it from different fork, or get the sources somehow otherwise, it's still the same. E.g. if the very same |
I suppose for a Hackage package you decide whether the package is the same by the package name and version? For a source-repository-package, at least for a git package, can we decide whether the package is the same via the location and tag (commit hash)? This way, the package (source) can also stored in the global store instead of the project's dist-newstyle/src. dist-newstyle is cleared every time "cabal clean" is run and then "cabal build" will have to download the source-repository-package all over again. |
No, the contents of tarball also matter. The hash of contents (and |
Is it a design choice to cache the source-repository-package locally instead of in the global cache or is that just the thing that happens to be easy to implement? |
afaik it's a design choice. there should be a pr/issue somewhere with relevant discussion |
For source-repository-package's, cabal tries to build them on its own, even when all dependencies are already provided by Nix. Relevant issues: - haskell/cabal#6049 - IntersectMBO/ouroboros-network#645 - haskell/cabal#5586 (comment) This seems to be a problem even with a cabal that includes haskell/cabal#6917 (see input-output-hk/haskell.nix#720 (comment) for how to test a cabal-install 3.4) The only known workaround is to remove the source-repository-package sections from cabal.project, but this should only be done for cabal when used from a nix-shell, not from cabal without a nix-shell, and not outside the nix-shell. To make this work smoothly, the script `scripts/nix-setup` can be used, which splits the source-repository-package sections into cabal.project.srcs, which is then again included from here (to make the Nix setup still work). Running the script again undoes it.
For source-repository-package's, cabal tries to build them on its own, even when all dependencies are already provided by Nix. Relevant issues: - haskell/cabal#6049 - IntersectMBO/ouroboros-network#645 - haskell/cabal#5586 (comment) This seems to be a problem even with a cabal that includes haskell/cabal#6917 (see input-output-hk/haskell.nix#720 (comment) for how to test a cabal-install 3.4) The only known workaround is to remove the source-repository-package sections from cabal.project, but this should only be done for cabal when used from a nix-shell, not from cabal without a nix-shell, and not outside the nix-shell. To make this work smoothly, the script `scripts/nix-setup` can be used, which splits the source-repository-package sections into cabal.project.srcs, which is then again included from here (to make the Nix setup still work). Running the script again undoes it.
For source-repository-package's, cabal tries to build them on its own, even when all dependencies are already provided by Nix. Relevant issues: - haskell/cabal#6049 - IntersectMBO/ouroboros-network#645 - haskell/cabal#5586 (comment) This seems to be a problem even with a cabal that includes haskell/cabal#6917 (see input-output-hk/haskell.nix#720 (comment) for how to test a cabal-install 3.4) The only known workaround is to remove the source-repository-package sections from cabal.project, but this should only be done for cabal when used from a nix-shell, not from cabal without a nix-shell, and not outside the nix-shell. To make this work smoothly, the script `scripts/nix-setup` can be used, which splits the source-repository-package sections into cabal.project.srcs, which is then again included from here (to make the Nix setup still work). Running the script again undoes it.
For source-repository-package's, cabal tries to build them on its own, even when all dependencies are already provided by Nix. Relevant issues: - haskell/cabal#6049 - IntersectMBO/ouroboros-network#645 - haskell/cabal#5586 (comment) This seems to be a problem even with a cabal that includes haskell/cabal#6917 (see input-output-hk/haskell.nix#720 (comment) for how to test a cabal-install 3.4) The only known workaround is to remove the source-repository-package sections from cabal.project, but this should only be done for cabal when used from a nix-shell, not from cabal without a nix-shell, and not outside the nix-shell. To make this work smoothly, the script `scripts/nix-setup` can be used, which splits the source-repository-package sections into cabal.project.srcs, which is then again included from here (to make the Nix setup still work). Running the script again undoes it.
They are no longer always local: haskell/cabal@2b6cd51 haskell/cabal#5586
They are no longer always local: haskell/cabal@2b6cd51 haskell/cabal#5586
They are no longer always local: haskell/cabal@2b6cd51 haskell/cabal#5586
This means that
--enable-tests
will build the tests of those dependencies,--enable-benchmarks
will build the benchmarks,new-test
will (presumably) run their tests, and so on.This was quite surprising to me, since my primary use case for
source-repository-package
is to swap in a broken version of a dependency with a fixed pre-release version from the VCS. But doing that means that, if the dependency's test suite is not in great condition (e.g., it doesn't even compile because I'm trying to port things to a new GHC version), I'm suddenly going to be affected by that!The discussion in #2189 suggests that this is for implementation convenience (which is entirely reasonable), rather than a deliberate decision. Are there use cases where packages being pulled from a VCS should be local for principled reasons? I can't think of any off the top of my head, but there's a whole universe of potential weirdness out there.
Edit: Also, I suspect we could decouple the relevant aspects of 'localness': a
source-repository-package
could be treated as local for the purposes of recompilation checking and not going into the global store, but non-local for the purposes of 'should this package's tests/benchmarks be available for building/running?'.The text was updated successfully, but these errors were encountered: