-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
[RFC 0095] Enable doCheck by default #95
Changes from 9 commits
cc112ac
8c47ee8
ad5adb6
864572c
af3d757
b8924de
918edff
5980692
680344d
4b75420
a39020b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,64 @@ | ||||||||||||||||||
--- | ||||||||||||||||||
feature: enable-docheck-by-default | ||||||||||||||||||
start-date: 2021-06-24 | ||||||||||||||||||
author: gytis-ivaskevicius | ||||||||||||||||||
co-authors: | ||||||||||||||||||
shepherd-team: @Ericson2314 @nh2 @edolstra | ||||||||||||||||||
shepherd-leader: @Ericson2314 | ||||||||||||||||||
related-issues: | ||||||||||||||||||
--- | ||||||||||||||||||
|
||||||||||||||||||
# Summary | ||||||||||||||||||
[summary]: #summary | ||||||||||||||||||
|
||||||||||||||||||
Enable `doCheck` by default when using `stdenv.mkDerivation` function. | ||||||||||||||||||
|
||||||||||||||||||
# Motivation | ||||||||||||||||||
[motivation]: #motivation | ||||||||||||||||||
|
||||||||||||||||||
I believe that an additional quality gate would be beneficial to the derivations build process. | ||||||||||||||||||
|
||||||||||||||||||
Resolution of this RFC is expected to remove [these comments](https://github.com/NixOS/nixpkgs/blob/8c563eaf7049d82fbe95b0847ac5ae6e5554e2fa/pkgs/stdenv/generic/make-derivation.nix#L61-L67) | ||||||||||||||||||
either by enabling `checkPhase` by default or rejecting this RFC. | ||||||||||||||||||
|
||||||||||||||||||
# Detailed design | ||||||||||||||||||
[design]: #detailed-design | ||||||||||||||||||
|
||||||||||||||||||
The basic idea is quite simple | ||||||||||||||||||
- New `doCheck`/`doInstallCheck` semantic should be implemented. | ||||||||||||||||||
- By default `doCheck` option should be enabled as long as `stdenv.hostPlatform == stdenv.buildPlatform`. | ||||||||||||||||||
- Non-reproducible test prevention should be implemented. | ||||||||||||||||||
- All failing packages should be fixed or updated with `doCheck = false;` | ||||||||||||||||||
|
||||||||||||||||||
**New `doCheck`/`doInstallCheck` semantics:** | ||||||||||||||||||
In addition to booleans, `doCheck`/`doInstallCheck` should also accept strings. | ||||||||||||||||||
- String value should be considered as `false` | ||||||||||||||||||
- It should be used as a place for comment on why the check is disabled. For | ||||||||||||||||||
example: "Requires X11 server" or "Requires network access". | ||||||||||||||||||
Comment on lines
+33
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
The first point is so we could evaluate checks that are not set. Derivation paths are not expected to change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A comment on the source code and a Boolean value shoud suffice. There is no reason to overload this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. During RFC call, we thought that it would be a very simple change which would allow us to actually evaluate the reason why tests were disabled and that is definitely handy. I am still in favor of it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That being said, it is preferrable a (short?) string, without true/false semantics attached to it. Something like doCheck = false;
checkReason = "I don't wanna fetch X.Org just to verify a blinking box!"; Or even better, a new attrset: check.enable = true;
check.reason = "This package is critical for bootstrap"; |
||||||||||||||||||
|
||||||||||||||||||
**Non-reproducible tests prevention:** | ||||||||||||||||||
There are multiple options. Here I am going to list a few: | ||||||||||||||||||
1. `chmod a-w -R /build` | ||||||||||||||||||
2. [User namespaces](https://lwn.net/Articles/532593/) | ||||||||||||||||||
3. Generate unique identifier from existing sources and compare it with | ||||||||||||||||||
identifier generated after executing `checkPhase`. `exit 1` if values | ||||||||||||||||||
mismatch. (Identifier can be generated by something simple like `du -s`) | ||||||||||||||||||
gytis-ivaskevicius marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||
4. [unionfs](https://en.wikipedia.org/wiki/UnionFS) | ||||||||||||||||||
|
||||||||||||||||||
# Drawbacks | ||||||||||||||||||
[drawbacks]: #drawbacks | ||||||||||||||||||
|
||||||||||||||||||
- Increased build time. | ||||||||||||||||||
- Increases likelihood of failing derivations after a simple update. | ||||||||||||||||||
|
||||||||||||||||||
gytis-ivaskevicius marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||
# Alternatives | ||||||||||||||||||
[alternatives]: #alternatives | ||||||||||||||||||
|
||||||||||||||||||
The impact of avoiding this is a lack of assurance of delivered package quality. | ||||||||||||||||||
|
||||||||||||||||||
gytis-ivaskevicius marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||
# Unresolved questions | ||||||||||||||||||
[unresolved]: #unresolved-questions | ||||||||||||||||||
|
||||||||||||||||||
"Non-reproducible tests prevention" implementation is to be decided. I feel | ||||||||||||||||||
like `du -s` is the right way to go about it since it is simple/fast and I | ||||||||||||||||||
expect it to be quite reliable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guys, sounds good?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guidelines to refrain from enabling tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P.S.:
s|If|When|
When tests are flaky, unpredictably failing.