Skip to content

[remove nixpkgs] Naming: update Package methods to InputAddressedPath and ContentAddressedPath, and s/BinaryStore/BinaryCache #1257

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 2 commits into from
Jul 7, 2023

Conversation

savil
Copy link
Collaborator

@savil savil commented Jul 7, 2023

Summary

This PR is a follow up to this request from @gcurtis:
#1256 (review)

BUT having NixStorePath and ContentAddressedPath seemed odd since content-addressed paths
are also nix store paths. So, in this PR, I'm explicit about NixStorePath being
InputAddressedPath.

Also - changed BinaryStore to BinaryCache.

RFC:
I didn't change the lock.SystemInfo struct, I've left it as:

type SystemInfo struct {
	// StorePath is the input-addressed path for the nix package in /nix/store
	// It is the cache key in the Binary Cache Store (cache.nixos.org)
	// It is of the form <hash>-<name>-<version>
	// <name> may be different from the canonicalName so we store the full store path.
	StorePath string `json:"store_path,omitempty"`
	// CAStorePath is the content-addressed path for the nix package in /nix/store
	// It is of the form <hash>-<name>-<version>
	CAStorePath string `json:"ca_store_path,omitempty"`
}

I think this could be okay, because the default store_path for nix is input-addressed, for now at least.

If you'd like I can change StorePath to be explicitly:

InputAddrStorePath string `json:"input_addr_path, omitempty"
ContentAddrStorePath string `json:"content_addr_path, omitempty"

Let me know!

How was it tested?

compiles

… and ContentAddressedPath, and s/BinaryStore/BinaryCache
Copy link
Collaborator Author

savil commented Jul 7, 2023

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@savil savil requested review from gcurtis, mikeland73 and LucilleH July 7, 2023 18:04
Copy link
Collaborator

@LucilleH LucilleH left a comment

Choose a reason for hiding this comment

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

oh this is much clearer!

Copy link
Collaborator

@gcurtis gcurtis left a comment

Choose a reason for hiding this comment

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

Thanks! This made things a lot easier to understand.

@@ -31,7 +31,7 @@ func ProfileListItems(
}

// The `line` output is of the form:
// <index> <UnlockedReference> <LockedReference> <NixStorePath>
// <index> <UnlockedReference> <LockedReference> <InputAddressedPath>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

will revert this line

@savil savil merged commit 5becdc1 into main Jul 7, 2023
@savil savil deleted the savil/rm-nixpkgs-renames branch July 7, 2023 20:58
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.

4 participants