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

nlohmann_json_schema_validator: init at 2.3.0 #275224

Merged
merged 2 commits into from
Dec 26, 2023
Merged

Conversation

br337
Copy link

@br337 br337 commented Dec 18, 2023

Description of changes

This package is a JSON schema validator for Modern C++. More information on it here.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@NixOSInfra NixOSInfra added the 12. first-time contribution This PR is the author's first one; please be gentle! label Dec 18, 2023
Copy link
Contributor

@drupol drupol left a comment

Choose a reason for hiding this comment

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

Hi !

Thanks for your first contribution!

Things left to do:

  1. Move your file in pkgs/by-name/... and remove the entry from all-packages.nix
  2. The PR title should be: <name>: init at <version>
  3. The commit message should be identical to the PR title
  4. It would be nice to have you as maintainer, therefore a commit to add yourself in the maintainers file (maintainers: add br337) needs to be made before the current commit.
  5. The pname looks wonky, why is it containing the name of one of its dependency ?

Let me know if you need some help!

@br337
Copy link
Author

br337 commented Dec 18, 2023

Hi !

Thanks for your first contribution!

Things left to do:

1. Move your file in `pkgs/by-name/...` and remove the entry from `all-packages.nix`

2. The PR title should be: `<name>: init at <version>`

3. The commit message should be identical to the PR title

4. It would be nice to have you as maintainer, therefore a commit to add yourself in the maintainers file (`maintainers: add br337`) needs to be made before the current commit.

5. The `pname` looks wonky, why is it containing the name of one of its dependency ?

Let me know if you need some help!

Hi, I'm sorry if the following questions will seem kind of silly but I struggle with some things regarding this PR:

  1. Why should this package go in pkgs/by-name/ and not in pkgs/development/libraries/ since it is a C++ dev library closely related to nlohmann_json which already resides in pkgs/development/libraries/?
  2. <name> here being the name of the package and <version> the version of said library?
  3. Noted! 😃
  4. Sure! That would be great. Would that require an additional PR or should that be done in this PR but just as an additional commit before the package has been committed? I assume I should add myself in the /maintainers/maintainer-list.nix file.
  5. I know it's wonky, but I'm not the original developer of the library and that is sadly the name the library uses pretty much everywhere, including in CMake when importing it.

@drupol
Copy link
Contributor

drupol commented Dec 18, 2023

Hi, I'm sorry if the following questions will seem kind of silly but I struggle with some things regarding this PR:

1. Why should this package go in `pkgs/by-name/` and not in `pkgs/development/libraries/` since it is a C++ dev library closely related to `nlohmann_json` which already resides in `pkgs/development/libraries/`?

This is the new package name convention (RFC140). Maybe you should have a look and see if there are already libraries in there. If yes, then I would kindly ask you to follow that pattern.

2. `<name>` here being the name of the package and `<version>` the version of said library?

Correct.

4. Sure! That would be great. Would that require an additional PR or should that be done in this PR but just as an additional commit before the package has been committed? I assume I should add myself in the `/maintainers/maintainer-list.nix` file.

Yes, you can make a commit within this PR with you added in the maintainers list.

5. I know it's wonky, but I'm not the original developer of the library and that is sadly the name the library uses pretty much everywhere, including in CMake when importing it.

Fair enough, since I don't know anything in there, I'll trust you in there.

@br337 br337 closed this Dec 18, 2023
@br337 br337 reopened this Dec 18, 2023
@br337 br337 changed the title Added package for nlohmann-json-schema-validator nlohmann_json_schema_validator: init at 2.3.0 Dec 18, 2023
@br337 br337 force-pushed the nixos-unstable branch 2 times, most recently from 19aea87 to 84af350 Compare December 18, 2023 20:45
maintainers/maintainer-list.nix Outdated Show resolved Hide resolved
pkgs/by-name/nl/nlohmann_json_schema_validator/package.nix Outdated Show resolved Hide resolved
@drupol drupol changed the base branch from nixos-unstable to master December 18, 2023 20:50
Fixed attribute order in maintainers list
@br337 br337 force-pushed the nixos-unstable branch 2 times, most recently from 86bbbd3 to 0661c76 Compare December 18, 2023 21:05
@br337
Copy link
Author

