zig 0.1.1 (new formula) - #23189
Conversation
There was a problem hiding this comment.
On a single line: mkdir "build" do
There was a problem hiding this comment.
Probably you can simply say: system "cmake", "..", *std_cmake_args which should take care of the paths for you
There was a problem hiding this comment.
I get Error: Empty installation when I use that.
There was a problem hiding this comment.
std_cmake_args contains:
-DCMAKE_C_FLAGS_RELEASE=-DNDEBUG
-DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG
-DCMAKE_INSTALL_PREFIX=#{prefix}
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_FIND_FRAMEWORK=LAST
-DCMAKE_VERBOSE_MAKEFILE=ON
-Wno-dev
But I do not understand what your CMAKE_PREFIX_PATH is pointing to. #{prefix} will expand to zig's own prefix (e.g. /usr/local/Cellar/zig/0.1.1), so why are you appending llvm@5 to that?
There was a problem hiding this comment.
Actually maybe I'm calling mkdir strangely, let me test a bit.
edit: I was. Was trying to call Dir.mkdir instead of mkdir.
There was a problem hiding this comment.
I was naively following zig's build instructions to see how everything worked. std_cmake_args works great though!
There was a problem hiding this comment.
We prefer the following syntax: (testpath/"hello.zip").write <<~EOS
There was a problem hiding this comment.
Can you check that the output from hello is as expected?
assert_equal "Hello, world!\n", shell_output("./hello")
There was a problem hiding this comment.
Yes, that's much better thanks.
There was a problem hiding this comment.
We'll prefer EOS to HEREDOC, for consistency with other formulas.
And can the empty lines in hello.zig be removed?
There was a problem hiding this comment.
|
Regarding |
|
Thanks for the reviews. I am curious as to whether |
|
also the test is still failing with just Failing with same error as |
|
That remaining audit failure we'll ignore, as it has a valid reason to use Homebrew LLVM. |
There was a problem hiding this comment.
zig links to LLVM's libc++ (/usr/local/opt/llvm/lib/libc++.1.dylib). So this dependency is necessary at runtime too. Remove the => :build.
There was a problem hiding this comment.
Done, thanks for sussing that out!
|
@fxcoudert thanks a lot for a painless contributor experience and for the prompt reviews! I'll look forward to seeing this land. I'll do some research around what fleshing out this formula might look like (see associated |
|
hi @jfo why did you close this? |
|
@fxcoudert sorry, I was pushing https://github.com/jfo/homebrew-core/commit/35218e954e19d44d2b6b35f8d221dc15a64425ad from a local branch and typed |
|
I pushed my changes back to my fork's master but github is confused now. edit: looks like reopening it triggered a recheck, sorry for the noise!! :) |
There was a problem hiding this comment.
let's make this an in-tree build
There was a problem hiding this comment.
do you mean
diff --git a/Formula/zig.rb b/Formula/zig.rb
index 42ce4f54..758d9617 100644
--- a/Formula/zig.rb
+++ b/Formula/zig.rb
@@ -8,10 +8,8 @@ class Zig < Formula
depends_on "llvm"
def install
- mkdir "build" do
- system "cmake", "..", *std_cmake_args
- system "make", "install"
- end
+ system "cmake", ".", *std_cmake_args
+ system "make", "install"
end
test do|
@jfo thanks for your contribution to Homebrew! |
|
@BrewTestBot test this please |
|
@jfo sorry, somehow the |
|
And… finally, it's in! Thanks again @jfo |
|
🙌 thank you! Super great and much appreciated. |
HI! Thanks for
brew.I'd like to add zig's 0.1.1 release to brew. I do need feedback on a dependency issue, though.
brew install --build-from-source <formula>, where<formula>is the name of the formula you're submitting?brew audit --strict <formula>(after doingbrew install <formula>)?See: ziglang/zig#714 (comment)
Please lmkwyt! Thank you.
This PR resolves ziglang/zig#714