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

source: add --no-checksums & --require-checksums flags #5563

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

rjbou
Copy link
Collaborator

@rjbou rjbou commented May 26, 2023

@rjbou rjbou added the PR: QUEUED Pending pull request, waiting for other work to be merged or closed label May 26, 2023
@rjbou rjbou requested a review from kit-ty-kate August 29, 2023 17:32
@rjbou rjbou added PR: WAITING FOR REVIEW and removed PR: QUEUED Pending pull request, waiting for other work to be merged or closed labels Aug 29, 2023
mk_flag ~cli (cli_from cli2_2) ["require-checksums"]
"Enforce checksum verification befor downloading sources.\
This is equivalent to setting $(b,\\$OPAMREQUIRECHECKSUMS) to \"true\"."
in
Copy link
Member

Choose a reason for hiding this comment

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

might be worth sharing the flags definitions with the ones used in OpamArg.build_options ? (maybe that was too tedious to be worth it, in that case it's alright)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is possible to share it easily with build_options, (cf. d69eb84).
I've tried to move them from build options to global options, but we loose the ability to notify that some new commands now permit and use --*-checksum options (no possibility to describe cli validity fine grained). Cf ef3b1e2

@hannesm
Copy link
Member

hannesm commented Nov 7, 2023

Appreciated, and this looks great to me. As @AltGr mentioned, it may be useful to share some code. Thanks a lot.

@kit-ty-kate kit-ty-kate removed their request for review May 9, 2024 13:24
@rjbou rjbou added this to the 2.3 milestone Jun 27, 2024
@rjbou rjbou marked this pull request as draft July 10, 2024 13:56
@dra27 dra27 modified the milestones: 2.3.0~alpha, 2.4.0~alpha1 Sep 3, 2024
…he counterpart of that is that we loose the fact that the newly effective options (in opam source for ex) are not flaggued as new in cli 2.2
…ption. The counterpart of that is that we loose the fact that the newly effective options (in opam source for ex) are not flaggued as new in cli 2.2"

This reverts commit a2e7b21ccaad48ca11432e9fbd0a7a2c90377aee.
@rjbou rjbou marked this pull request as ready for review November 22, 2024 16:30
Copy link
Member

@kit-ty-kate kit-ty-kate left a comment

Choose a reason for hiding this comment

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

I don't understand this feature request. What does this bring in terms of change for users?

I understand --require-checksums, although i feel like this would have more usability as a global opam option.
But --no-checksums i really don't understand. If the goal is to allow packages without a checksum, then why not simply add a --allow-no-checksums argument instead of ignoring the checksum altogether?

I'm also wondering what how opam source is special compared to the other commands that might fetch packages.

@rjbou
Copy link
Collaborator Author

rjbou commented Nov 26, 2024

As discussed in dev meeting, the idea is to harmonise option for opam source, make --no-checksum and --require-checksum option available.
related #6311 & #6312

Comment on lines +3713 to +3714
let no_checksums = no_checksums cli (cli_from cli2_2) in
let req_checksums = require_checksums cli (cli_from cli2_2) in
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
let no_checksums = no_checksums cli (cli_from cli2_2) in
let req_checksums = require_checksums cli (cli_from cli2_2) in
let no_checksums = no_checksums cli (cli_from cli2_4) in
let req_checksums = require_checksums cli (cli_from cli2_4) in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants