-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
goredo 0.12.3 (new formula) #68846
goredo 0.12.3 (new formula) #68846
Conversation
Formula/goredo.rb
Outdated
class Goredo < Formula | ||
desc "Go implementation of djb's redo, a Makefile replacement that sucks less" | ||
homepage "http://www.goredo.cypherpunks.ru/" | ||
url "http://www.goredo.cypherpunks.ru/download/goredo-0.11.0.tar.zst" |
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.
Is there no tar.gz?
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.
Correct, only zstd http://www.goredo.cypherpunks.ru/Install.html
Used by default in Arch and Fedora IIUC
Formula/goredo.rb
Outdated
goredo_prefix = "goredo-#{version}" | ||
system "tar", "--use-compress-program", "unzstd", "-xvf", "#{goredo_prefix}.tar.zst" | ||
cd goredo_prefix do | ||
ENV["GOPATH"] = Pathname.pwd |
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.
This shouldn't be needed with modern Go programs AFAIK.
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.
It is when you distribute it with all its dependencies like Sergey has chosen to do.
No need to fetch dependencies from the Internet.
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.
So yes: the current plan is to deprecate GOPATH in Go 1.13 (scheduled for August 2019).
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.
TIL! With the help of the author Sergey, we've migrated to Go modules.
system "go", "build", *std_go_args, "go.cypherpunks.ru/goredo" | ||
end | ||
cd bin do | ||
system "./goredo", "-symlinks" |
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.
Does this mean there is a definition of what to symlink defined in bin?
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.
I'm not sure what you're are saying, it basically a dist helper function to create the various redo-* symlinks to the binary.
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.
Where does the definition about those symlinks live?
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.
I guess I could set them up explicitly manually in the package. Wdyt?
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.
I was expecting there to be some definition file. But if it's hardcoded I guess that's fine.
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.
So no changes required? I'm not sure what the next steps are. Do I mark the conversations are resolved? Not sure what to make of the "Resolve conversation" button.
Formula/goredo.rb
Outdated
end | ||
|
||
test do | ||
assert_match version.to_s, shell_output("#{bin}/redo-ifchange --version") |
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.
We need a test that exercises the some of the functionality of the app. Version checks or usage checks (foo --version or foo --help) are not sufficient, as explained in the formula cookbook.
In most cases, a good test would involve running a simple test case: run #{bin}/foo input.txt.
- Then you can check that the output is as expected (with assert_equal or assert_match on the output of shell_output)
- You can also check that an output file was created, if that is expected: assert_predicate testpath/"output.txt", :exist?
Some advice for specific cases:
- If the formula is a library, compile and run some simple code that links against it. It could be taken from upstream's documentation / source examples.
- If the formula is for a GUI program, try to find some function that runs as command-line only, like a format conversion, reading or displaying a config file, etc.
- If the software cannot function without credentials, a test could be to try to connect with invalid credentials (or without credentials) and confirm that it fails as expected.
- Same if the software requires a virtual machine, docker instance, etc. to be running.
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.
I added a test:
- redo command existence
- -no-progress -- tests that it is goredo implementation, having that option
- ability of .do file searching
- ability of .do file running with the working shell (if OS does not have /bin/sh, then it will fail, as an example)
Your
|
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.
Thanks for your first contribution to homebrew/core, @kaihendry! I hope it's the first of many.
brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew test <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingbrew install <formula>
)?