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

Zig template and std args #19346

Merged
merged 7 commits into from
Feb 21, 2025
Merged

Zig template and std args #19346

merged 7 commits into from
Feb 21, 2025

Conversation

botantony
Copy link
Contributor

@botantony botantony commented Feb 21, 2025

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

Standard args and a template for Zig project.

I am not sure what would be the best release mode, I think fast is the best option for Homebrew. I also wanted to explicitly include -fno-rosetta flag for macOS build but this code fails tests:

def std_zig_args(prefix: self.prefix, release_mode: "fast")
    args = "--prefix", prefix.to_s, "--release=#{release_mode}", "--summary", "all"
    args << "-fno-rosetta" if OS.mac?
    args
end

P.S.: on my machine tests fail on Homebrew::DevCmd::TapNew method but it failed even before these changes. Not sure how to fix it, hope it is not related.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Looks good so far, nice work!

@MikeMcQuaid
Copy link
Member

    args << "-fno-rosetta" if OS.mac?

Should this be Intel and/or ARM only?

Look at std_cmake_args in Library/Homebrew/formula.rb vs. Library/Homebrew/extend/os/mac/formula.rb. That should be able to help you make macOS-specific logic in that file.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Thanks so much for your contribution! Without people like you submitting PRs we couldn't run this project. You rock, @botantony!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Feb 21, 2025
Merged via the queue into Homebrew:master with commit db65772 Feb 21, 2025
30 checks passed
@botantony botantony deleted the zig-args branch February 21, 2025 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants