Skip to content

[bin-wrappers] Reduce/improve when we create bin wrappers #1522

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

Merged
merged 4 commits into from
Oct 3, 2023

Conversation

mikeland73
Copy link
Contributor

Summary

This removes all CreateWrappers calls except one. It also removes the interface used to prevent a circular dependency and passed in all arguments at the callsite. It no longer needs to recompute nix env.

It helps address performance issues where CreateWrappers was causing extra calls to ComputeNixEnv.

How was it tested?

It builds and runs. This will need extensive testing.

@mikeland73 mikeland73 requested review from savil and ipince October 3, 2023 00:57
Copy link
Collaborator

@savil savil left a comment

Choose a reason for hiding this comment

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

why did we have all the additional calls?

@@ -134,12 +125,11 @@ func CreateDevboxSymlinkIfPossible() error {
}

type createWrapperArgs struct {
devboxer
Copy link
Collaborator

Choose a reason for hiding this comment

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

yes! thank god we removed this.

}

return wrapnix.CreateWrappers(ctx, d)
return d.saveCfg()
Copy link
Collaborator

Choose a reason for hiding this comment

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

why don't we save the lockfile here, after the config has been changed? Similar to the end of AddPackages.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's actually not needed in either because ensurePackagesAreInstalled already does lockfile.Tidy

will remove from Add()

@mikeland73
Copy link
Contributor Author

why did we have all the additional calls?

They predate the call inside ensurePackagesAreInstalled. Previously all our code paths were not centralized through ensurePackagesAreInstalled so each command had its own bin wrapper creation. But I think tying it to ensurePackagesAreInstalled is exactly what we need. I still want to test it thoroughly.

@mikeland73 mikeland73 merged commit 36374bc into main Oct 3, 2023
@mikeland73 mikeland73 deleted the landau/improve-create-wrappers branch October 3, 2023 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants