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

Make opam switch export --freeze more permissive #4985

Open
LasseBlaauwbroek opened this issue Jan 6, 2022 · 6 comments
Open

Make opam switch export --freeze more permissive #4985

LasseBlaauwbroek opened this issue Jan 6, 2022 · 6 comments

Comments

@LasseBlaauwbroek
Copy link
Contributor

When I run opam switch export --freeze while having a package pinned to the local filesystem, I get this error:

[ERROR] my-package is path pinned, it can't be exported with --freeze.

I get that this is not possible, but the fact that this prevents the entire export is unfortunate. I would much prefer that Opam just skips the freeze operation of this particular package. Or otherwise, maybe there can be a --permissive option.

@dra27
Copy link
Member

dra27 commented Jan 7, 2022

xref #4897

@hannesm
Copy link
Member

hannesm commented Jan 7, 2022

FWIW, it would be great to not modify the semantics of freeze -- which is crucial for reproducible builds. If the feature request is "to not freeze some random packages", adding a "--ignore-local-pins" may be appropriate.

@dra27
Copy link
Member

dra27 commented Jan 7, 2022

Yes, the change here would be to add an additional option to control this, not alter --freeze itself (even under CLI versioning, etc.)

@LasseBlaauwbroek
Copy link
Contributor Author

@hannesm My purpose is actually also reproducible builds. However, I should note that the current semantics of freeze already has reproducibility errors (even if it does not output an error). The reason is that it often resolves a CVS pin to the local filesystem, which is also far from ideal from a reproducibility standpoint (it is still better than a filesystem pin, because the CVS hash is included).

At the end of the day, there is probably nothing that can be done about this, but it may be useful to output a warning whenever the export contains links to the local filesystem.

In the same way, maybe it would be interesting to just allow source-links to raw filesystem locations (of course with warnings all over the place)

@hannesm
Copy link
Member

hannesm commented Jan 7, 2022

@LasseBlaauwbroek Thanks for your comment. I guess we're mostly on the same page here:

  • vcs pin to the local filesystem are just used, instead: should be detected and handled
  • path pins to the local filesystem leads to fail behaviour, instead they should be handled

Now, the disagreement seems to be in the "handle":

  • warn on these local pins (your favourite)
  • fail on these local pins (my favourite)

And indeed, the question is about the default semantics -- as @dra27 suggested there should be a new command-line parameter to change the "handle" above - warn or fail.

NB: of course this still can lead to something not reproducible, since we rely on URLs (and thus DNS) which in certain network setups (e.g. your private company network) may result in different accessible repositories and repositories. But I don't think it is worth to deal with that.

@LasseBlaauwbroek
Copy link
Contributor Author

LasseBlaauwbroek commented Jan 7, 2022

I agree with your analysis. My personal reasoning is that I prefer a mostly reproducible build over a not-at-all reproducible build (because opam gave an error). But I can imagine that other situations ask for an error.

So I would propose that we do this:

  1. Change the current semantics to also error out when a local-cvs pin is encountered.
  2. Add an option --warn that deals gracefully with both local-cvs pins and local-filesystem pins
    The question then remains what it means to gracefully handle local-filesystem pins. Is that filesystem URL substituted for the original source? Is that a feasible thing to do?

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

No branches or pull requests

4 participants