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

ofborg/src/maintainers.nix: look up files pointed by "pos" attribute #669

Merged
merged 1 commit into from
Jan 16, 2024

Conversation

trofi
Copy link
Contributor

@trofi trofi commented Dec 26, 2023

Sometimes most of attributes for a package are defined outside the file
that defines it. Examples are openjdk and nix.

At least openjdk defined pos attribute to guide nix edit to open
the right file. Let's extend ofborg to do the same.

Before the change (with pos applied to nix_2_3):

$ printf '[["nix_2_3"]]' > attrs.json; \
  printf '["pkgs/tools/package-management/nix/default.nix"]' > paths.json; \
  nix-instantiate --eval maintainers.nix --arg changedattrsjson ./attrs.json --arg changedpathsjson ./paths.json
{ }

After the change:

$ printf '[["nix_2_3"]]' > attrs.json; \
  printf '["pkgs/tools/package-management/nix/default.nix"]' > paths.json; \
  nix-instantiate --eval maintainers.nix --arg changedattrsjson ./attrs.json --arg changedpathsjson ./paths.json
{ flokli = <CODE>; raitobezarius = <CODE>; }

@trofi trofi marked this pull request as draft December 26, 2023 11:10
@trofi
Copy link
Contributor Author

trofi commented Dec 26, 2023

It should be nit pos of a pos but just pos. Converting to draft.

Sometimes most of attributes for a package are defined outside the file
that defines it. Examples are `openjdk` and `nix`.

At least `openjdk` defined `pos` attribute to guide `nix edit` to open
the right file. Let's extend `ofborg` to do the same.

Before the change (with `pos` applied to `nix_2_3`):

    $ printf '[["nix_2_3"]]' > attrs.json; \
      printf '["pkgs/tools/package-management/nix/default.nix"]' > paths.json; \
      nix-instantiate --eval maintainers.nix --arg changedattrsjson ./attrs.json --arg changedpathsjson ./paths.json
    { }

After the change:

    $ printf '[["nix_2_3"]]' > attrs.json; \
      printf '["pkgs/tools/package-management/nix/default.nix"]' > paths.json; \
      nix-instantiate --eval maintainers.nix --arg changedattrsjson ./attrs.json --arg changedpathsjson ./paths.json
    { flokli = <CODE>; raitobezarius = <CODE>; }
@trofi
Copy link
Contributor Author

trofi commented Dec 26, 2023

With NixOS/nixpkgs#276892 applied confirmed that nix_2_3 attribute change resolves maintainers as expected. Updated the comment description to include the test.

@trofi trofi marked this pull request as ready for review December 26, 2023 11:48
@Mindavi
Copy link

Mindavi commented Jan 16, 2024

Is nixos/released intentionally the target branch?

@cole-h
Copy link
Member

cole-h commented Jan 16, 2024

Is nixos/released intentionally the target branch?

Yes, released is the default branch for this repository.

Copy link
Member

@cole-h cole-h left a comment

Choose a reason for hiding this comment

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

LGTM.

@cole-h cole-h merged commit 7db074d into NixOS:released Jan 16, 2024
2 checks passed
@trofi trofi deleted the maintainers-at-pos branch January 16, 2024 18:56
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.

None yet

3 participants