-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
understanding and completing conf-llvm
#9853
Comments
I personally wasn't aware of the purpose of the |
The idea behind the The logic behindThe logic of the Basically, this is an attempt to overcome opam limitations that doesn't allow us to pass configuration parameters to the configuration script. |
@gasche Given @ivg's feedback what do you think should be done now ?
Regarding this I'm getting less and less convinced that opam packages should try to propagate configuration information among them. I think that opam The latter seem to be more inline with what @ygrek suggests in this #3093 (comment) where Basically the |
Wasn't they named Anyway, the problem is that "just check for external" is not enough, as for us it is more like a search problem. There can be multiple installations of llvm in a system, and when a user orders OPAM to install My personal view is that OPAM's interaction with the system is broken or even doesn't exist. Given that OPAM is a source based package manager, like emerge or pip, we definitely need some mechanisms that will allow us to convey system specific configuration data to the build system. So far the only mechanism that we have is the conf packages, and I don't see why I can't use them for that. |
Why not.
I fail to see why you can't do this in the package themselves.
I certainly did think at a certain point that this was As far as your packages are concerned they should be able to install in a context that is not necessarily managed by |
Sure, there are several reasons. First, we can have several packages that depends on one system package, that why we factor the configuration computation from them to the conf package. This is a minor issue actually, as of course we are not required to follow software engineering practices in package specifications, but still. Second, we may depend on different versions of a system package, e.g., Finally, a pure technical problem, in the build and configuration scripts we can only query flags that are defined in other packages, not in the package itself. And since we would like that our opam file is as declarative as possible we would like to have
instead of just
That's actually is the problem as BAP is designed to be easily installable with a common package manager. We follow the regular |
We are planning to remove the We will also make all |
Maybe but in the long term I doubt this is the right mecanism, something along these lines would be a better fit. |
Oh definitely, here we are on the same page. I mostly see the Unless it is possible to implement them as a plugin, so that this behavior can be back ported to opam.1 and opam.2. |
@dbuenzli, since you're here. I see the following solution to the #10164 problem and to the conf-llvm problem in general. We shouldn't use OPAM version to version conf-packages, and should follow the debian style versioning, e.g., instead of having What do you think of this? |
@ivg This has partly very good consequences, and partly not so much.
|
I believe that OPAM supports disjunctions in package formulas, so we could do |
OPAM supports disjunctions, but they doesn't work with the depext plugin, e.g., if you will say
Not sure whether it is confusing... but this is the reality. LLVM changes its interface every release, so every time we need to update our bindings. The releases end up into distributions with a serious delay. There are still distributions that have only 3.4. So BAP indeed may use three specific versions of LLVM no one is better than another.
That's what I'm talking, we should separate the concept of a version of a configuration script and a version of a system package. OPAM shouldn't track system packages versions, they should be opaque to OPAM and be just a part of the name. In our case, there shouldn't be any |
Exactly how would you propose to write a package that works with any version of LLVM from 3.4 to 4.0? Basic IR construction hasn't changed in all this time. |
I'm not sure whether you're asking me, and if yes, then I'm not getting the question. I'm not proposing to write a package that works with any version of LLVM. Concerning the IR, BAP, in particular, doesn't use this part of LLVM, we are depending on MC library, that defines machine code generation and disassembly. They do change a lot between versions. |
This issue is stale because it has been open 90 days with no activity. Remove the stale label, or comment, or this will be closed in 15 days. |
As part of looking at #9810 with @thierry-martinez I realized that some packages that depend on LLVM are using their own depexts instead of using
conf-*
packages as advised by #5791. The llvm-configuration-related packages seem to have a fair bit of history (cc @whitequark, @jpdeplaix and @ivg), so I'm creating this issue to explain what I currently understand, propose a plan forward and ask questions.Current state
If I understand correctly, there are two sort of
conf-llvm
packages:conf-llvm
has one version per LLVM version; it currently supports 3.4 and 3.8 only.conf-bap-llvm
has a single version which, when installed, dynamically selects between 3.4 and 3.8 depending on what is available.conf-llvm
andconf-bap-llvm
create aconf-llvm.config
file whose values become opam variables, so after depending on any of themconf-llvm:version
gives the currently available LLVM version, andconf-llvm:config
gives the name of the relevantllvm-config
executable.Among OCaml packages that use LLVM, there are three categories:
conf-*
packages. As far as I can tell, this is only thebap-llvm
package (and thus thebap
ecosystem). I don't understand if onlyconf-bap-llvm
is used today andconf-llvm
is legacy (that is my guess), or if both have their uses. (@ivg?)clangml
,llvm
(llvmgraph
just depends onllvm
), andhardcaml-llvmsim
ollvm
andollvm-tapir
.Going forward
I would like to have one
conf-llvm
and oneconf-clang
package per LLVM and clang M.N version, for packages to be able to say "we depend on an external install of LLVM.3.9" for example.I don't understand if packages like
conf-bap-llvm
that support several different llvm versions are actually necessary (and it feels a bit weird to me to have aconf-*
package whose meaning is determined by OCaml packages that depend on it, rather than by independently-meaningful checks of the environment). Can the currentconf-bap-llvm
always be replaced by("conf-llvm-3.4" | "conf-llvm-3.8")
in dependencies?Of course I would like to consolidate the depext-using package to rely on
conf-llvm
instead, and review the depext in theconf-*
packages to support as many different systems as possible.The text was updated successfully, but these errors were encountered: