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

formula_creator: use tool-agnostic meson commands #14193

Merged
merged 1 commit into from Feb 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 3 additions & 5 deletions Library/Homebrew/formula_creator.rb
Expand Up @@ -168,11 +168,9 @@ def install
<% elsif mode == :go %>
system "go", "build", *std_go_args(ldflags: "-s -w")
<% elsif mode == :meson %>
mkdir "build" do
system "meson", *std_meson_args, ".."
system "ninja", "-v"
system "ninja", "install", "-v"
end
system "meson", "setup", "build", *std_meson_args
cho-m marked this conversation as resolved.
Show resolved Hide resolved
system "meson", "compile", "-C", "build", "--verbose"

Choose a reason for hiding this comment

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

Note that this will simply import approximately 190 python files amounting to 70k lines of code, check whether the setup was configured with an explicit --backend option and thus doesn't use the default ninja, and potentially run either one of:

  • ninja -v
  • xcodebuild

It adds no capabilities over ninja, but if you prefer it...

Copy link
Member Author

@cho-m cho-m Dec 8, 2022

Choose a reason for hiding this comment

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

Mainly matching current style preference in homebrew-core. Similar to CMake changes, though there is probably more overhead in Meson's Python code path than CMake's C/C++. I assume it isn't going to make a noticeable impact when actually run on CI. It leaves open the possibility of tweaking our std_meson_args backend (even if it is an unlikely change).

At least other repositories that also directly run commands in packages (e.g. Arch, Alpine) seem to favor running through Meson.

Repositories that use their own helper commands (e.g. Debian, Fedora) seem to directly run Ninja behind the scenes (e.g. Fedora's %meson_build being an alias for %ninja_build)

system "meson", "install", "-C", "build"
<% elsif mode == :node %>
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["\#{libexec}/bin/*"]
Expand Down