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

gixy: init at 0.1.8 #31574

Merged
merged 2 commits into from Nov 17, 2017
Merged

gixy: init at 0.1.8 #31574

merged 2 commits into from Nov 17, 2017

Conversation

WilliButz
Copy link
Member

@WilliButz WilliButz commented Nov 12, 2017

gixy is a nginx static configuration analyzer.

Things done
  • also updated pythonPackages.ConfigArgParse to the most recent version (0.9.3 -> 0.12.0), as gixy depends on at least v0.11.0
  • added myself as maintainer
  • bumped certbot as the ConfigArgParse update broke the current version
  • bumped simp_le to the latest version (0.2.0 -> 0.6.0) as well because it depended on acme<0.12,>=0.11, which changed to 0.12 with the certbot update above
  • as requested I moved ConfigArgParse to development/python-modules and gixy to tools/admin
  • 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 [acme] 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.

@WilliButz
Copy link
Member Author

WilliButz commented Nov 12, 2017

This seems to break certbot 0.11.1, commit coming up :)

@WilliButz
Copy link
Member Author

I added a section to handle the different dependencies for each supported python version which should fix the build errors from travis.

@WilliButz
Copy link
Member Author

I am unable to reproduce the failing simp_le test as seen in travis :/

@orivej
Copy link
Contributor

orivej commented Nov 13, 2017

It fails only on Darwin, when trying to execute an empty script with #!/bin/sh shebang.

@@ -8632,11 +8634,11 @@ in {

ConfigArgParse = 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.

We are moving Python expressions out of pkgs/top-level/python-packages.nix into pkgs/development/python-modules/<module>/default.nix.

Please move the expression there, and call it from pkgs/top-level/python-packages.nix using callPackage ../development/python-modules/<package> { };.

@adisbladis
Copy link
Member

adisbladis commented Nov 13, 2017

I think that gixy does not belong in pythonPackages since it's a cli-tool.
It should probably be in tools/admin.

@WilliButz WilliButz changed the title pythonPackages.gixy: init at 0.1.8 gixy: init at 0.1.8 Nov 13, 2017
@WilliButz
Copy link
Member Author

@orivej I have set plaforms to linux as it this tool is not tested/officially supported on other OSes.

@c0bw3b
Copy link
Contributor

c0bw3b commented Nov 14, 2017

👍 on updating simp_le since it's the backend for security.acme

@disassembler
Copy link
Member

@GrahamcOfBorg build gixy

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Failure for system: x86_64-darwin

error: Package ‘gixy-0.1.8’ in /tmp/nix-ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/31574/pkgs/tools/admin/gixy/default.nix:40 is not supported on ‘x86_64-darwin’, refusing to evaluate.

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Success for system: x86_64-linux

tests.plugins.test_simply.test_from_config('alias_traversal', '/tmp/nix-build-gixy-0.1.8.drv-0/source/tests/plugins/simply/alias_traversal/simple.conf', {u'severity': [u'MEDIUM', u'HIGH']}) ... ok
tests.plugins.test_simply.test_from_config('alias_traversal', '/tmp/nix-build-gixy-0.1.8.drv-0/source/tests/plugins/simply/alias_traversal/not_slashed_alias.conf', {u'severity': [u'MEDIUM', u'HIGH']}) ... ok
tests.plugins.test_simply.test_from_config('alias_traversal', '/tmp/nix-build-gixy-0.1.8.drv-0/source/tests/plugins/simply/alias_traversal/not_slashed_alias_fp.conf', {u'severity': [u'MEDIUM', u'HIGH']}) ... ok
tests.plugins.test_simply.test_from_config('alias_traversal', '/tmp/nix-build-gixy-0.1.8.drv-0/source/tests/plugins/simply/alias_traversal/slashed_alias_fp.conf', {u'severity': [u'MEDIUM', u'HIGH']}) ... ok

----------------------------------------------------------------------
Ran 290 tests in 4.458s

OK
/nix/store/llxwkj0lyqa6i4xnj9nfjdyg8pyy0xwd-gixy-0.1.8

@disassembler
Copy link
Member

Can you squash the 2 ConfigArgParse and the two gixy commits so there's just init at for gixy and old -> new for ConfigArgParse?

@WilliButz
Copy link
Member Author

@disassembler I also rebased it to the current master

Copy link
Member

@FRidh FRidh left a comment

Choose a reason for hiding this comment

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

Some minor changes are needed.

Furthermore, security.acme needs to be tested if its indeed impacted. cc @fpletz

name = "ConfigArgParse-${version}";
version = "0.12.0";

src = fetchurl {
Copy link
Member

Choose a reason for hiding this comment

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

fetchPypi

{ stdenv, lib, buildPythonPackage, fetchurl, pythonPackages }:

buildPythonPackage rec {
name = "ConfigArgParse-${version}";
Copy link
Member

Choose a reason for hiding this comment

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

pname = "ConfigArgParse";
and drop the name attribute.
This is something new in buildPythonPackage.

# no tests in tarball
doCheck = false;

meta = with stdenv.lib; {
Copy link
Member

Choose a reason for hiding this comment

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

license, description, maintainer?

Copy link
Member Author

Choose a reason for hiding this comment

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

As this package didn't have any maintainer before, I added myself and also a short description from the repo and the license.

{ lib, fetchFromGitHub, python, pythonPackages
, python27Packages, python35Packages, python36Packages }:
let
pyPkgs = (if python.pythonVersion=="3.5"
Copy link
Member

Choose a reason for hiding this comment

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

This needs to disappear. You can just use python.pkgs instead of pythonPackages.

@@ -4,13 +4,13 @@

python2Packages.buildPythonApplication rec {
name = "certbot-${version}";
version = "0.11.1";
Copy link
Member

Choose a reason for hiding this comment

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

simp_le and thus security.acme need to be tested

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 just ran the acme test successfully

version = "0.1.8";

# package is only compatible with python 2.7 and 3.5+
disabled = !(lib.versionAtLeast python.pythonVersion "3.5"
Copy link
Member

Choose a reason for hiding this comment

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

pythonOlder or pythonNewer

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 didn't find pythonNewer anywhere and used pythonAtLeast instead, which I guess you meant anyway.


# package is only compatible with python 2.7 and 3.5+
disabled = !(lib.versionAtLeast python.pythonVersion "3.5"
|| python.pythonVersion == "2.7");
Copy link
Member

Choose a reason for hiding this comment

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

isPy27

sha256 = "0dg8j8pqlzdvmyfkphrizfqzggr64npb9mnm1dcwm6c3z6k2b0ii";
};

patchPhase = ''
Copy link
Member

Choose a reason for hiding this comment

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

postPatch

@fpletz
Copy link
Member

fpletz commented Nov 17, 2017

We've done the simp_le bump already because the ToS hash of LetsEncrypt changed again. We need a rebase here.

…hon-modules

- fetch with `fetchPypi`
- add license, description and myself as maintainer
@WilliButz
Copy link
Member Author

@fpletz rebased onto master again

@fpletz fpletz merged commit bc7c2c2 into NixOS:master Nov 17, 2017
@WilliButz WilliButz deleted the add-gixy branch November 17, 2017 15:09
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

8 participants