From b9a6c3c0546395d3a86ff4d0c7ee5cf7449b2e90 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 17 Feb 2023 15:03:01 +0100 Subject: [PATCH 1/3] Make update: Add new style command line for Linux libraries It is not possible to know from the Buildbot which style to use when building patches. So use the new style as an alias. --- build_files/utils/make_update.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/build_files/utils/make_update.py b/build_files/utils/make_update.py index e093cde34e3..157587158fe 100755 --- a/build_files/utils/make_update.py +++ b/build_files/utils/make_update.py @@ -32,7 +32,14 @@ def parse_arguments(): parser.add_argument("--use-tests", action="store_true") parser.add_argument("--svn-command", default="svn") parser.add_argument("--git-command", default="git") + + # NOTE: Both old and new style command line flags, so that the Buildbot can use the new style. + # It is not possible to know from the Buildbot which style to use when building patches. + # + # Acts as an alias: `use_centos_libraries or use_linux_libraries`. parser.add_argument("--use-centos-libraries", action="store_true") + parser.add_argument("--use-linux-libraries", action="store_true") + return parser.parse_args() @@ -61,7 +68,7 @@ def svn_update(args, release_version): # this script is bundled as part of the precompiled libraries. However it # is used by the buildbot. lib_platform = "win64_vc15" - elif args.use_centos_libraries: + elif args.use_centos_libraries or args.use_linux_libraries: lib_platform = "linux_centos7_x86_64" else: # No precompiled libraries for Linux. -- 2.30.2 From 6af531d552b0988ccc14158277f47929c4a5f7dc Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 17 Feb 2023 13:42:15 +0100 Subject: [PATCH 2/3] Make update: Add --architecture command line attribute Possible values are x86_64 and arm64. Allows to use make_update.py in a cross-compile environment, like building x86_64 macOS Blender from Apple Silicon machine. Pull Request #104863 --- build_files/utils/make_update.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/build_files/utils/make_update.py b/build_files/utils/make_update.py index 157587158fe..9385280e7d1 100755 --- a/build_files/utils/make_update.py +++ b/build_files/utils/make_update.py @@ -40,6 +40,8 @@ def parse_arguments(): parser.add_argument("--use-centos-libraries", action="store_true") parser.add_argument("--use-linux-libraries", action="store_true") + parser.add_argument("--architecture", type=str, choices=("x86_64", "arm64",)) + return parser.parse_args() @@ -48,6 +50,16 @@ def get_blender_git_root(): # Setup for precompiled libraries and tests from svn. +def get_effective_architecture(args): + if args.architecture: + return args.architecture + + # Check platform.version to detect arm64 with x86_64 python binary. + if "ARM64" in platform.version(): + return "arm64" + + return platform.machine().lower() + def svn_update(args, release_version): svn_non_interactive = [args.svn_command, '--non-interactive'] @@ -56,11 +68,12 @@ def svn_update(args, release_version): svn_url = make_utils.svn_libraries_base_url(release_version) # Checkout precompiled libraries + architecture = get_effective_architecture(args) if sys.platform == 'darwin': - if platform.machine() == 'x86_64': - lib_platform = "darwin" - elif platform.machine() == 'arm64': + if architecture == 'arm64': lib_platform = "darwin_arm64" + elif architecture == 'x86_64': + lib_platform = "darwin" else: lib_platform = None elif sys.platform == 'win32': -- 2.30.2 From b5cf1c78a336231e86bf4bb776886176f0e3fd0b Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 17 Feb 2023 14:35:53 +0100 Subject: [PATCH 3/3] Make update: Allow amd64 architecture Apparently, the 64bit Intel architecture is presented differently on Linux and Windows. Allow both variants for the command line, so that semantically the command line argument can be seen as a lower case platform.machine. --- build_files/utils/make_update.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_files/utils/make_update.py b/build_files/utils/make_update.py index 9385280e7d1..0911bcca4d4 100755 --- a/build_files/utils/make_update.py +++ b/build_files/utils/make_update.py @@ -40,7 +40,7 @@ def parse_arguments(): parser.add_argument("--use-centos-libraries", action="store_true") parser.add_argument("--use-linux-libraries", action="store_true") - parser.add_argument("--architecture", type=str, choices=("x86_64", "arm64",)) + parser.add_argument("--architecture", type=str, choices=("x86_64", "amd64", "arm64",)) return parser.parse_args() -- 2.30.2