You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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.
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.The text was updated successfully, but these errors were encountered: