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

A clean cabal install fails with "tar checksum error" #89

Closed
TerrorJack opened this issue Mar 5, 2024 · 19 comments
Closed

A clean cabal install fails with "tar checksum error" #89

TerrorJack opened this issue Mar 5, 2024 · 19 comments

Comments

@TerrorJack
Copy link

Describe the bug
A clean cabal install fails with "tar checksum error".

To Reproduce
In a clean debian:12 container:

apt update
apt install -y build-essential curl git libffi-dev libncurses-dev libgmp-dev zlib1g-dev

export PATH=~/.local/bin:~/.ghcup/bin:$PATH

curl -f -L --retry 5 https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_MINIMAL=1 sh
ghcup install cabal 3.11.0.0 -u 'https://github.com/haskell/cabal/releases/download/cabal-head/cabal-head-Linux-x86_64.tar.gz' --set
ghcup install ghc 9.8.2 --set

pushd "$(mktemp -d)"
curl -L https://github.com/haskell/haskell-language-server/releases/download/2.7.0.0/haskell-language-server-2.7.0.0-src.tar.gz | tar xz --strip-components=1
cabal update
cabal install exe:haskell-language-server

Expected behavior
It should build and install haskell-language-server. Instead I get:

Error: [Cabal-7125]
Failed to unpack lib:hls-alternate-number-format-plugin from haskell-language-server-2.7.0.0 (which is required by exe:haskell-language-server-wrapper from haskell-language-server-2.7.0.0 and exe:haskell-language-server from haskell-language-server-2.7.0.0). The exception was:
  tar checksum error
Failed to unpack lib:hls-cabal-fmt-plugin from haskell-language-server-2.7.0.0 (which is required by exe:haskell-language-server-wrapper from haskell-language-server-2.7.0.0 and exe:haskell-language-server from haskell-language-server-2.7.0.0). The exception was:
  tar checksum error
Failed to unpack lib:hls-cabal-plugin from haskell-language-server-2.7.0.0 (which is required by exe:haskell-language-server-wrapper from haskell-language-server-2.7.0.0 and exe:haskell-language-server from haskell-language-server-2.7.0.0). The exception was:
  tar checksum error
Failed to unpack lib:hls-call-hierarchy-plugin from haskell-language-server-2.7.0.0 (which is required by exe:haskell-language-server-wrapper from haskell-language-server-2.7.0.0 and exe:haskell-language-server from haskell-language-server-2.7.0.0). The exception was:
  tar checksum error
Failed to unpack lib:hls-change-type-signature-plugin from haskell-language-server-2.7.0.0 (which is required by exe:haskell-language-server-wrapper from haskell-language-server-2.7.0.0 and exe:haskell-language-server from haskell-language-server-2.7.0.0). The exception was:
  tar checksum error
Failed to unpack lib:hls-class-plugin from haskell-language-server-2.7.0.0 (which is required by exe:haskell-language-server-wrapper from haskell-language-server-2.7.0.0 and exe:haskell-language-server from haskell-language-server-2.7.0.0). The exception was:
  tar checksum error
Failed to unpack lib:hls-code-range-plugin from haskell-language-server-2.7.0.0 (which is required by exe:haskell-language-server-wrapper from haskell-language-server-2.7.0.0 and exe:haskell-language-server from haskell-language-server-2.7.0.0). The exception was:
  tar checksum error
Failed to unpack lib:hls-eval-plugin from haskell-language-server-2.7.0.0 (which is required by exe:haskell-language-server-wrapper from haskell-language-server-2.7.0.0 and exe:haskell-language-server from haskell-language-server-2.7.0.0). The exception was:
  tar checksum error
Failed to unpack lib:hls-explicit-fixity-plugin from haskell-language-server-2.7.0.0 (which is required by exe:haskell-language-server-wrapper from haskell-language-server-2.7.0.0 and exe:haskell-language-server from haskell-language-server-2.7.0.0). The exception was:
  tar checksum error
Failed to unpack lib:hls-explicit-imports-plugin from haskell-language-server-2.7.0.0 (which is required by exe:haskell-language-server-wrapper from haskell-language-server-2.7.0.0 and exe:haskell-language-server from haskell-language-server-2.7.0.0). The exception was:
  tar checksum error
Failed to unpack lib:hls-explicit-record-fields-plugin from haskell-language-server-2.7.0.0 (which is required by exe:haskell-language-server-wrapper from haskell-language-server-2.7.0.0 and exe:haskell-language-server from haskell-language-server-2.7.0.0). The exception was:
  tar checksum error
Failed to unpack lib:hls-module-name-plugin from haskell-language-server-2.7.0.0 (which is required by exe:haskell-language-server-wrapper from haskell-language-server-2.7.0.0 and exe:haskell-language-server from haskell-language-server-2.7.0.0). The exception was:
  tar checksum error
Failed to unpack lib:hls-overloaded-record-dot-plugin from haskell-language-server-2.7.0.0 (which is required by exe:haskell-language-server-wrapper from haskell-language-server-2.7.0.0 and exe:haskell-language-server from haskell-language-server-2.7.0.0). The exception was:
  tar checksum error
Failed to unpack lib:hls-pragmas-plugin from haskell-language-server-2.7.0.0 (which is required by exe:haskell-language-server-wrapper from haskell-language-server-2.7.0.0 and exe:haskell-language-server from haskell-language-server-2.7.0.0). The exception was:
  tar checksum error
Failed to unpack lib:hls-qualify-imported-names-plugin from haskell-language-server-2.7.0.0 (which is required by exe:haskell-language-server-wrapper from haskell-language-server-2.7.0.0 and exe:haskell-language-server from haskell-language-server-2.7.0.0). The exception was:
  tar checksum error
