Skip to content
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

flake-info: support platform patterns #602

Merged
merged 2 commits into from
Jan 27, 2023
Merged

flake-info: support platform patterns #602

merged 2 commits into from
Jan 27, 2023

Conversation

ncfavier
Copy link
Member

@ncfavier ncfavier commented Jan 24, 2023

nixpkgs currently defines three ways of specifying elements of meta.{platforms,badPlatforms}:

  1. as a string; this is okay
  2. as a pattern, which is an attribute set meant to match a platform's parsed field (or possibly in the future an entire platform, see meta: replace predicates with pattern over elaborated platform nixpkgs#212939). This has apparently been a thing for a long time but wasn't used until about a week ago. For now, just skip them without causing an error. Later, maybe figure out a way to display them properly.
  3. as a function platform → bool; this causes nix-env to emit null which is not great but at least we support it fine.

For reference, the isGnu list of patterns looks like this:

[
  { abi = { _type = "abi"; abi = "64"; name = "gnuabi64"; }; }
  { abi = { _type = "abi"; name = "gnu"; }; }
  { abi = { _type = "abi"; float = "soft"; name = "gnueabi"; }; }
  { abi = { _type = "abi"; float = "hard"; name = "gnueabihf"; }; }
  { abi = { _type = "abi"; abi = "elfv1"; name = "gnuabielfv1"; }; }
  { abi = { _type = "abi"; abi = "elfv2"; name = "gnuabielfv2"; }; }
]

so the old System struct we removed in #580 wouldn't have helped here.

...for some value of "support". For now, just skip them without causing
an error. Later, maybe figure out a way to display them properly.

An example of a pattern is `lib.systems.inspect.patterns.isGnu`.
@garbas garbas merged commit 9e5ff1c into main Jan 27, 2023
@garbas garbas deleted the fix-platforms branch January 27, 2023 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants