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

Change recommendation: include generated cabal files #5210

Closed
snoyberg opened this issue Mar 4, 2020 · 13 comments
Closed

Change recommendation: include generated cabal files #5210

snoyberg opened this issue Mar 4, 2020 · 13 comments

Comments

@snoyberg
Copy link
Contributor

snoyberg commented Mar 4, 2020

For details of the proposal, see the blog post: https://tech.fpcomplete.com/blog/storing-generated-cabal-files

If you are in favor of this change, please press thumbs up below. If you are opposed, please press thumbs down. Of course, feel free to include additional comments below.

@snoyberg snoyberg added this to the P0: Blocking release milestone Mar 4, 2020
@snoyberg snoyberg self-assigned this Mar 4, 2020
@gromakovsky
Copy link

One problem with this approach that I encountered is that rebases become more painful. We have a repo with many packages, each one has package.yaml and we store .cabal files in the repo. If someone updates .cabal file(s) in master and you update something different in .cabal files in your branch by updating package.yaml and regenerating them (e. g. you both add a new dependency), you will get unnecessary conflicts because hpack adds a line with a hash.

It's not something critical, I just wanted to warn people about this inconvenience.

@cdornan
Copy link

cdornan commented Mar 7, 2020

I have been getting feedback from non-stack users complaining about repos with no cabal files. From their perspective it is frustrating so I am delighted with this proposal even if it might be a little more inconvenient. N retrospect Cabal files form the basis of the package system so it is better to include them directly.

snoyberg added a commit to commercialhaskell/stack-templates that referenced this issue Mar 8, 2020
@snoyberg
Copy link
Contributor Author

snoyberg commented Mar 8, 2020

OK, I'm going to move ahead with this. Thanks for the responses all. Closing as the discussion is done, will be merged to master fairly soon.

@snoyberg snoyberg closed this as completed Mar 8, 2020
snoyberg added a commit to snoyberg/yaml that referenced this issue Mar 8, 2020
snoyberg added a commit to commercialhaskell/pantry that referenced this issue Mar 8, 2020
snoyberg added a commit that referenced this issue Mar 9, 2020
This ties in to the overall goal of #5210. Lock files should no longer
include packages without cabal files. We could either remove those from
freeze files, or get rid of freeze files entirely. Since freeze files
are already on their way out, may as well just cut them off entirely
now.
snoyberg added a commit that referenced this issue Mar 9, 2020
snoyberg added a commit that referenced this issue Mar 10, 2020
This ties in to the overall goal of #5210. Lock files should no longer
include packages without cabal files. We could either remove those from
freeze files, or get rid of freeze files entirely. Since freeze files
are already on their way out, may as well just cut them off entirely
now.
snoyberg added a commit that referenced this issue Mar 10, 2020
@simonmichael
Copy link
Contributor

Agreeing with gromakovsky that this can very often cause conflicts and pain when merging/cherry-picking/switching branches/trying different stack/hpack versions. I think it's worth changing hpack to fix this - if you agree, consider helping sol/hpack#380.

@ulidtko
Copy link

ulidtko commented Jul 30, 2020

Hi! Let me just describe one failure mode collateral from this change. Hopefully, it'll make searching for it easier and speed up resolutions. No response required.

First, the error message:

2020-07-30 10:18:19.050984: [error] Aeson exception:
Error in $.packages[19].completed: failed to parse field 'packages': failed to parse field 'completed': Could not parse a UnresolvedPackageLocationImmutable from: Object (fromList [("size",Number 294200.0),("url",String "https://github.com/private-company/vendor-fork-redacted/archive/fcbaf261368b7f63708351fb1b04eb7f5f0793a3.tar.gz"),("name",String "vendor-fork-redacted"),("version",String "0.9.1"),("sha256",String "54974f6f9851376292cb6f081eef2cd907396899a04af5776da2d2cc45e80fc6"),("pantry-tree",Object (fromList [("size",Number 5039.0),("sha256",String "bc3f1c77c2797f0d0915f5ffff38d5e3cf8cdc613507fe1ace9463bc2492aafc")]))])

Now the cause. In my case, local-development Stack v2.3.1 has produced unintended change to stack.yaml.lock which wasn't understood by Stack v2.1.3 on CI:

@@ -154,9 +140,6 @@ packages:
 - completed:
     size: 294200
     url: https://github.com/private-company/vendor-fork-redacted/archive/fcbaf261368b7f63708351fb1b04eb7f5f0793a3.tar.gz
-    cabal-file:
-      size: 4079
-      sha256: a24d964776e360d0545500c8b28ec254aa323fdf28fa55692a282a25b6ac652c
     name: vendor-fork-redacted
     version: 0.9.1
     sha256: 54974f6f9851376292cb6f081eef2cd907396899a04af5776da2d2cc45e80fc6

Reverting this unintended change fixes the error (as well as updating Stack on CI).

The error reporting could perhaps be better; but this behavior change is well-documented on the ChangeLog. Hope that helps

anka-213 added a commit to anka-213/haskell-wordnet that referenced this issue Jan 10, 2022
Importing libraries without cabal files are now depricated
See: commercialhaskell/stack#5210
bens added a commit to bens/hs-web3 that referenced this issue Feb 10, 2022
akru pushed a commit to airalab/hs-web3 that referenced this issue Feb 13, 2022
mpilgrem added a commit to commercialhaskell/hi-file-parser that referenced this issue Aug 11, 2022
cblp added a commit to cblp/haskell-stellar-sdk that referenced this issue Oct 4, 2022
cblp added a commit to cblp/servant-cli that referenced this issue Oct 4, 2022
plredmond added a commit to lsd-ucsc/cbcast-lh that referenced this issue Nov 14, 2022
mengwong added a commit to smucclaw/baby-l4 that referenced this issue Dec 5, 2022
when building natural4 downstream, stack throws this error:

    ┌─[mengwong@rosegold] - [~/src/smucclaw/dsl/lib/haskell/natural4] - [2022-12-05 11:03:34]
    └─[0] <git:(main 1ace7ecc) > stack build
    DEPRECATED: The package at Archive from https://github.com/smucclaw/baby-l4/archive/a6410905279cc7ee4e9d8dc959e3e4a4019633f9.tar.gz does not include a cabal file.
    Instead, it includes an hpack package.yaml file for generating a cabal file.
    This usage is deprecated; please see commercialhaskell/stack#5210.
    Support for this workflow will be removed in the future.

so, putting back the cabal file for now.
namasme added a commit to namasme/aoc-2022 that referenced this issue Dec 11, 2022
…d doing it

* Includes .cabal file per
commercialhaskell/stack#5210
* Updates package.yaml with the new dependencies.
* Updates the stackage resolver in stack.yaml to force a version that is
usable with my setup. Also updates stack.yaml.lock.
* Updates the instructions in setup.hs and stack.yaml with the latest findings.
isomorpheme added a commit to chordify/typelits-witnesses that referenced this issue Dec 14, 2022
isomorpheme added a commit to chordify/typelits-witnesses that referenced this issue Dec 14, 2022
mmhat added a commit to mmhat/typed-process that referenced this issue Feb 26, 2023
mmhat added a commit to mmhat/typed-process that referenced this issue Feb 26, 2023
o1lo01ol1o added a commit to BeFunctional/cql that referenced this issue Apr 14, 2023
zepalmer pushed a commit to zepalmer/intensional-functions-lib that referenced this issue May 4, 2023
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

9 participants