Failed to unpack lib:hls-refactor-plugin from haskell-language-server-2.7.0.0 (which is required by exe:haskell-language-server-wrapper from haskell-language-server-2.7.0.0 and exe:haskell-language-server from haskell-language-server-2.7.0.0). The exception was:
  tar checksum error
Failed to unpack lib:hls-semantic-tokens-plugin from haskell-language-server-2.7.0.0 (which is required by exe:haskell-language-server-wrapper from haskell-language-server-2.7.0.0 and exe:haskell-language-server from haskell-language-server-2.7.0.0). The exception was:
  tar checksum error
Failed to unpack lib:hls-stan-plugin from haskell-language-server-2.7.0.0 (which is required by exe:haskell-language-server-wrapper from haskell-language-server-2.7.0.0 and exe:haskell-language-server from haskell-language-server-2.7.0.0). The exception was:
  tar checksum error

System information

  • debian:12
  • Linux build01 6.7.4 haskell/cabal#1-NixOS SMP PREEMPT_DYNAMIC Mon Feb 5 20:17:12 UTC 2024 x86_64 GNU/Linux
  • cabal-head as of 833a17deb0a5c5f99849a5b6bf06b5346105b918
  • ghc-9.8.2
@Bodigrim
Copy link
Contributor

Bodigrim commented Mar 5, 2024

Surprisingly, for some reason I cannot reproduce it with Cabal built locally from the repo. (I'm on M2, so no prebuilt assets available for my platform)

@gbaz
Copy link

gbaz commented Mar 6, 2024

I'm guessing this is because the two versions of cabal are built against different versions of tar, which had a major release with a number of changes recently?

@geekosaur
Copy link

If that leads to a checksum error then one of the versions is highly buggy.

@Bodigrim
Copy link
Contributor

Bodigrim commented Mar 6, 2024

I managed to reproduce. Transferring to tar issue tracker, this has nothing to do with Cabal itself. It is a consequence of haskell/haskell-language-server#4102, but tar-0.6.1.0 should be able to handle Unicode filenames.

A standalone reproducer is:

$ touch TModula𐐀bA.hs && echo "foo" > TModula𐐀bA.hs && cabal run htar -- -c -f unicode.tar TModula𐐀bA.hs && cabal run htar -- -t -f unicode.tar
htar: NotTarFormat

@Bodigrim Bodigrim transferred this issue from haskell/cabal Mar 6, 2024
@Bodigrim
Copy link
Contributor

Bodigrim commented Mar 7, 2024

Fixed in bed491b.

@Bodigrim Bodigrim closed this as completed Mar 7, 2024
@Mikolaj
Copy link
Member

Mikolaj commented Mar 7, 2024

Does cabal need to do anything (e.g., exclude a version of tar in its deps)?

@hasufell
Copy link
Member

hasufell commented Mar 7, 2024

Does cabal need to do anything (e.g., exclude a version of tar in its deps)?

I guess the same thing every software project does when a dependency fixes a bug.

@Mikolaj
Copy link
Member

Mikolaj commented Mar 7, 2024

Does cabal need to do anything (e.g., exclude a version of tar in its deps)?

I guess the same thing every software project does when a dependency fixes a bug.

Oh, that's helpful, thank you. So we'll ignore it.

@Kleidukos
Copy link
Member

@Mikolaj you meant to say that we'll exclude the affected version from our build plans, right?

@Mikolaj
Copy link
Member

Mikolaj commented Mar 7, 2024

@Mikolaj you meant to say that we'll exclude the affected version from our build plans, right?

I'd rather lean towards the inertia, inaction and passive reactivity typical to software projects. I think cabal is properly setup for such a lazy approach, because our bounds are not too specific, so any new minor version should be accepted and build plans usually default to the newest minor versions. If that's proven insufficient by user reports, we'd panic. Sounds good?

@Kleidukos
Copy link
Member

Hmm I am not sure I agree with this course of action.
I'd rather we preventively forbid the buggy version and sleep in peace.

@Bodigrim
Copy link
Contributor

Bodigrim commented Mar 7, 2024

I'd rather we preventively forbid the buggy version and sleep in peace.

Unicode was not properly supported in tar before, and it seems that no one cared about it. The older versions were silently doing a wrong thing, while tar-0.6.1.0 crashes with thunder, which IMHO is much better.

@gbaz
Copy link

gbaz commented Mar 7, 2024

preventative forbidding versions with bugs of upstream deps is a bad road to go down except in exceptional circumstances. deps are constantly fixing bugs, etc. one whole point of the pvp and minor versions etc is so we can set up ranges to take advantage of this automatically. Going out of our way on this or that thing will lead to very convoluted release files, and a counsel of perfection we can never hold-to.

@hasufell
Copy link
Member

hasufell commented Mar 8, 2024

Don't worry, GHCup will clean up after cabal devs anyway.

@hasufell
Copy link
Member

It appears cabal-install-3.10.3.0 binaries are linked against 0.5.1.1 still:

So it appears the assumption of @Mikolaj that their CI does automatically do the right thing is false. Nothing gets updated, everything is pinned.

@Kleidukos
Copy link
Member

@gbaz does this qualify as exceptional circumstances?

@Mikolaj
Copy link
Member

Mikolaj commented Mar 19, 2024

Indeed, I was wrong, I learned about the pinned index state only a few days ago, we discussed it on the cabal devs meeting, but we failed to connect it with the issue of last minute urgent upstream fixes like this one. So we need at least to revisit our policy of updating index state after the release: haskell/cabal#9610 (comment)

I've opened a separate issue for that discussion: haskell/cabal#9819

@Kleidukos: apologies, you were right all along. Did you know about the fixed index state?

@Kleidukos
Copy link
Member

@Mikolaj no I did not know, I just wanted not to have to take action later on.

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

7 participants