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

dapper: init at v0.4.1 #62289

Merged
merged 1 commit into from Jun 5, 2019
Merged

dapper: init at v0.4.1 #62289

merged 1 commit into from Jun 5, 2019

Conversation

ngerstle-cognite
Copy link
Contributor

Motivation for this change

Add the dapper (https://github.com/rancher/dapper) tool.
The dapper tool wraps docker and eases building of software (such as k3s) inside of docker containers for consistency.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option 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 nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

homepage = https://github.com/rancher/dapper;
license = licenses.asl20;
platforms = platforms.linux;
maintainers = with maintainers; [ ngerstle ];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm happy to give over being maintainer to more active/invested individuals

Copy link
Member

Choose a reason for hiding this comment

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

Same applies here - if you want I can take it over maintenance wise. I also would like to move on with k3s after that as well. Did you start working on it by any chance?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kuznero I was just about to start, as you can guess- hence #61190
Have you started a PR?

Copy link
Member

Choose a reason for hiding this comment

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

I have a branch, but didn't create PR yet.

@etu
Copy link
Contributor

etu commented May 31, 2019

@GrahamcOfBorg build dapper

@etu
Copy link
Contributor

etu commented May 31, 2019

Oh right, @ngerstle-cognite: You need to add the package to all-packages.nix as well. This can be as part of the same commit as the package itself.

@ngerstle-cognite
Copy link
Contributor Author

Gotcha- perhaps we should add it to CONTRIBUTING.md or is that intended to contain only style requirements?
Is there a guide to packaging for inclusion here that I've overlooked?

@etu
Copy link
Contributor

etu commented May 31, 2019

@ngerstle-cognite Well, the all-packages.nix is kinda required, otherwise it's not addressable as an attribute.

Also, if you look in CONTRIBUTING.md there's a link named "submit changes to nixpkgs" which goes to the manual: https://nixos.org/nixpkgs/manual/#chap-submitting-changes

The manual states (among other things): Make sure it's in pkgs/top-level/all-packages.nix

@ngerstle-cognite
Copy link
Contributor Author

Ah- missed that link. Thanks for guiding me through- I'll update my other PR (https://github.com/NixOS/nixpkgs/pull/61190/files) and keep the steps in mind going forward.

@etu
Copy link
Contributor

etu commented May 31, 2019

@GrahamcOfBorg build dapper

@etu
Copy link
Contributor

etu commented May 31, 2019

Reviewed points
  • package path fits guidelines
  • package name fits guidelines
  • package version fits guidelines
  • package build on x86_64-linux
  • executables tested on x86_64-linux
  • meta.description is set and fits guidelines
  • meta.license fits upstream license
  • meta.platforms is set
  • meta.maintainers is set
  • build time only dependencies are declared in nativeBuildInputs
  • source is fetched using the appropriate function
  • phases are respected
Possible improvements

The URL path syntax will probably go away soon, so one improvement could be to change meta.homepage to be a string. But this is for me a minor note since on deprecation it will probably result in a big treewide switch so one more place is not that bad.

But when I run the program with the flag --version it prints that the version is 0.0.0, I'm not sure where that comes from.

I'm guessing here, but it didn't help for me to add VERSION as build-flag or envoronment variable: https://github.com/rancher/dapper/blob/cdee59b8fa29579b357fc11cef9a597a1308f3bf/scripts/build

But I have not dug in deep to see where it's set.

@ngerstle-cognite
Copy link
Contributor Author

ngerstle-cognite commented May 31, 2019

version equaling 0.0.0 might be from https://github.com/rancher/dapper/blob/cdee59b8fa29579b357fc11cef9a597a1308f3bf/main.go#L13 as well, but I'm not that familiar with the https://github.com/urfave/cli library to be sure.

@etu
Copy link
Contributor

etu commented Jun 1, 2019

I tried to apply this diff that I made, and with that the version appears alright. I think we should do it this way, looks better:

diff --git a/pkgs/development/tools/dapper/default.nix b/pkgs/development/tools/dapper/default.nix
index 5d702cd5d71..e4b822253f2 100644
--- a/pkgs/development/tools/dapper/default.nix
+++ b/pkgs/development/tools/dapper/default.nix
@@ -17,6 +17,10 @@ buildGoPackage rec {
     sha256 = "03rmkmlvhmfwcln5v1rqww1kirxm0d1p58h6pj8f5fnhk9spb162";
   };
 
+  patchPhase = ''
+    substituteInPlace main.go --replace 0.0.0 ${version}
+  '';
+
   meta = with lib; {
     description = "Docker Build Wrapper";
     homepage = https://github.com/rancher/dapper;
@@ -25,4 +29,3 @@ buildGoPackage rec {
     maintainers = with maintainers; [ ngerstle ];
   };
 }
-

@ngerstle-cognite
Copy link
Contributor Author

@etu updated, thanks!

@etu
Copy link
Contributor

etu commented Jun 4, 2019

@ngerstle-cognite If you can squash it to two commits (one for creating you as mantainer in the maintainer list) and one for the package it would be great, then I'll merge this.

I can squash through the github ui, but that would squash it all to one commit which isn't best practice of what we want in this case.

@ngerstle-cognite
Copy link
Contributor Author

@etu @kuznero has volunteered as maintainer, so I've squashed everything down to a single commit.

@etu etu merged commit df3ec3a into NixOS:master Jun 5, 2019
@ngerstle-cognite ngerstle-cognite deleted the add-dapper branch June 5, 2019 10:38
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

3 participants