-
Notifications
You must be signed in to change notification settings - Fork 23
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
base: main
Are you sure you want to change the base?
Conversation
That's a nice surprise! |
There was a problem hiding this 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.
Co-authored-by: Marco Esters <mesters@anaconda.com>
There was a problem hiding this 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: |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
Standardizing our simplest input file. Should not be too controversial :P
📝👓 Markdown preview