feat: %{pkg:foo:lib} pforms for package install layouts#14200
feat: %{pkg:foo:lib} pforms for package install layouts#14200Alizter wants to merge 2 commits intoocaml:mainfrom
Conversation
d8cffa1 to
917dfbc
Compare
917dfbc to
12bd59e
Compare
These fields can appear in opam files, however we haven't encountered them yet. It might be worth supporting them since we use these install sections in dune anyway. This test simply checks how we are interpreting the fields, I will motivate adding them in a later PR. This is related to #14200.
12bd59e to
3600fb2
Compare
36db8d6 to
0e048e5
Compare
0e048e5 to
3a12c1b
Compare
| Need_full_expander | ||
| (fun t -> | ||
| With | ||
| (let pkg_name = Package.Name.of_string pkg_name_str in |
There was a problem hiding this comment.
What happens when the package name is invalid?
There was a problem hiding this comment.
Oh yes, this is wrong.
There was a problem hiding this comment.
At the moment we do no validation so it should just say it couldn't find the package.
|
Thinking about this again, I think this form should take the actual file that it needs as another argument. Otherwise, we need to build everything in the install directory and that is going to cause incredibly inconvenient cycles for folks. |
|
I think making it be |
|
There are some advantages to both approaches. One advantage of allowing the user to specify a file is that it is actually solving the ticket we've been provided. That is analogous to So in summary, both approaches have their cons. But we should do the direct thing to solve the issue the user is asking for. By the way, I'm not so hot about allowing the _build/install directory to be reachable via relative paths anymore. I think these paths (whether constructed through an anonymous action or not) should only be accessible through environment variables. |
7670a82 to
8528323
Compare
Signed-off-by: Ali Caglayan <alizter@gmail.com>
8528323 to
dda4a63
Compare
Signed-off-by: Ali Caglayan <alizter@gmail.com>
dda4a63 to
b8dc435
Compare
We make the
%{pkg:foo:lib}macros available outside of lock files in dune. This allows users to inspect installed package contents directly. We support all the install sections that we understand in dune.Depending on such a path automatically introduces dependencies on the package.
This works with ocamlfind packages, dune package management and workspace packages.
The goal is to ultimately hide
_build/installas an implementation detail and allow users to properly depend on packages' installed contents without having to inspect them by hand.%{pkg:foo:lib}variables more generally #14193