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

lib: Better use the module type system in platform parsing #34400

Merged
merged 1 commit into from Jan 31, 2018

Conversation

Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Jan 29, 2018

Motivation for this change

I need some module system types here so I can next fix meta-checks for derivations. I'd like to use a "proper" record type here, but submodule types seem overkill so holding off with ad-hoc stuff for now. In practice, all I need for the next step are the .check functions so this is good, especially as the submodule check function is shallow, saving full inductive type-checking for a later step.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

CC @ElvishJerricco @danharaj


types.significantByte = enum (attrValues significantBytes);

significantBytes = setTypes types.openSignifiantByte {
Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm I supposed unlike the other {} whitelists, I'll never add a third endianness, so this can just be a [ "bigEndian" "littleEndian" ] enum?


types.openExecFormat = mkOptionType {
name = "exec-format";
description = "executble container used by the kernel";
Copy link
Member

Choose a reason for hiding this comment

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

typo executable

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks

I need some module system types here so I can next fix meta-checks for
derivations. I'd like to use a "proper" record type here, but submodule
types seem overkill so holding off with ad-hoc stuff for now. In
practice, all I need for the next step are the `.check` functions so
this is good, especially as the submodule check function is shallow,
saving full inductive type-checking for a later step.
@Ericson2314
Copy link
Member Author

I'm going to merge this now so I can do the next bit. @nbp I hope you eventually have time to look at this, but at least nothing I do next will constrain much what's here so it won't be too late whenever you do.

@Ericson2314 Ericson2314 merged commit ad78ba1 into NixOS:master Jan 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants