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

microplane: init at 0.0.25 #107861

Merged
merged 1 commit into from Dec 31, 2020
Merged

Conversation

dbirks
Copy link
Member

@dbirks dbirks commented Dec 29, 2020

Motivation for this change

Wanted to add microplane since I'm looking in to using it.

Some notes:

Using buildGoPackage instead of buildGoModile, as this project uses dep, so it looks like I need goDeps that buildGoPackage provides.

Using subPackages = ["."]; because I noticed a binary named demo was being built, and I just wanted the microplane binary.

I'm renaming the binary to mp because that's how the Makefile has it. And I had trouble giving -o $out/bin/mp as a Go build flag, since it would complain that the directory didn't exist, so I just opted to rename it afterwards.

There doesn't seem to be a -v flag or version subcommand 😕 , so I'm not sure how to confirm that the version is correct.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Comment on lines 28 to 29
-ldflags=
-X main.version=v${version}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
-ldflags=
-X main.version=v${version}
-ldflags="-s -w -X main.version=v${version}"

Copy link
Member Author

Choose a reason for hiding this comment

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

Super fast ⚡ thanks!

Just made the change.

Comment on lines 18 to 23
# Regenerate deps.nix with the following steps:
#
# git clone git@github.com:Clever/microplane.git
# cd microplane
# git checkout v<version>
# dep2nix

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# Regenerate deps.nix with the following steps:
#
# git clone git@github.com:Clever/microplane.git
# cd microplane
# git checkout v<version>
# dep2nix
# Regenerate deps.nix with the following commands:
# git clone https://github.com/Clever/microplane.git
# cd microplane
# git checkout v<version>
# dep2nix

'';

postInstall = ''
mv $out/bin/microplane $out/bin/mp
Copy link
Member

Choose a reason for hiding this comment

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

I am not a fan of putting a binary on every available two or three letter combination. The binary name is microplane and should stay like this. You can add such aliases to your .bashrc.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good to me 👍

I was trying to stay close to upstream, and all of their documentation and blog articles I've seen refer to the binary as mp, so that's something to take in to account, but I think giving it its full name microplane won't be confusing. It will also prevent any unnecessary name conflicts too.

Copy link
Member

Choose a reason for hiding this comment

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

If mp is such a recurring name in official documentations and tutorials, I suggest you create a symlink instead of moving. It will provide no surprises to new users.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, I did another quick check, and I can't find mention of upstream calling the binary by its full name.

And here's some new pieces of info that may help bring consensus...

Looks like the binary refers to itself as mp:

$ microplane 
Microplane makes git changes across many repos

Usage:
  mp [command]

Available Commands:
  clone       Clone all repos targeted by init
  docs        Generates markdown docs for each command
  help        Help about any command
  init        Initialize a microplane workflow
  merge       Merge pushed changes
  plan        Plan changes by running a command against cloned repos
  push        Push planned changes
  status      Status shows a workflow's progress

Flags:
  -h, --help          help for mp
  -r, --repo string   single repo to operate on

Use "mp [command] --help" for more information about a command.

And it looks like upstream calls the binary the shorter name in their releases:

mp-0.0.25-darwin-amd64
mp-0.0.25-linux-amd64

Copy link
Member

Choose a reason for hiding this comment

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

The symlink should suffice.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok just symlinked microplane to mp.

@SuperSandro2000
Copy link
Member

Result of nixpkgs-review pr 107861 run on x86_64-darwin 1

1 package built:
  • microplane

@SuperSandro2000
Copy link
Member

Result of nixpkgs-review pr 107861 run on x86_64-linux 1

1 package built:
  • microplane

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