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

fix: proper type checking on targets #3

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Commits on Feb 10, 2023

  1. fix: proper type checking on targets

    Blocktypes can define their own custom yants types and they will be
    checked properly, giving us some actual type safety.
    nrdxp committed Feb 10, 2023
    Configuration menu
    Copy the full SHA
    10c9362 View commit details
    Browse the repository at this point in the history

Commits on Feb 12, 2023

  1. fix: oversights

    Q: should we use uncheckd imported for the registry (i.e. the
    extractor)?
      - would that have any noticeable impact on registry eval?
      - if it's a drv it's already not lazy as soon as .meta is queried
      - when the type is `drv`, the check in yants is
        `drv = typedef "derivation" (x: isAttrs x && x ? "type" && x.type == "derivation");`
        if that's not lazy, then we incur in extra costs for all items that
        otherwise wouldn't have needed to eval a drv
      - practically speaking, the time real sensitive eval is `init`
      - but `init` already incurs in an evaluation for `meta` (display)
      - type checking _could_ have a negative impact when lib.lazyDerivation
        is used, as this only shields `.meta` & `.passthru`, but not `.type`?
        - A: we're lucky, `.type` is lazy in lazyDerivation, see:
          https://github.com/NixOS/nixpkgs/blob/29f41f2a5d31f04e58334376dc08ced7212df197/lib/derivations.nix#L90
      - `.type` or `isAttrs` breaking laziness needs to be validated
    blaggacao committed Feb 12, 2023
    Configuration menu
    Copy the full SHA
    28ed5de View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5c593a2 View commit details
    Browse the repository at this point in the history