Skip to content

Delay the creation of the context used when a package failed to build up until the package failed - #6278

Draft
kit-ty-kate wants to merge 2 commits into
ocaml:masterfrom
kit-ty-kate:delay-context-creation
Draft

Delay the creation of the context used when a package failed to build up until the package failed#6278
kit-ty-kate wants to merge 2 commits into
ocaml:masterfrom
kit-ty-kate:delay-context-creation

Conversation

@kit-ty-kate

Copy link
Copy Markdown
Member

Noticed while reviewing #6274.
It turns out that we try to fetch the revision of each packages being built even before executing the command, but that information is only used in rare cases so if many git packages are used this can cause some wasted time (not too much, up to a couple seconds on slow hardware with large installs, but not nothing)

@rjbou rjbou left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR contains 2 things: the delay of context creation for package build, and the delay of metadata processes as the sumary is not always printed. PR title is good, but main comment and master changes should contains both. Ideally, 2 commits if it can be easily split.
Otherwise, lgtm!

Comment thread src/core/opamProcess.ml Outdated
@kit-ty-kate
kit-ty-kate force-pushed the delay-context-creation branch from c0bcb68 to c73333f Compare January 21, 2025 20:07

@kit-ty-kate kit-ty-kate left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR contains 2 things: the delay of context creation for package build, and the delay of metadata processes as the sumary is not always printed. PR title is good, but main comment and master changes should contains both. Ideally, 2 commits if it can be easily split.

I don't think those are two separate things. cmd_metadata, p_metadata and r_info are all storing the same things only in three different types. If anything i should be talking about metadata instead of context

Comment thread src/core/opamProcess.ml
let info =
make_info ~cmd ~args ~cwd ~env_file ~stdout_file ~stderr_file ~metadata () in
make_info ~cmd ~args ~cwd ~env_file ~stdout_file ~stderr_file
~metadata:(Lazy.force metadata) ()

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is forced too early. I think there is a way to run it only when the process finished

@kit-ty-kate kit-ty-kate added the PR: WIP Not for merge at this stage label Jan 21, 2025
@kit-ty-kate
kit-ty-kate marked this pull request as draft January 21, 2025 20:14
@kit-ty-kate kit-ty-kate modified the milestones: 2.4.0~alpha1, 2.5.0~alpha1 Apr 7, 2025
@kit-ty-kate kit-ty-kate modified the milestones: 2.6.0~alpha1, 2.7.0~alpha1 Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AREA: PERFORMANCE PR: WIP Not for merge at this stage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants