Skip to content

Commit

Permalink
Test build and print binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
PruStephan committed Aug 22, 2023
1 parent 78dcab1 commit 9fa01a6
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 15 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/build-bigsur-bottles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,5 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Build tezos-client
run: |
brew install --formula ./Formula/tezos-sapling-params.rb
brew install $(brew deps --include-build --formula "./Formula/tezos-client.rb")
brew install --formula --build-bottle "./Formula/tezos-client.rb"
- name: Build bottles and print dependencies
run: python3 scripts/print-bottles-deps.py
2 changes: 1 addition & 1 deletion Formula/tezos-accuser-PtMumbai.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class << self
depends_on dependency => :build
end

dependencies = %w[gmp hidapi libev libffi]
dependencies = %w[gmp hidapi libev]
dependencies.each do |dependency|
depends_on dependency
end
Expand Down
2 changes: 1 addition & 1 deletion Formula/tezos-accuser-PtNairob.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class << self
depends_on dependency => :build
end

dependencies = %w[gmp hidapi libev libffi]
dependencies = %w[gmp hidapi libev]
dependencies.each do |dependency|
depends_on dependency
end
Expand Down
2 changes: 1 addition & 1 deletion Formula/tezos-admin-client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class << self
depends_on dependency => :build
end

dependencies = %w[gmp hidapi libev libffi]
dependencies = %w[gmp hidapi libev]
dependencies.each do |dependency|
depends_on dependency
end
Expand Down
2 changes: 1 addition & 1 deletion Formula/tezos-baker-PtMumbai.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class << self
depends_on dependency => :build
end

dependencies = %w[gmp hidapi libev libffi tezos-sapling-params]
dependencies = %w[gmp hidapi libev tezos-sapling-params]
dependencies.each do |dependency|
depends_on dependency
end
Expand Down
2 changes: 1 addition & 1 deletion Formula/tezos-baker-PtNairob.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class << self
depends_on dependency => :build
end

dependencies = %w[gmp hidapi libev libffi tezos-sapling-params]
dependencies = %w[gmp hidapi libev tezos-sapling-params]
dependencies.each do |dependency|
depends_on dependency
end
Expand Down
2 changes: 1 addition & 1 deletion Formula/tezos-codec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class << self
depends_on dependency => :build
end

dependencies = %w[gmp hidapi libev libffi]
dependencies = %w[gmp hidapi libev]
dependencies.each do |dependency|
depends_on dependency
end
Expand Down
2 changes: 1 addition & 1 deletion Formula/tezos-node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class << self
depends_on dependency => :build
end

dependencies = %w[gmp hidapi libev libffi tezos-sapling-params]
dependencies = %w[gmp hidapi libev tezos-sapling-params]
dependencies.each do |dependency|
depends_on dependency
end
Expand Down
2 changes: 1 addition & 1 deletion Formula/tezos-signer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class << self
depends_on dependency => :build
end

dependencies = %w[gmp hidapi libev libffi]
dependencies = %w[gmp hidapi libev]
dependencies.each do |dependency|
depends_on dependency
end
Expand Down
2 changes: 1 addition & 1 deletion Formula/tezos-smart-rollup-client-PtMumbai.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class << self
depends_on dependency => :build
end

dependencies = %w[gmp hidapi libev libffi tezos-sapling-params]
dependencies = %w[gmp hidapi libev tezos-sapling-params]
dependencies.each do |dependency|
depends_on dependency
end
Expand Down
2 changes: 1 addition & 1 deletion Formula/tezos-smart-rollup-client-PtNairob.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class << self
depends_on dependency => :build
end

dependencies = %w[gmp hidapi libev libffi tezos-sapling-params]
dependencies = %w[gmp hidapi libev tezos-sapling-params]
dependencies.each do |dependency|
depends_on dependency
end
Expand Down
63 changes: 63 additions & 0 deletions scripts/print-bottles-deps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import subprocess
import sys

binaries = [
"tezos-client",
"tezos-admin-client",
"tezos-node",
"tezos-signer",
"tezos-codec",
# "tezos-baker-PtMumbai",
# "tezos-accuser-PtMumbai",
# "tezos-smart-rollup-client-PtMumbai",
# "tezos-smart-rollup-node-PtMumbai",
# "tezos-baker-PtNairob",
# "tezos-accuser-PtNairob",
# "tezos-smart-rollup-client-PtNairob",
# "tezos-smart-rollup-node-PtNairob",
]


def install():
installation_result = subprocess.run("brew install --formula ./Formula/tezos-sapling-params.rb", shell=True)
for binary in binaries:
try:
install_command_1 = f"brew install $(brew deps --include-build --formula \"./Formula/{binary}.rb\")"
installation_result = subprocess.run(install_command_1, shell=True)
assert installation_result.returncode == 0

install_command_2 = f"brew install --formula --build-bottle \"./Formula/{binary}.rb\""
installation_result = subprocess.run(install_command_2, shell=True)
assert installation_result.returncode == 0

check_binary_command = f"{binary.replace('tezos', 'octez')} --version"
check_binary_result = subprocess.run(check_binary_command, shell=True)
assert check_binary_result.returncode == 0
except Exception as e:
print(f"Exception happened when trying to execute tests for {binary}.\n")
raise e

def get_deps():
for binary in binaries:
echo_command = f"echo \"|-----------------------------------{binary}-----------------------------------|\""
subprocess.run(echo_command, shell=True)

otool_command = f"otool -L $(which {binary})"
otool_res = subprocess.run(otool_command, shell=True)
assert otool_res.returncode == 0

brew_command = f"brew deps {binary}"
brew_result = subprocess.run(brew_command, shell=True)
assert brew_result.returncode == 0

echo_command = f"echo \"|------------------------------------------------------------------------------|\""
subprocess.run(echo_command, shell=True)


if __name__ == "__main__":
install()
get_deps()

# brew install --formula ./Formula/tezos-sapling-params.rb
# brew install $(brew deps --include-build --formula "./Formula/tezos-client.rb")
# brew install --formula --build-bottle "./Formula/tezos-client.rb"

0 comments on commit 9fa01a6

Please sign in to comment.