Skip to content

Migrate to tar-0.6 #1283

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

Merged
merged 1 commit into from
Jan 21, 2024
Merged

Migrate to tar-0.6 #1283

merged 1 commit into from
Jan 21, 2024

Conversation

Bodigrim
Copy link
Contributor

@Bodigrim Bodigrim commented Jan 7, 2024

Closes #1277.

@Bodigrim
Copy link
Contributor Author

Bodigrim commented Jan 7, 2024

Could someone help me out with Nix Flake please? Never used Nix in my life unfortunately.

@peterbecich
Copy link
Member

Fixing it, will append a commit to this PR, sorry for the inconvenience

@peterbecich
Copy link
Member

peterbecich commented Jan 12, 2024

I think it is fixed. Pardon the git rebase. It was fixed by nix flake update and other tweaks to the Flake so nix flake update would succeed: #1285

Your addition to the Flake tar.source = "0.6.0" was correct; however, the Flake was too far behind NixPkgs for this to work, and the other constraints in the Flake may have also caused issues.

This is effectively the same as tar.source = "0.6.0"

hackage-server/flake.nix

Lines 34 to 36 in 6b71d16

# https://community.flake.parts/haskell-flake/dependency#nixpkgs
tar = { super, ... }:
{ custom = _: super.tar_0_6_0_0; };

but it will pull the library from NixPkgs instead of building it from Hackage, if possible.

@Bodigrim
Copy link
Contributor Author

Thanks @peterbecich!

@gbaz @ysangkok @andreasabel this is ready for review.

Copy link
Member

@andreasabel andreasabel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the upgrade!

explainTarError (LongNamesError err) =
"There is an error in the format of entries with long names in the tar file: " ++ show err
++ ". Check that it is a valid tar file (e.g. 'tar -xtf thefile.tar'). "
++ "You may need to re-create the package tarball and try again."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get a test case that triggers this error?

Could be not easy to engineer, but it is good to have evidence for every error that it is possible to trigger.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there tests for pre-existing errors somewhere? I can add a new one there.

This is a rare condition though: one has to have an intent to craft a malicious TAR, you cannot obtain one by mistake.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there tests for pre-existing errors somewhere? I can add a new one there.

Yeah, that is the usual problem: There aren't enough tests to start with, so there isn't a good pretext to add some for new or changed features. One can't require adding a test infrastructure for a maintenance PR like this.

@Bodigrim
Copy link
Contributor Author

@gbaz @ysangkok any more reviews? Or are you happy to merge?

@ysangkok
Copy link
Member

Looks ok to me. Happy to merge.

@ysangkok ysangkok merged commit fe13617 into master Jan 21, 2024
@Bodigrim Bodigrim deleted the tar-0.6 branch January 21, 2024 21:45
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

Successfully merging this pull request may close these issues.

Support tar-0.6
4 participants