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

doc: explain pull request template #28589

Merged
merged 1 commit into from
Aug 29, 2017

Conversation

disassembler
Copy link
Member

Motivation for this change

Give detailed sections in nixpkgs contributing section of what the different sections of the PR template are and how to fulfill the requirements for each checkbox. This addresses #28579.

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
    • Linux
  • 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.

Copy link
Member

@Mic92 Mic92 left a comment

Choose a reason for hiding this comment

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

Thanks for taking the time to write this down. I largely agree on the content.

I am not a good proof reader though, so maybe somebody else should read it too.

<literal>fetch*</literal> functions and files outside the Nix store.
Depending on the operating system access to other resources are blocked
as well (ex. inter process communication is isolated on Linux); see <link
xlink:href="https://nixos.org/nix/manual/#description-45">build-use-sandbox</link>
Copy link
Member

Choose a reason for hiding this comment

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

@other reviewer
Since both documents are in the same documentation, what is the right way to link them in docbook?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think you can because these are in separate documents. This is linking the nix manual, but this is in the nixpkgs manual. Someone that knows docbook better than me can correct me if I'm wrong here.

maintainer to verify the functionality of the package. If there are
existing tests for the package, they should be ran to verify your changes
do not break the tests. Tests only apply to packages with NixOS modules
defined and can only be ran on NixOS. For more details on writing and
Copy link
Member

Choose a reason for hiding this comment

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

- can be only ran on NixOS
+ can be only ran on Linux

our tests are using qemu so they are not limited to NixOS.

</para>
<para>
Depending if you use NixOS or other platforms you can use one of the
following methods to enable sandboxing:
Copy link
Member

@Mic92 Mic92 Aug 26, 2017

Choose a reason for hiding this comment

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

what I forgot to add here is the following:

- following methods to enable sandboxing.
+ following methods to enable sandboxing <emphasis role="bold">before</emphasis> building the package.

<itemizedlist>
<listitem>
<para><emphasis role="bold">Enable sandboxing for single build</emphasis>:
<screen>nix-shell -I nixpkgs=/path/to/nixpkgs --option build-use-sandbox true -p hello</screen>
Copy link
Member

@Mic92 Mic92 Aug 26, 2017

Choose a reason for hiding this comment

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

append:

(replace <literal>hello</literal> with the package you want to build)

<itemizedlist>
<listitem>
<para><emphasis role="bold">Enable sandboxing for single build</emphasis>:
<screen>nix-shell -I nixpkgs=/path/to/nixpkgs --option build-use-sandbox true -p hello</screen>
Copy link
Contributor

Choose a reason for hiding this comment

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

The way this is worded gives the impression that an ordinary user can control sandbox usage even if they are using the Nix daemon.

Copy link
Member

@Mic92 Mic92 Aug 27, 2017

Choose a reason for hiding this comment

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

Are options ignored, when nix-daemon is used? Then we should probably not mention this at all. Otherwise people, will fall into the trap.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree it'd be better to leave this out, or at least add some caveats.

Copy link
Member

@globin globin left a comment

Choose a reason for hiding this comment

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

Apart from the minor nitpick, very nice!

Packages with automated tests are much more likely to be merged in a
timely fashion because it doesn't require as much manual testing by the
maintainer to verify the functionality of the package. If there are
existing tests for the package, they should be ran to verify your changes
Copy link
Member

Choose a reason for hiding this comment

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

ran -> run

maintainer to verify the functionality of the package. If there are
existing tests for the package, they should be ran to verify your changes
do not break the tests. Tests only apply to packages with NixOS modules
defined and can only be ran on NixOS. For more details on writing and
Copy link
Member

Choose a reason for hiding this comment

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

ran -> run

Copy link
Member

@grahamc grahamc left a comment

Choose a reason for hiding this comment

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

Really really great. A few nits to be picked, and I think the part about why sandboxing is disabled by default should be corrected prior to merging. Thank you a lot for writing this :D

Depending on the operating system access to other resources are blocked
as well (ex. inter process communication is isolated on Linux); see <link
xlink:href="https://nixos.org/nix/manual/#description-45">build-use-sandbox</link>
in nix manual for details.
Copy link
Member

Choose a reason for hiding this comment

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

nix -> Nix

for each build process. It is used to remove further hidden dependencies
set by the build environment to improve reproducibility. This includes
access to the network during the build outside of
<literal>fetch*</literal> functions and files outside the Nix store.
Copy link
Member

Choose a reason for hiding this comment

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

<function> over <literal> I think?

</para>
<para>
Sandboxes are not enabled by default in Nix as there are cases where it
makes building packages harder (for example <command>npm
Copy link
Member

Choose a reason for hiding this comment

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

Sandboxing is disabled by default not because it is harder, but because it is slower: NixOS/nix#179

<section>
<title>Built on platform(s)</title>
<para>
Many <literal>Nix</literal> packages are designed to run on multiple
Copy link
Member

Choose a reason for hiding this comment

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

Nix isn't a literal here

</para>
<para>
review changes from pull request number 12345:
<screen>nix-shell -p nox --run nox-review 12345</screen>
Copy link
Member

Choose a reason for hiding this comment

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

Missing the command pr, should be: nox-review pr 12345

It's important to test any executables generated by a build when you
change or create a package in nixpkgs. This can be done by looking in
<filename>./result/bin</filename> and running any files in there, or at a
minimum, the main file for the package. For example, if you make a change
Copy link
Member

Choose a reason for hiding this comment

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

file is ambiguous, I think you mean the main executable for the package

@Mic92 Mic92 merged commit e682cfc into NixOS:master Aug 29, 2017
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

5 participants