-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
opam-query.1.3 - via opam-publish #9019
Conversation
✅ All lint checks passed 977affe
✅ Installability check (6964 → 6965)
|
"cmdliner" | ||
"containers" {>= "1.0" & < "2.0"} | ||
"uri" | ||
"ounit" {test} |
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.
A couple of deps that seem to be missing are ocamlbuild and cppo
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.
Fixed
] | ||
depends: [ | ||
"ocamlfind" {build} | ||
"opam-lib" |
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.
missing constraint:
#=== ERROR while installing opam-query.1.3 ====================================#
# opam-version 1.2.2
# os linux
# command ocaml pkg/build.ml native=true native-dynlink=true
# path /home/travis/.opam/4.05.0+trunk/build/opam-query.1.3
# compiler 4.05.0+trunk
# exit-code 10
# env-file /home/travis/.opam/4.05.0+trunk/build/opam-query.1.3/opam-query-15078-6c00d8.env
# stdout-file /home/travis/.opam/4.05.0+trunk/build/opam-query.1.3/opam-query-15078-6c00d8.out
# stderr-file /home/travis/.opam/4.05.0+trunk/build/opam-query.1.3/opam-query-15078-6c00d8.err
### stdout ###
# ocamlfind ocamlopt -package unix -package ocamlbuild -linkpkg -package cppo_ocamlbuild -package opam-lib myocamlbuild.ml /home/travis/.opam/4.05.0+trunk/lib/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
# + ocamlfind ocamlopt -package unix -package ocamlbuild -linkpkg -package cppo_ocamlbuild -package opam-lib myocamlbuild.ml /home/travis/.opam/4.05.0+trunk/lib/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
# File "_none_", line 1:
# Warning 58: no cmx file was found in path for module Ocamlbuild_cppo, and its interface was not compiled with -opaque
# File "myocamlbuild.ml", line 1:
# Error: No implementations provided for the following modules:
# OpamPackage referenced from myocamlbuild.cmx
# OpamFile referenced from myocamlbuild.cmx
# Command exited with code 2.
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.
Hmm this is very confusing. It works locally. I'm not sure what's happening...
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.
Maybe add a a minimal version constraint?
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's not the issue here. It installs the latest versions of opam-lib and ocamlbuild already. Something's broken on opam-repository CI and I have about zero interest in elucidating what that is.
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.
Hm, actually I've just reproduced that on my own Travis CI, so it's not just an opam-repository issue...
] | ||
depends: [ | ||
"ocamlfind" {build} | ||
"opam-lib" {>= "1.3} |
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.
There is a missing end "
in this line that is causing parsing to fail.
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.
any chance of a fix for this @whitequark ?
done |
Wrong checksum?
|
done |
Sorry :( this is still failing to build. is it a newer version of
|
The failed builds are using |
face it. opam is a disaster. it is a nightmare to use it as a library, and it is an even worse nightmare to try and publish opam packages. |
It is quite difficult to use On the publishing front, things will also get easier as the DataKit CI rolls out of experimental mode and into a more automatic merging mode -- it can (with the new queries available in opam2) use the solver to get an accurate reverse dependency cone, and update constraints accordingly. I do appreciate that you're trying to publish an update in basically the most difficult part of OPAM at the moment... |
@whitequark - your package build system is the problem, I'm afraid. --- a/pkg/build.ml
+++ b/pkg/build.ml
@@ -4,7 +4,7 @@
let builder =
`Other ("ocamlbuild -use-ocamlfind -classic-display " ^
- "-plugin-tags 'package(opam-lib),package(cppo_ocamlbuild)'", "_build")
+ "-plugin-tags 'package(opam-lib.format),package(cppo_ocamlbuild)'", "_build")
let () =
Pkg.describe "opam-query" ~builder [ |
Thanks for the constructive criticism anyway. To shed some light on things, opam was never constructed to be used as a library, and I have spent tremendous energy tidying things up and providing proper code hierarchy and interfaces since I joined the project. It still isn't a priority, though. I'm sorry you have trouble publishing packages, but face it, if getting the right dependencies is a nightmare, before opam times it was hell. Did you pin the package locally to test your Two side-notes on
|
I've fixed that in whitequark/opam-query@3cc6408... no idea why opam-publish did not pick it up. |
@AltGr Yes, I did everything you said, and I've read the documentation of opam-publish before using it, too. (Although I did not know about the GitHub support, thanks for telling.) The root cause here was opam-publish. I had a pinned and uninstalled opam-query package locally, with outdated metadata. The opam file in the directory where I ran opam-publish was fine, the opam file in the archive built by GitHub for the tag was file, nevertheless, opam-publish confused itself into picking the outdated opam file from the switch metadata (and presumably the url file as well). Go figure. |
Oh and while we're at it. The only reason opam-query exists is because of deficiencies in opam-publish. It wasn't (and as far as I can tell, isn't) possible to release packages using opam-publish without doing pointless busywork such as telling |
@AltGr TBH I always found @whitequark You should have a look at |
@dbuenzli Thanks, I should really migrate all my packages to new topkg workflow. |
Maybe the mistake I did at the beginning is that The context has evolved, and now the tool is blamed for not being exactly what people think it is or should be. Constructive criticisms, and suggestions, are always welcome (as are contributions!) -- but there is no need to shout. With the Github support, you shouldn't need to specify any extra arguments to the |
I read this very differently, I think the tool is blamed for being obscure in the way it operates. Reality is that it's difficult to understand where the Regarding In any case I think you should concentrate on the |
opam will offer to copy back your opam file to the original source directory, but I get your concern, and having the opam file in the source is certainly the easiest to figure out for users. Now that most are moving to
|
I'm going to argue that this is just papering over complete lack of opam support for any sort of principled version management. For example I follow a strict subset of Semantic Versioning (version And having to carefully state these bounds manually is offputting enough that very few opam users bother to. I certainly don't do it for everything as I should although I try to, when possible. In my opinion having completely unconstrained dependencies should be linted against (eventually as an error) because it is guaranteed that the package will break eventually, and relying on limited resources of opam admin staff is wasteful. |
And in case the answer is "patches welcome": sure, that is a reasonable answer for a request like cross-compilation support or something complex and niche like that. But "support for extremely widely used versioning practices", just like "support for hash functions that aren't so broken that people are generating increasingly contrived collisions as a form of recreation", shouldn't be something that external contributors provide after protracted arguments, it should come up after a cursory look at what other package managers do. |
opam 2.0.0 has supported sha256 and sha512 for a while now... and it wasn't so trivial without bringing in new unwanted dependencies, see ocp-sha. And this can't be compared: we do support semantic versionning, we just don't enforce it. This is not saying we could not add sugar to make the lives of users easier when they do use it. While |
The entire point is opam should lead the way here... But sure: ocaml/opam#2976. |
@AltGr Actually, you are wrong that there is no such existing feature request on the tracker. You filed one yourself! |
Ah, indeed, my bad! Nobody showed much interest at the time though :) |
Yay, all green now! Thanks for your patience... |
I'm not convinced. I still think it's better to keep upper bounds open ended. Even major versions may not break everything out there. Note that as far as OCaml goes almost every release is a breaking one: even adding new functions to a module is a potentially breaking change (because of the So at that point semver OCaml is simply breaking on almost each release and you are back to the point where you need high-level tooling to have finer control over the packages which actually do break and those that do not. So really I'd prefer better high-level tooling to bulk control package versions than add more syntax to the opam files. |
I'm not arguing in favor of following semver in the strictest sense (which, in spite of what semver advocates say, is essentially impossible anyway without some sort of formal methods). What I'd like to see is a bound that works 95% of the time. In the (in my experience, rare) case where a breaking change occurs because of the local open (or the like), you can tighten it, and in the (in my experience, rare) case where a new major version is compatible with a downstream package you can relax it. But you need not do anything in the common case.
Why not both?
This is fine as a personal preference, sure. |
Why not but opam development being bounded by available ressource, I'm just advocating for what I think will be the more useful in my day to day practice. However once a tool can perform the tedious bounds manipulations for me using high-level operations I don't see a clear advantage to add new syntax that has to be learned and understood. |
A tool to query opam files from shell scripts
opam-query is a tool that allows querying the OPAM package
description files from shell scripts, similar to
oasis query
.Pull-request generated by opam-publish v0.3.4