fix generate_projects.sh fails in M1 Mac (#31868)

* fix generate_projects.sh fails in m1 mac

* use buildozer-linux-arm64 for linux arm64 platform
pull/32007/head^2
Hannah Shi 2 years ago committed by GitHub
parent 8bd2b9af52
commit 2adab34f7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      tools/distrib/buildozer.sh
  2. 41
      tools/distrib/fix_build_deps.py

@ -30,11 +30,13 @@ function error_handling() {
}
function download_buildozer() {
platform="$(uname -s)"
platform="$(uname -sm)"
case "${platform}" in
Linux*) download_link="https://github.com/bazelbuild/buildtools/releases/download/${BUILDOZER_VERSION}/buildozer-linux-amd64";;
Darwin*) download_link="https://github.com/bazelbuild/buildtools/releases/download/${BUILDOZER_VERSION}/buildozer-darwin-amd64";;
*) error_handling "Unsupported platform: ${platform}";;
"Linux x86_64") download_link="https://github.com/bazelbuild/buildtools/releases/download/${BUILDOZER_VERSION}/buildozer-linux-amd64";;
"Linux aarch64") download_link="https://github.com/bazelbuild/buildtools/releases/download/${BUILDOZER_VERSION}/buildozer-linux-arm64";;
"Darwin x86_64") download_link="https://github.com/bazelbuild/buildtools/releases/download/${BUILDOZER_VERSION}/buildozer-darwin-amd64";;
"Darwin arm64") download_link="https://github.com/bazelbuild/buildtools/releases/download/${BUILDOZER_VERSION}/buildozer-darwin-arm64";;
*) error_handling "Unsupported platform: ${platform}";;
esac
download_success=0

@ -637,25 +637,26 @@ def make_library(library):
return (library, error, deps, external_deps)
update_libraries = []
for library in sorted(consumes.keys()):
if library in no_update:
continue
if args.targets and library not in args.targets:
continue
update_libraries.append(library)
with multiprocessing.Pool(processes=multiprocessing.cpu_count()) as p:
updated_libraries = p.map(make_library, update_libraries, 1)
error = False
for library, lib_error, deps, external_deps in updated_libraries:
if lib_error:
error = True
continue
buildozer_set_list('external_deps', external_deps, library, via='deps')
buildozer_set_list('deps', deps, library)
if __name__ == "__main__":
update_libraries = []
for library in sorted(consumes.keys()):
if library in no_update:
continue
if args.targets and library not in args.targets:
continue
update_libraries.append(library)
with multiprocessing.Pool(processes=multiprocessing.cpu_count()) as p:
updated_libraries = p.map(make_library, update_libraries, 1)
error = False
for library, lib_error, deps, external_deps in updated_libraries:
if lib_error:
error = True
continue
buildozer_set_list('external_deps', external_deps, library, via='deps')
buildozer_set_list('deps', deps, library)
run_buildozer.run_buildozer(buildozer_commands)
run_buildozer.run_buildozer(buildozer_commands)
if error:
sys.exit(1)
if error:
sys.exit(1)

Loading…
Cancel
Save