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

cph create is broken when --out-fn includes any sort of path #251

Closed
2 tasks done
FaustinCarter opened this issue Jun 13, 2024 · 1 comment · Fixed by #257
Closed
2 tasks done

cph create is broken when --out-fn includes any sort of path #251

FaustinCarter opened this issue Jun 13, 2024 · 1 comment · Fixed by #257
Assignees
Labels
type::bug describes erroneous operation, use severity::* to classify the type

Comments

@FaustinCarter
Copy link

Checklist

  • I added a descriptive title
  • I searched open reports and couldn't find a duplicate

What happened?

Attempting to round-trip a .conda package using the cph CLI resulted in a .conda package that was unextractable.

Example (using noarch/uncertainties-3.2.0-pyhd8ed1ab_0.conda):

cph extract uncertainties-3.2.0-pyhd8ed1ab_0.conda
rm uncertainties-3.2.0-pyhd8ed1ab_0.conda
cph create uncertainties-3.2.0-pyhd8ed1ab_0 ./uncertainties-3.2.0-pyhd8ed1ab_0.conda # note the relative path here
rm -rf uncertainties-3.2.0-pyhd8ed1ab_0
cph extract uncertainties-3.2.0-pyhd8ed1ab_0.conda # Crashes here

The fundamental issue appears to be that an additional pair of folders got created in the .conda archive called "info-." and "pkg-." and the info and pkg tar.zst files are inside those two additional folders.

In other words, the original .conda package, prior to extraction, contains the following two paths:

  • uncertainties-3.2.0-pyhd8ed1ab_0.conda/info-uncertainties-3.2.0-pyhd8ed1ab_0.tar.zst
  • uncertainties-3.2.0-pyhd8ed1ab_0.conda/pkg-uncertainties-3.2.0-pyhd8ed1ab_0.tar.zst

The ruined .conda package after round-trip contains the following two paths:

  • uncertainties-3.2.0-pyhd8ed1ab_0.conda/info-./uncertainties-3.2.0-pyhd8ed1ab_0.tar.zst
  • uncertainties-3.2.0-pyhd8ed1ab_0.conda/pkg-./uncertainties-3.2.0-pyhd8ed1ab_0.tar.zst

After some more testing, it appears that the culprit is

file_id = out_fn.replace(".conda", "")
. This line naively includes the entire file path as part of the internal info/pkg archive names.

Suggested fix:

- file_id = out_fn.replace(".conda", "")
+ file_id = os.path.basename(out_fn).replace(".conda", "")

Conda Info

No response

Conda Config

No response

Conda list

No response

Additional Context

No response

@FaustinCarter FaustinCarter added the type::bug describes erroneous operation, use severity::* to classify the type label Jun 13, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in 🧭 Planning Jun 13, 2024
@dholth
Copy link
Contributor

dholth commented Aug 14, 2024

Thanks

@dholth dholth self-assigned this Aug 14, 2024
@dholth dholth moved this from 🆕 New to 🏗️ In Progress in 🧭 Planning Aug 14, 2024
@github-project-automation github-project-automation bot moved this from 🏗️ In Progress to 🏁 Done in 🧭 Planning Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::bug describes erroneous operation, use severity::* to classify the type
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants