build-tools icon indicating copy to clipboard operation
build-tools copied to clipboard

Build fails immediately on macOS 12.4

Open mikehearn opened this issue 2 years ago • 4 comments

I tried to follow the instructions to build the latest stable release (17.4.10), but:

[475/40379] LINK ./flatc
FAILED: flatc
TOOL_VERSION=1657385378 ../../build/toolchain/apple/linker_driver.py -Wcrl,strippath,/Users/mike/.electron_build_tools/third_party/Xcode/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip ../../third_party/llvm-build/Release+Asserts/bin/clang++  -fuse-ld=lld -Wl,-fatal_warnings -Wl,--icf=all -Wl,--color-diagnostics -stdlib=libc++ -arch x86_64 -no-canonical-prefixes -Werror -Wl,-dead_strip -nostdlib++ -isysroot sdk/xcode_links/MacOSX11.1.sdk -mmacosx-version-min=10.11.0 -Wl,-ObjC -o "./flatc" "@./flatc.rsp"
env: python: No such file or directory
[674/40378] CXX obj/third_party/harfbuzz-ng/harfbuzz_source/hb-subset.o
ninja: build stopped: subcommand failed.
ERROR Error: Command failed: ninja -j 200 electron
    at checkExecSyncError (node:child_process:820:11)
    at Object.execFileSync (node:child_process:855:15)
    at Object.depotExecFileSync [as execFileSync] (/Users/mike/.electron_build_tools/src/utils/depot-tools.js:125:23)
    at runNinja (/Users/mike/.electron_build_tools/src/e-build.js:60:9)
    at Command.<anonymous> (/Users/mike/.electron_build_tools/src/e-build.js:121:7)
    at Command.listener [as _actionHandler] (/Users/mike/.electron_build_tools/node_modules/commander/lib/command.js:480:17)
    at /Users/mike/.electron_build_tools/node_modules/commander/lib/command.js:1234:65
    at Command._chainOrCall (/Users/mike/.electron_build_tools/node_modules/commander/lib/command.js:1151:12)
    at Command._parseCommand (/Users/mike/.electron_build_tools/node_modules/commander/lib/command.js:1234:27)

Indeed, on macOS there is no python (2) binary anymore. Only python3 exists, and, homebrew doesn't help, they also deleted it. The issue seems to be maybe Bazel/Blaze related?

mikehearn avatar Jul 09 '22 17:07 mikehearn

I followed the instructions here:

https://stackoverflow.com/a/67274521

and it gets further, but dies later (with a non python related error though, so it probably worked OK to fix this issue).

mikehearn avatar Jul 09 '22 18:07 mikehearn

We don't use Bazel or Blaze - we use Ninja with GN. We've updated some things recently - can you try again with latest electron master and latest build-tools?

codebytere avatar Aug 03 '22 10:08 codebytere

I was able to build Electron with master and latest build tools after using the workaround from StackOverflow to install a python2.

mikehearn avatar Aug 03 '22 15:08 mikehearn

Another workaround, since python is missing (or not what is expected, in my case): Adding script_executable = "vpython" to the end of src/.gn. Then it should use the version of python2.7 included within chrome code.

chase avatar Aug 08 '22 10:08 chase

Closing as this should have been addressed by Chromium's Python migration.

codebytere avatar May 03 '23 13:05 codebytere