-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(lockfile) hide berry lockfile lifetime (#5436)
### Description In order to let the package graph hold a lockfile we need to avoid exposing a lifetime in the berry implementation. This PR changes the internal representations to all be completely owned. Alternatives considered: - Continue with the self-referential struct, but have the lockfile pinned and then use `mem::transmute` to mutate the required lifetimes to be `static`. Attempted this, but ran into enough issues that it wasn't looking like a quick refactor. - Use [ouroboros](https://docs.rs/ouroboros/0.17.0/ouroboros/attr.self_referencing.html) to allow for the self-referential struct via the macro. In the future this might be worth a look, but I didn't want to block on verifying that we currently follow and in the future will follow all of the restrictions this macro imposes. ### Testing Instructions This shouldn't change any behavior, just makes it so doesn't require any additional data. `cargo instruments --example berry_resolutions -t time` shows that execution is `68ms` which is still very reasonable. These changes do increase memory pressure somewhat, but it's not unreasonable at all. --------- Co-authored-by: Chris Olszewski <Chris Olszewski>
- Loading branch information
1 parent
4314d1d
commit b9c3823
Showing
7 changed files
with
95 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.