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

chkcrontab: init at 1.7 #35347

Merged
merged 1 commit into from Mar 18, 2018
Merged

chkcrontab: init at 1.7 #35347

merged 1 commit into from Mar 18, 2018

Conversation

Ma27
Copy link
Member

@Ma27 Ma27 commented Feb 22, 2018

Motivation for this change

chkcrontab is a simple utility to check crontab for errors.
Fixes #34969

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
    • other Linux distributions
  • 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

@dotlambda dotlambda left a comment

Choose a reason for hiding this comment

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

The expression belongs into pkgs/tools/... and buildPythonApplication should be used. It should be called from all-packages.nix.

@@ -0,0 +1,18 @@
{ buildPythonPackage, stdenv, fetchPypi }:

buildPythonPackage rec {
Copy link
Member

Choose a reason for hiding this comment

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

buildPythonApplication

@Ma27
Copy link
Member Author

Ma27 commented Feb 24, 2018

@fpletz @dotlambda thanks for the feedback. However I won’t have any laptop to code until tuesday evening, I can fix it then :)

@Ma27
Copy link
Member Author

Ma27 commented Feb 28, 2018

@dotlambda @fpletz done :)

Copy link
Member

@dotlambda dotlambda left a comment

Choose a reason for hiding this comment

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

Two final changes, then it's good to go.

description = "A tool to detect crontab errors";
license = licenses.asl20;
maintainers = with maintainers; [ ma27 ];
homepage = https://pypi.python.org/pypi/chkcrontab;
Copy link
Member

Choose a reason for hiding this comment

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

@@ -1531,6 +1531,8 @@ with pkgs;

checkinstall = callPackage ../tools/package-management/checkinstall { };

chkcrontab = callPackage ../tools/chkcrontab { };
Copy link
Member

Choose a reason for hiding this comment

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

Please move to tools/admin sor something like that

@@ -608,6 +608,8 @@ with pkgs;

container-linux-config-transpiler = callPackage ../development/tools/container-linux-config-transpiler { };

chkcrontab = callPackage ../tools/chkcrontab { };
Copy link
Member

Choose a reason for hiding this comment

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

Please choose a subdir of tools/

@dotlambda
Copy link
Member

@GrahamcOfBorg build chkcrontab

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Partial log (click to expand)

W: 19: @monthly Missing User
w:     USER_NOT_FOUND: User "Missing" not found.
E: There were 2 errors and 3 warnings.
See http://goo.gl/7XS9q for more info.
W: Cron will not process this file - its name must match [A-Za-z0-9_-]+ .
W: 5: 1 * * * * not_a_user Command with %
w:    BARE_PERCENT: A bare % is a line break in crontab and is commonly not intended.
W: There were 2 warnings.
See http://goo.gl/7XS9q for more info.
/nix/store/rqgn641k09hz63j7cjm5v8jxm83h2ww4-chkcrontab-1.7

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Partial log (click to expand)

w:     USER_NOT_FOUND: User "Missing" not found.
E: There were 2 errors and 3 warnings.
See http://goo.gl/7XS9q for more info.
W: Cron will not process this file - its name must match [A-Za-z0-9_-]+ .
W: 5: 1 * * * * not_a_user Command with %
w:    BARE_PERCENT: A bare % is a line break in crontab and is commonly not intended.
W: There were 2 warnings.
See http://goo.gl/7XS9q for more info.
builder for ‘/nix/store/piwgdg0zv67hq13kfnjgx5bn1asvgdj5-chkcrontab-1.7.drv’ failed with exit code 1
error: build of ‘/nix/store/piwgdg0zv67hq13kfnjgx5bn1asvgdj5-chkcrontab-1.7.drv’ failed

`chkcrontab` is a simple utility to check crontab for errors.
Fixes NixOS#34969
@Ma27
Copy link
Member Author

Ma27 commented Mar 5, 2018

@dotlambda I fixed the issue. However I'm confused about the error message, when I run nix-build -A chkcrontab --option build-use-sandbox true works perfectly fine...

