Error running `e build` on macOS: Input to targets not generated by a dependency
I'm looking for some advice on building electron from source.
I'm running the following steps on a macOS arm64 (apple silicon) host on macOS 15.1. I have Xcode 16.1 installed.
-
npm i -g @electron/[email protected] -
e init mybuilder --import release --reclient none --target-cpu x64- This outputs:
WARN Automatically detected an unknown macOS SDK null - falling back to default of 15.0 INFO Now using SDK version 15.0
- This outputs:
-
e sync --revision v33.0.2 -
e load-macos-sdk- This outputs
INFO Now using SDK version 14.0
- This outputs
-
e build
The final e build step fails with this error:
INFO Building electron with remote execution disabled
Running "/Users/USER/.electron_build_tools/third_party/depot_tools/gn gen out/Release" in /Users/USER/Desktop/actions-runner/_work/custom-electron-builder/custom-electron-builder/electron/src
ERROR Input to targets not generated by a dependency.
The file:
//out/Release/xcode_links/electron/MacOSX14.0.sdk/usr/include/mach/exc.defs
is listed as an input or source for the targets:
//third_party/crashpad/crashpad/util:mig(//build/toolchain/mac:clang_x64)
//third_party/crashpad/crashpad/util:mig(//build/toolchain/mac:clang_arm64_v8_x64)
//third_party/crashpad/crashpad/util:mig(//build/toolchain/mac:clang_arm64)
but no targets in the build generate that file.
ERROR Input to targets not generated by a dependency.
The file:
//out/Release/xcode_links/electron/MacOSX14.0.sdk/usr/include/mach/mach_exc.defs
is listed as an input or source for the targets:
//third_party/crashpad/crashpad/util:mig(//build/toolchain/mac:clang_x64)
//third_party/crashpad/crashpad/util:mig(//build/toolchain/mac:clang_arm64_v8_x64)
//third_party/crashpad/crashpad/util:mig(//build/toolchain/mac:clang_arm64)
but no targets in the build generate that file.
ERROR Input to targets not generated by a dependency.
The file:
//out/Release/xcode_links/electron/MacOSX14.0.sdk/usr/include/mach/notify.defs
is listed as an input or source for the targets:
//third_party/crashpad/crashpad/util:mig(//build/toolchain/mac:clang_x64)
//third_party/crashpad/crashpad/util:mig(//build/toolchain/mac:clang_arm64_v8_x64)
//third_party/crashpad/crashpad/util:mig(//build/toolchain/mac:clang_arm64)
but no targets in the build generate that file.
If you have generated inputs, there needs to be a dependency path between the
two targets in addition to just listing the files. For indirect dependencies,
the intermediate ones must be public_deps. data_deps don't count since they're
only runtime dependencies. If you think a dependency chain exists, it might be
because the chain is private. Try "gn path" to analyze.
3 generated input errors found.
ERROR Error: Command failed: /Users/USER/.electron_build_tools/third_party/depot_tools/gn gen out/Release
at checkExecSyncError (node:child_process:890:11)
at Object.execFileSync (node:child_process:926:15)
at Object.depotExecFileSync [as execFileSync] (/Users/USER/.electron_build_tools/src/utils/depot-tools.js:147:23)
at runGNGen (/Users/USER/.electron_build_tools/src/e-build.js:42:9)
at ensureGNGen (/Users/USER/.electron_build_tools/src/e-build.js:47:41)
at runNinja (/Users/USER/.electron_build_tools/src/e-build.js:70:3)
at Command.<anonymous> (/Users/USER/.electron_build_tools/src/e-build.js:112:7)
at Command.listener [as _actionHandler] (/Users/USER/.electron_build_tools/node_modules/commander/lib/command.js:480:17)
at /Users/USER/.electron_build_tools/node_modules/commander/lib/command.js:1234:65
Any advice would be appreciated. Thanks!
hey @jtbandes - we've adjusted that logic a fair amount lately so there's definitely a bug or two at play here. I'll take a look - this bug should be on build-tools though so I'm going to transfer it there.
Any tips for if there's a quick workaround on this before it gets fixed upstream?
Actually it seems like running e build a second time works as a workaround 😄
@jtbandes thank for your workaround
The workaround doesn't work for me...on the 2nd e build run I also get the exactly same error as in the issue description, even if I pin the build-tools version as here. How do you solve this in your Electron pipelines @codebytere?
@codebytere sorry for pinging again but maybe you have other workarounds in mind or a particular electron version i can build now with this issue?
@nikitakot are you building with reclient?
Isn't reclient just a cache? Why would it cause or fix errors like this?
Does this still happen?
I tried again with v39.1.0 and no longer seeing this error.
Since the caching behavior has changed I don't really know how to verify for sure that it works all the time, or if i just got lucky with a cache hit.
We ended up working around this by doing an xcode select prior to running e sync / e build.
For anyone interested, here is my complete/working build script: https://gist.github.com/jtbandes/677df14872fbff5d2e7d01f53ccc455c