Closed nornagon closed 6 years ago
Would it be possible to skip those patches in the gn build as opposed to introducing a new flag ? If its more work then I am fine with this approach.
Ah, interesting thought! I'll give it a shot.
I looked into selectively applying the build_gn patch only in the non-GN build, and I think it's simpler to do it the way that's already in this PR. Doing the selective application would mean:
.patches.yaml
, e.g. skip_in_gn_build: true
lib/patches.py
PatchesList#apply
to filter out the skip_in_gn_build
patchesapply-patches
script to select whether to filter out those patchesIt's possible, but it adds a nontrivial amount of complexity to the patching system, which is at present delightfully simple. Further, when we eventually switch to GN-build-only, all that complexity would become useless.
One possible reason to go ahead with the filtering option would be if we wanted to shift our MAS and mipsel patches over to such a system. But I don't see any particular reason to do so; the current system is working fine for those. The difference with this particular case is that it would be default-on, triggered-off, rather than the MAS/mipsel patches which are default-off, and only applied in certain conditions.
When building Electron with GN in release mode, all code is linked statically into a single binary, including node & v8. This is in contrast to the GYP build, in which node, v8 and icu are linked as a shared library (due to openssl symbol conflicts).
This change adds a
is_electron_gn_build
flag which defaults to false, allowing those libraries to be built statically in the GN build, but be built as a shared library when libcc is to be consumed by the GYP build of Electron.