Repository navigation
Conversation
|
I find it difficult to understand why we would ever need a "hidden" stanza. Everything that a stanza can accomplish is easier accomplished by just doing the thing your hidden stanza intended to trigger directly. It seems like this is just an LLM artifact that should be easily simplified away. |
|
Summarising the feedback from the dev meeting 11-11-2026: The PR looks unlikely to be able to be broken into smaller meaningful chunks. The focus should instead be on making sure all the LLMisms are cut and we have a solid feature, however big it needs to be. The direction with an opam stanza is a red herring and should be cut, the composable opam rules backing them are the important parts. Promotion registration should be handled from the rules rather than the engine trying to guess it. There ideally should be no engine changes overall. |
|
I wouldn't say that we are looking to minimize changes to the engine, but we only want to add what we need and articulate why we need it. The changes to the engine in this PR are mostly not particularly well motivated. As far as I can tell, all the fundamental levers in the engine are already in place, so we just need to use them correctly. Maybe the only thing that is missing is being able to work with empty and anonymous contexts directly, but I don't really see a clean API in this PR that does that. |
|
@rgrinberg What is an empty or anonymous context? (And how does it relate?) |
|
It is anonymous because its name does not really matter. It is not available for the user to refer to. It is empty because there are no copying rules in it by default. |
|
Is this assuming that package builds occur in separate contexts? Because that's not what is happening here although I had tried this design in the past. All the package builds occur in the same single context as if they were in a monorepo. The only difference being that Source_tree.t can be backed by arbitrary build rules, in this case something copying and/or patching from _fetch. |
|
No, improved the API could help existing code. It does not require anything from this PR. I haven't yet looked at the source tree changes here. |
Record the duplicate install-cookie entries produced when an install action copies a file also declared by its `.install` manifest. Cover the bin section and confirm a dependent package can still read the installed file; installation behavior is unchanged. Found when working on #16995
d80639a to
abe4616
Compare
|
I've pushed the result of the last two week sprint. I managed to cut out a lot of useless changes, but there is still a lot of curft to be removed. I've updated the PR description with some technical overview of the changes too. On my machine null builds without dune pkg are around 1.5s, with dune pkg 5.3s. PLAN.md contains insights on the remaining tasks that need to be done and information about some design decisions that have been made. Eventually this will morph into a design document, but for now is an agent coordination board. |
500f14b to
1ba40f0
Compare
With a relocatable compiler, launchers such as ocaml and ocamlmklib need the runtime installed next to them. A rule running one depends only on the tool, so a sandboxed rule cannot find the runtime. Signed-off-by: Ali Caglayan <[email protected]>
…llation A context with a locked compiler provides a dependency on the lock directory's (ocaml ..) package and its closure. Rules that run a compiler tool add it, and so does a user action whose program is installed by one of those packages, so a sandboxed rule finds the whole installation, the runtime of a relocatable compiler's launchers for instance. Signed-off-by: Ali Caglayan <[email protected]>
Signed-off-by: Ali Caglayan <[email protected]>
A package's (dir ..) must name a directory inside the project that declares the package. Signed-off-by: Ali Caglayan <[email protected]>
deps-bin-pform.t's "A name installed by two workspace packages" covers the same setup and also checks the PATH route. Signed-off-by: Ali Caglayan <[email protected]>
b601a4b to
e4f04b9
Compare
Signed-off-by: Ali Caglayan <[email protected]>
e4f04b9 to
211643f
Compare
| ; promotion : bool | ||
| (** Whether the diffs this action runs may register promotions: its | ||
| diff actions and the sandbox's corrections. When [false] a | ||
| mismatch still fails. *) |
There was a problem hiding this comment.
This field should not be needed. When setting up the rules, we should modify the actions so that they produce the promotions. This might involve removing a certain flag that allows actions to produce corrections. It might also involve creating a new action like diff that doesn't create promotions on failure. But it should not be done at this layer.
| Expands [targets] with the set of files discovered in directory targets. *) | ||
| val move_targets_to_build_dir | ||
| : t | ||
| -> promotion:bool |
There was a problem hiding this comment.
Same as the other comment. We should setup the rules in such a way so that the engine doesn't look for promotions in the first place
Here is the second public sprint of "flattening dune".
Description
Load dune projects from locked packages directly (#9983) and allow locked packages to depend on workspace packages (#8652).
Technical Overview
(Disclaimer: This is my rough intention with these changes, it might not be faithfully reflected in the changes yet)
All (non-empty) locked packages have their sources "mounted" directly in
_build/default/.pkg. Then a heuristic, based ondune-projectand it's(package)stanzas, is used to classify a given package as "native" or "opaque".Native packages are dune projects, and the sources
_build/default/.pkg/fooare directly fetched/prepared and loaded as usual dune projects are, acting like a monorepo build. As a result they inherit all the useful compositionality that dune projects already had, except for a few differences. Aliases don't enter mounts, cram tests are not loaded, formatting is not checked etc.Opaque packages fallback to the translated build recipe found in the lock directory entry, and are built using the old package rules. They produce a
_build/default/.pkg/bar/_installdirectory target with the install layout. They partake in the composition of binaries, libraries and packages, whilst trying to be as lazy as possible. Allowing for a seamless integration in the workspace.Many rules needed to be adapted to accept a more general notion of Source_tree that allows for build-backed paths. Much of dune lang had to be adpated to be agnostic to source or build paths.
Mounted packages are not allowed to register promotions of any kind.
TODO: lots of little details that need expansion
Remaining design
This is enough for dune to be able to be built with dune pkg, with a few tweaks in the workspace and dependency packages.
There is still some LLMisms and cruft that needs to cut from the PR.