From 6cb3145d6cb84bfd80ea8f87c8012483e517f0ae 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 835e07d80b1..79663b83a98 100755 --- a/build_files/utils/make_update.py +++ b/build_files/utils/make_update.py @@ -36,7 +36,14 @@ def parse_arguments(): parser.add_argument("--svn-command", default="svn") parser.add_argument("--svn-branch", default=None) 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() @@ -66,7 +73,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 867bee6125b8eb59e612f00f03e338fd2fe73ae6 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 | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/build_files/utils/make_update.py b/build_files/utils/make_update.py index 79663b83a98..55a67a68f0c 100755 --- a/build_files/utils/make_update.py +++ b/build_files/utils/make_update.py @@ -44,6 +44,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() @@ -52,6 +54,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'] @@ -60,11 +72,11 @@ def svn_update(args, release_version): svn_url = make_utils.svn_libraries_base_url(release_version, args.svn_branch) # Checkout precompiled libraries + architecture = get_effective_architecture(args) if sys.platform == 'darwin': - # Check platform.version to detect arm64 with x86_64 python binary. - if platform.machine() == 'arm64' or ('ARM64' in platform.version()): + if architecture == 'arm64': lib_platform = "darwin_arm64" - elif platform.machine() == 'x86_64': + elif architecture == 'x86_64': lib_platform = "darwin" else: lib_platform = None -- 2.30.2 From d179864c5879ec666a56616f90c8081a23ff85ae 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 55a67a68f0c..787ff5ce1df 100755 --- a/build_files/utils/make_update.py +++ b/build_files/utils/make_update.py @@ -44,7 +44,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