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

dune-pkg: Improve error messages when source archive can't be extracted #11544

Open
gridbugs opened this issue Mar 18, 2025 · 5 comments
Open
Assignees
Labels
good first issue Good for contributing for the first time to the Dune codebase package management

Comments

@gridbugs
Copy link
Collaborator

Desired Behavior

When dune downloads a package source archive but is unable to extract it, the error message should help users solve the problem. One type of problem is if the necessary tool for extracting the archive (tar or unzip) isn't installed. It's also possible that tar can be installed but the decompression tool (often gunzip or bunzip2) is missing. There may be other helpful error messages that a tool would try to print that dune currently doesn't present to users, such as if there is not enough disk space to extract the archive.

Currently, dune will print the following in all cases of failing to extract an archive:

File "dune.lock/tsort.pkg", line 10, characters 7-65:
10 |   (url https://github.com/dmbaturin/ocaml-tsort/archive/2.0.0.zip)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error:
failed to unpack archive downloaded from
https://github.com/dmbaturin/ocaml-tsort/archive/2.0.0.zip
reason:
unable to extract "_build/.temp/dune_d7c5e3_2.0.0.zip/download"

This example error was from attempting to extract a zip archive on a machine which does not have unzip installed. It would be helpful if dune presented that information to the user.

If the required tool is installed but the extraction still failed, it would be helpful if the stderr from the failed attempt to run the tool could be printed.

@gridbugs gridbugs added good first issue Good for contributing for the first time to the Dune codebase package management labels Mar 18, 2025
@create2000
Copy link

Hello @gridbugs . My name is Anthony Onah, an applicant for the Outreachy Internship. Can i have this issue assigned to me? Thanks

@AdmKing
Copy link

AdmKing commented Mar 20, 2025

hello sir. I would like to fix this issue. @gridbugs

@bqcarima
Copy link

bqcarima commented Mar 20, 2025

Hello @gridbugs. My name is Bassey Otudor an Outreachy internship applicant. I would like that you assign this issue to me.

@gridbugs
Copy link
Collaborator Author

Since this is such a popular issue, I'm going to split it into some sub issues so @create2000, @AdmKing and @bqcarima can all contribute here. I'll make some sub issues and let the 3 of you decide which one each will focus on.

@gridbugs
Copy link
Collaborator Author

Ok I've created 3 sub issues. Let me know which of you will be working on which issue and I'll assign you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for contributing for the first time to the Dune codebase package management
Projects
None yet
Development

No branches or pull requests

4 participants