From f0e848b3e095bb58cab8554ba547d3607ad0dc8f Mon Sep 17 00:00:00 2001 From: Cheng XU Date: Fri, 18 Oct 2019 15:30:24 +0800 Subject: [PATCH 1/3] fixtures: add testball bottle for ARM Also fix the absolute link used by testball_bottle-0.1.intel_macintosh.bottle.tar.gz --- .../bottles/testball_bottle-0.1.aarch64_linux.bottle.tar.gz | 1 + .../bottles/testball_bottle-0.1.armv6_linux.bottle.tar.gz | 1 + .../bottles/testball_bottle-0.1.armv7_linux.bottle.tar.gz | 1 + .../bottles/testball_bottle-0.1.intel_macintosh.bottle.tar.gz | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) create mode 120000 Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.aarch64_linux.bottle.tar.gz create mode 120000 Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.armv6_linux.bottle.tar.gz create mode 120000 Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.armv7_linux.bottle.tar.gz diff --git a/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.aarch64_linux.bottle.tar.gz b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.aarch64_linux.bottle.tar.gz new file mode 120000 index 0000000000..3e989830ba --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.aarch64_linux.bottle.tar.gz @@ -0,0 +1 @@ +testball_bottle-0.1.yosemite.bottle.tar.gz \ No newline at end of file diff --git a/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.armv6_linux.bottle.tar.gz b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.armv6_linux.bottle.tar.gz new file mode 120000 index 0000000000..3e989830ba --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.armv6_linux.bottle.tar.gz @@ -0,0 +1 @@ +testball_bottle-0.1.yosemite.bottle.tar.gz \ No newline at end of file diff --git a/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.armv7_linux.bottle.tar.gz b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.armv7_linux.bottle.tar.gz new file mode 120000 index 0000000000..3e989830ba --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.armv7_linux.bottle.tar.gz @@ -0,0 +1 @@ +testball_bottle-0.1.yosemite.bottle.tar.gz \ No newline at end of file diff --git a/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.intel_macintosh.bottle.tar.gz b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.intel_macintosh.bottle.tar.gz index 58afc4df06..3e989830ba 120000 --- a/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.intel_macintosh.bottle.tar.gz +++ b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.intel_macintosh.bottle.tar.gz @@ -1 +1 @@ -/usr/local/Homebrew/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.yosemite.bottle.tar.gz \ No newline at end of file +testball_bottle-0.1.yosemite.bottle.tar.gz \ No newline at end of file From c98b77fd3e4eb25142438255d151f52ceefd5146 Mon Sep 17 00:00:00 2001 From: Cheng XU Date: Fri, 18 Oct 2019 15:33:28 +0800 Subject: [PATCH 2/3] cpu_spec: fix for ARM --- Library/Homebrew/test/hardware/cpu_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/Library/Homebrew/test/hardware/cpu_spec.rb b/Library/Homebrew/test/hardware/cpu_spec.rb index 0a6f2101cc..035915d11a 100644 --- a/Library/Homebrew/test/hardware/cpu_spec.rb +++ b/Library/Homebrew/test/hardware/cpu_spec.rb @@ -21,6 +21,7 @@ describe Hardware::CPU do describe "::family" do let(:cpu_families) { [ + :arm, :arrandale, :atom, :broadwell, From 0db4287326d088a8dabc655bbf4adf6d2e13a204 Mon Sep 17 00:00:00 2001 From: Cheng XU Date: Fri, 18 Oct 2019 22:14:33 +0800 Subject: [PATCH 3/3] formula_info: use RUBY_PATH instead of calling HOMEBREW_BREW_FILE This ensures correct RUBY_PATH is used when running `brew tests` with custom `HOMEBREW_RUBY_PATH` More info: https://github.com/Homebrew/brew/pull/6617#discussion_r336431131 --- Library/Homebrew/formula_info.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/formula_info.rb b/Library/Homebrew/formula_info.rb index 42a81bf8a5..75013a40c1 100644 --- a/Library/Homebrew/formula_info.rb +++ b/Library/Homebrew/formula_info.rb @@ -13,7 +13,15 @@ class FormulaInfo # Looks up formula on disk and reads its info. # Returns nil if formula is absent or if there was an error reading it. def self.lookup(name) - json = Utils.popen_read(HOMEBREW_BREW_FILE, "info", "--json=v1", name) + json = Utils.popen_read( + RUBY_PATH, + "-W0", + "-I", $LOAD_PATH.join(File::PATH_SEPARATOR), + HOMEBREW_LIBRARY_PATH/"brew.rb", + "info", + "--json=v1", + name + ) return unless $CHILD_STATUS.success?