br337 commented Dec 18, 2023

Should I also squash the last commits?

@drupol
Copy link
Contributor

drupol commented Dec 18, 2023

Should I also squash the last commits?

Correct.

@br337 br337 marked this pull request as ready for review December 18, 2023 21:18
@br337
Copy link
Author

br337 commented Dec 18, 2023

Should I also squash the last commits?

Correct.

Done

Copy link
Contributor

@drupol drupol left a comment

Choose a reason for hiding this comment

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

Congrats for your first PR, welcome to the family !
It LGTM, but let's wait for someone else's review.

Keep PRs coming!

@delroth delroth added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Dec 18, 2023
Copy link
Member

@pbsds pbsds left a comment

Choose a reason for hiding this comment

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

Result of nixpkgs-review pr 275224 run on x86_64-linux 1

1 package built:
  • nlohmann_json_schema_validator

Runs fine, LGTM. Just a nit

Copy link
Contributor

@2xsaiko 2xsaiko left a comment

Choose a reason for hiding this comment

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

Just a small thing :^)

pkgs/by-name/nl/nlohmann_json_schema_validator/package.nix Outdated Show resolved Hide resolved
@2xsaiko
Copy link
Contributor

2xsaiko commented Dec 21, 2023

1 package built:
nlohmann_json_schema_validator

Result of nixpkgs-review pr 275224 run on aarch64-darwin 1

1 package built:
  • nlohmann_json_schema_validator

@delroth delroth removed the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Dec 22, 2023
@br337
Copy link
Author

br337 commented Dec 22, 2023

Changes are now squashed

@delroth delroth added the 12.approvals: 2 This PR was reviewed and approved by two reputable people label Dec 22, 2023
@delroth delroth added 12.approvals: 3+ This PR was reviewed and approved by three or more reputable people and removed 12.approvals: 2 This PR was reviewed and approved by two reputable people labels Dec 22, 2023
Comment on lines +23 to +29
meta = {
description = "JSON schema validator for JSON for Modern C++";
homepage = "https://github.com/pboettch/json-schema-validator";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ br337 ];
platforms = lib.platforms.all;
};
Copy link
Member

@Janik-Haag Janik-Haag Dec 22, 2023

Choose a reason for hiding this comment

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

please add meta.mainProgram, since the package adds multiple binarys and things like lib.getExe or nix run won't work without it.

Copy link
Member

@pbsds pbsds Dec 23, 2023

Choose a reason for hiding this comment

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

Unless there is a clear binary the package provides which is the one users expect to be run, i oppose setting mainProgram. In such cases one is expected to use lib.getExe' or nix shell PKG -c binary ....

Copy link
Member

Choose a reason for hiding this comment

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

Being able to disable the bin/${pname} fallback behavior of lib.getExe with something like mainProgram = null would be great, but implementing that that is outside the scope of this PR

Copy link
Member

Choose a reason for hiding this comment

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

Unless there is a clear binary the package provides which is the one users expect to be run, i oppose setting mainProgram. In such cases one is expected to use lib.getExe' or nix shell PKG -c binary ....

I would have set it to json-schema-validate since that's the thing in the package name. But feel free to merge if you think otherwise, the package looks good to me except for this.

Copy link
Author

Choose a reason for hiding this comment

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

So should I implement this change now or should I resolve the issue without further changes?

@delroth delroth added 12.approvals: 2 This PR was reviewed and approved by two reputable people and removed 12.approvals: 3+ This PR was reviewed and approved by three or more reputable people labels Dec 23, 2023
@drupol drupol merged commit cacf372 into NixOS:master Dec 26, 2023
26 checks passed
@drupol
Copy link
Contributor

drupol commented Dec 26, 2023

Let's not wait too long before getting feedback, especially on a first contributor PR.
If anything need to be changed now, it can be done either by the author or someone else.

Thanks for your contribution, keep PRs coming!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 10.rebuild-linux: 1-10 10.rebuild-linux: 1 11.by: package-maintainer This PR was created by the maintainer of the package it changes 12.approvals: 2 This PR was reviewed and approved by two reputable people 12. first-time contribution This PR is the author's first one; please be gentle!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants