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

Write specification for text spec input files #79

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jaimergp
Copy link
Contributor

@jaimergp jaimergp commented Jun 3, 2024

Standardizing our simplest input file. Should not be too controversial :P

📝👓 Markdown preview

@jezdez
Copy link
Member

jezdez commented Jun 4, 2024

That's a nice surprise!

Copy link

@marcoesters marcoesters left a comment

Choose a reason for hiding this comment

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

That was very informative, but I cannot speak to the accuracy of the CEP. Just minor suggestions on the language.

cep-??.md Outdated Show resolved Hide resolved
cep-??.md Outdated Show resolved Hide resolved
Copy link
Contributor

@baszalmstra baszalmstra left a comment

Choose a reason for hiding this comment

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

Thank you for this!

cep-??.md Outdated

If the line `@EXPLICIT` is found, the file is considered explicit. The word `@EXPLICIT` can contain whitespace before and after, but it's not recommended.

In explicit files, each package requirement line MUST specify a single, direct URL (as in RFC 3986) to a conda artifact. File paths are also supported, but they SHOULD be preferrably expressed as `file://` URLs. Relative paths are allowed, and will be processed as relative to the working directory, not the input file parent directory. Each URL can be immediately followed by an anchor tag (`#<hash>`) that encodes the expected MD5 checksum of the downloaded artifact. More specifically, whitespace-stripped lines SHOULD be parsable by this regex:
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if this is used in the wild but can it also be followed by a sha256 hash? E.g. sha256:hash

Copy link
Contributor Author

@jaimergp jaimergp Jul 18, 2024

Choose a reason for hiding this comment

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

We would need to check if that doesn't break conda's regex. It seems to be limited to 32 hex (lowercase!) characters, so it should be ok as long as we have a different-length string.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That said, I'm inclined to cover that in separate CEP because it's not really an existing format? Is there an implementation out there that understands sha256's?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, yes, I see it here: https://github.com/mamba-org/rattler/blob/31e16aa77f7d315de4ffe078b18a95a0e077ad6f/crates/rattler_conda_types/src/explicit_environment_spec.rs#L66-L96

conda does not support it so it's not part of the "classic" implementation / aka de facto standard. Would you like to have sha256's added here?

Copy link
Contributor Author

@jaimergp jaimergp Jul 18, 2024

Choose a reason for hiding this comment

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

Ended up adding conda/conda#14048 as a result of this conversation, let's see how it feels. Note it only adds support for the unprefixed sha256.

## Reference

- [Explicit URL regex](https://github.com/conda/conda/blob/841d9d57fd96ad27cda4b7c43549104a96f961ce/conda/misc.py#L50-L54)
- [`explicit()` implementation in `conda`](https://github.com/conda/conda/blob/841d9d57fd96ad27cda4b7c43549104a96f961ce/conda/misc.py#L57-L145)
Copy link
Contributor

Choose a reason for hiding this comment

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

For what it's worth this is the implementation in rattler: https://github.com/mamba-org/rattler/blob/main/crates/rattler_conda_types/src/explicit_environment_spec.rs

Although I don't think it follows the specs from this CEP to the letter.

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.

4 participants