cabal icon indicating copy to clipboard operation
cabal copied to clipboard

No `bootstrap` files in Hackage cabal-install tar ball

Open blackgnezdo opened this issue 4 years ago • 25 comments

Describe the bug

cabal-install-3.4.0.0.tar.gz as distributed on hackage doesn't include bootstrap directory.

These files are very useful when bootstrapping cabal-install without having a previous version handy, e.g. in my OpenBSD port. I was previously using an rc-tagged bundle on github and hoping to change the dependency to Hackage instead.

Expected behavior

Enough files available on Hackage to build all of cabal-install.

System information

  • OpenBSD
  • cabal-3.4.0.0, ghc-8.10.3

blackgnezdo avatar Feb 20 '21 23:02 blackgnezdo

Just to echo here, the bootstrap.py file is not part of the cabal-install-3.4.0.0.tar.gz

chenrui333 avatar Feb 22 '21 00:02 chenrui333

Bumped into this problem too when updating FreeBSD port of cabal-install. Can we get the script back?

arrowd avatar Mar 05 '21 13:03 arrowd

@arrowd looks like bootstrap.sh is gone for good.

See https://github.com/haskell/cabal/issues/6701 and https://github.com/haskell/cabal/pull/6719

ciez avatar Mar 17 '21 16:03 ciez

Probably rewrite README.md, then?

ambs avatar May 05 '21 10:05 ambs

@ambs what's wrong with the readme?

fgaz avatar May 05 '21 10:05 fgaz

README.md refers to the bootstrap.sh file. If it is not shipped, we should not refer to it :)

ambs avatar May 05 '21 13:05 ambs

@ambs could you link to the specific line where we mention bootstrap.sh? I can't find it

fgaz avatar May 05 '21 16:05 fgaz

Probably we are referring to different things but look into https://hackage.haskell.org/package/cabal-install. Line 53.

ambs avatar May 05 '21 16:05 ambs

Indeed we are! The readme is fixed on master. Changing the one on hackage would require a release

fgaz avatar May 05 '21 16:05 fgaz

Yeah, common mortals prefer to use releases. :-) Also, it looks like the version in master suggests a folder named bootstrap (?), which doesn't exist in the released tarball as well. So probably we are really needing a release! Or will the bootstrap folder be only available in the git? Probably clarifying would make sense. I will use the git version, nevertheless. Thanks!

ambs avatar May 05 '21 16:05 ambs

And extra detail, bootstrap-deps.json seems to be missing from the master tree?

ambs avatar May 05 '21 16:05 ambs

What remains to be done to resolve this?

gbaz avatar Jul 10 '21 15:07 gbaz

The bootstrap script should be distributed with Hackage tarball.

arrowd avatar Jul 12 '21 10:07 arrowd

The bootstrap script should be distributed with Hackage tarball.

I can do that for 3.8.1 release. Do you mean the bootstrap/bootstrap.py script? In which of the 4 packages shiould it be included? Would that be enough to close this ticket?

Mikolaj avatar May 27 '22 13:05 Mikolaj

Do you mean the bootstrap/bootstrap.py script?

Yes.

In which of the 4 packages shiould it be included?

The cabal-install one.

arrowd avatar May 27 '22 15:05 arrowd

Thank you.

Uhoh:

~/r/cabal/cabal-install$ cabal check
Warning: The following warnings are likely to affect your build negatively:
Warning: 'extra-source-files: ../bootstrap/bootstrap.py' is a relative path
outside of the source tree. This will not work when generating a tarball with
'sdist'.
Warning: The following errors will cause portability problems on other
environments:
Warning: 'extra-source-files: ../bootstrap/bootstrap.py' is not a good
relative path: "parent directory segment: .."
Warning: Hackage would reject this package.

Cheat via a symbolic link? Move bootstrap/ from top level of the repo into cabal-install/?

Mikolaj avatar May 27 '22 15:05 Mikolaj

And extra detail, bootstrap-deps.json seems to be missing from the master tree?

These files are now named bootstrap/linux-8.10.7.json, etc.

Mikolaj avatar May 28 '22 07:05 Mikolaj

To clarify, the bootstrap/bootstrap.py script is useless without one of the GHC version specific files, such as bootstrap/linux-8.6.5.json. Does it mean we should ship those files as well or is the script alone useful to somebody? If we are to ship those extra files, that would mean some more links. Perhaps the simplicity of keeping everything in the top-level bootstrap directory, which is advertised in the soon-to-be-released version of README, and not linking to it (and updating the links in the repo and in .cabal file) from other directories and packages, is worth preserving?

Would that be acceptable?

Mikolaj avatar May 28 '22 07:05 Mikolaj

That's right, *.json files are also required.

arrowd avatar May 28 '22 08:05 arrowd

FWIW, OpenBSD port packages its own openbsd.json. It's easy enough to regenerate and keep around. Hence from my point of view bootstrap.py is enough. Then again, I switched to grabbing a tagged version straight off github even if this is not exactly a release.

blackgnezdo avatar May 28 '22 20:05 blackgnezdo

FWIW, OpenBSD port packages its own openbsd.json. It's easy enough to regenerate and keep around. Hence from my point of view bootstrap.py is enough. Then again, I switched to grabbing a tagged version straight off github even if this is not exactly a release.

Well, yes. We at FreeBSD patch the existing .json, but it is indeed easier to provide our own, because shipped .json files are usual out of date and lacking behind GHC releases.

arrowd avatar May 29 '22 08:05 arrowd

[Edit: the below is now fixed]: BTW, let me turn your attention to #8166. Something has broken with the creation of bootstrap files (let's hope, something trivial). So we are going to be stuck with the old bootstrap files until this is fixed.

Mikolaj avatar May 30 '22 08:05 Mikolaj

Hi there! In the heat of the battle, this request has been ignored and then re-assigned to the upcoming release 3.12.

Is bundling bootstrap.py inside the Hackage package cabal-install (and symlinking to it from the bootstrap/ directory), but not bundling the .json files, still useful for anybody? IMHO, if your scripts get it from the repo, that may be the safest option. I don't even know if symlinks work on Windows. It would be unfortunate if you updated your scripts to get bootstrap.py from Hackage and then we had to revert the location back to bootstrap/ due to a random fallout.

Mikolaj avatar Feb 22 '24 12:02 Mikolaj

I don't see a reason to prefer Hackage to GitHub for getting these script and JSON files. And the change is prone to all sorts of dangers as Mikolaj points out above.

Also, priority: high is not adequate imo.

ulysses4ever avatar Feb 22 '24 12:02 ulysses4ever

Considering how long this went unpatched I can't justify this being a high priority item. A reason to prefer the official hackage release is just that: it's official. My guessing at the right tag and relying on github to package up the bundle is somewhat less reliable. It's somewhat ironic, that the key GitHub used to sign the latest release is GPG key ID: 4AEE18F83AFDEB23 Expired

blackgnezdo avatar Feb 23 '24 00:02 blackgnezdo