@dotlambda
Copy link
Member

What did you change?

@dotlambda
Copy link
Member

@GrahamcOfBorg build chkcrontab

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Partial log (click to expand)

w:     USER_NOT_FOUND: User "Missing" not found.
E: There were 2 errors and 3 warnings.
See http://goo.gl/7XS9q for more info.
W: Cron will not process this file - its name must match [A-Za-z0-9_-]+ .
W: 5: 1 * * * * not_a_user Command with %
w:    BARE_PERCENT: A bare % is a line break in crontab and is commonly not intended.
W: There were 2 warnings.
See http://goo.gl/7XS9q for more info.
builder for ‘/nix/store/piwgdg0zv67hq13kfnjgx5bn1asvgdj5-chkcrontab-1.7.drv’ failed with exit code 1
error: build of ‘/nix/store/piwgdg0zv67hq13kfnjgx5bn1asvgdj5-chkcrontab-1.7.drv’ failed

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Partial log (click to expand)

W: 19: @monthly Missing User
w:     USER_NOT_FOUND: User "Missing" not found.
E: There were 2 errors and 3 warnings.
See http://goo.gl/7XS9q for more info.
W: Cron will not process this file - its name must match [A-Za-z0-9_-]+ .
W: 5: 1 * * * * not_a_user Command with %
w:    BARE_PERCENT: A bare % is a line break in crontab and is commonly not intended.
W: There were 2 warnings.
See http://goo.gl/7XS9q for more info.
/nix/store/rqgn641k09hz63j7cjm5v8jxm83h2ww4-chkcrontab-1.7

@Ma27
Copy link
Member Author

Ma27 commented Mar 5, 2018

@dotlambda I didn't change any of the logic, nix-build passes locally...
optionally we can disable the affected test case...

@Ma27
Copy link
Member Author

Ma27 commented Mar 5, 2018

@grahamc could you please have a short look at the borg's output? I tried the sandbox build successfully and I don't know if I managed to screw something up or that's a bug of @GrahamcOfBorg :)

@Ma27
Copy link
Member Author

Ma27 commented Mar 17, 2018

@GrahamcOfBorg build chkcrontab

1 similar comment
@dotlambda
Copy link
Member

@GrahamcOfBorg build chkcrontab

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: chkcrontab

Partial log (click to expand)

w:     BARE_PERCENT: A bare % is a line break in crontab and is commonly not intended.
W: 19: @monthly Missing User
w:     USER_NOT_FOUND: User "Missing" not found.
E: There were 2 errors and 3 warnings.
See http://goo.gl/7XS9q for more info.
W: Cron will not process this file - its name must match [A-Za-z0-9_-]+ .
W: 5: 1 * * * * not_a_user Command with %
w:    BARE_PERCENT: A bare % is a line break in crontab and is commonly not intended.
W: There were 2 warnings.
See http://goo.gl/7XS9q for more info.

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: chkcrontab

Partial log (click to expand)

w:     BARE_PERCENT: A bare % is a line break in crontab and is commonly not intended.
W: 19: @monthly Missing User
w:     USER_NOT_FOUND: User "Missing" not found.
E: There were 2 errors and 3 warnings.
See http://goo.gl/7XS9q for more info.
W: Cron will not process this file - its name must match [A-Za-z0-9_-]+ .
W: 5: 1 * * * * not_a_user Command with %
w:    BARE_PERCENT: A bare % is a line break in crontab and is commonly not intended.
W: There were 2 warnings.
See http://goo.gl/7XS9q for more info.

@dotlambda dotlambda merged commit b96fa84 into NixOS:master Mar 18, 2018
@Ma27 Ma27 deleted the package-chkcrontab branch March 18, 2018 09:28
@Ma27
Copy link
Member Author

Ma27 commented Mar 18, 2018

interesting... I actually added myself to the known users: NixOS/ofborg@b00ab5a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants