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

Deprecation warning for sdist hooks #6180

Closed
bfrk opened this issue Aug 6, 2019 · 2 comments
Closed

Deprecation warning for sdist hooks #6180

bfrk opened this issue Aug 6, 2019 · 2 comments

Comments

@bfrk
Copy link

bfrk commented Aug 6, 2019

Since quite a while we (the Darcs team) are getting deprecation warnings for the sdist hook in our custom Setup.hs:

Deprecated: "SDist hooks violate the invariants of new-sdist. Use 'autogen-modules' and 'build-tool-depends' instead."

The problem is that neither 'autogen-modules' nor 'build-tool-depends' really help fixing the problem. The reason we need the sdist hook is that we want to include in the source tar ball information about the exact version, as reported by Darcs itself. In Darcs this takes the form of a context file generated by Darcs. But to generate that, we need to be in a clone of our repo, we cannot do this inside an unpacked tar ball.

I haven't found a way to make cabal new-sdist generate this information without using the deprecated sdist hook. If there is one, please enlighten me.

@23Skidoo
Copy link
Member

23Skidoo commented Aug 8, 2019

The problem with sdist hooks is that they break an invariant cabal-install relies on: a set of sources with a given checksum will always produce the same tarball. One workaround is to write a small script that will generate a .hs module with the revision info and then call sdist, and then use this script instead of sdist for creating tarballs.

@phadej
Copy link
Collaborator

phadej commented Apr 6, 2020

The solution is to have a script which would prepare the contents, and then call cabal v2-sdist. Hooks are removed and we cannot really support them. We want to get closer to

cabal get package-x.y.z
cd package-x.y.z
cabal v2-sdist
# would produce the same tarball

I also opened #6664 to one way to solve this problem more generally. I think we don't want run Haskell code here.

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

No branches or pull requests

3 participants