build: remove gyp build files (#14097)
* build: remove gyp build files * docs: update build instructions * build: temporary restore electron.gyp * build: do not update Electron version in the electron.gyp * chore: remove unused submodules * ci: remove obsolete CI scripts and configs * chore: remove obsolete scripts * chore: remove obsolete functions from lib/util.py * ci: send Slack notification for nightly build results
This commit is contained in:
parent
98eee52fac
commit
72526927d9
56 changed files with 919 additions and 6043 deletions
|
@ -1,9 +1,6 @@
|
|||
# Build Instructions (experimental GN build)
|
||||
# Build Instructions
|
||||
|
||||
Follow the guidelines below for building Electron with the experimental GN
|
||||
build.
|
||||
|
||||
> **NOTE**: The GN build system is in _experimental_ status.
|
||||
Follow the guidelines below for building Electron.
|
||||
|
||||
## Platform prerequisites
|
||||
|
||||
|
@ -65,6 +62,46 @@ $ gclient sync --with_branch_heads --with_tags
|
|||
# This will take a while, go get a coffee.
|
||||
```
|
||||
|
||||
### Chromium git cache
|
||||
|
||||
`depot_tools` has an option that allows the developer to set a global cache for
|
||||
all git objects of Chromium + dependencies. This option uses `git clone
|
||||
--shared` to save bandwidth/space on multiple clones of the same repositories.
|
||||
|
||||
If you intend to have several Electron build trees on the same machine (to work
|
||||
on different versions of Electron for example), it is recommended to set use
|
||||
the git cache to speed up the download of Chromium source. For example:
|
||||
|
||||
```sh
|
||||
$ mkdir ~/.chromium-git-cache
|
||||
$ gclient config \
|
||||
--name "src/electron" \
|
||||
--unmanaged \
|
||||
--cache_dir="$HOME/.chromium-git-cache" \
|
||||
https://github.com/electron/electron
|
||||
$ gclient sync --with_branch_heads --with_tags
|
||||
```
|
||||
|
||||
If the bootstrap script is interrupted while using the git cache, it will leave
|
||||
the cache locked. To remove the lock, pass the `--break_repo_locks` argument to
|
||||
`gclient sync`.
|
||||
|
||||
#### Sharing the cache between multiple machines
|
||||
|
||||
It is possible to share this directory with other machines by exporting it as
|
||||
SMB share on linux, but only one process/machine can be using the cache at a
|
||||
time. The locks created by git-cache script will try to prevent this, but it may
|
||||
not work perfectly in a network.
|
||||
|
||||
On Windows, SMBv2 has a directory cache that will cause problems with the git
|
||||
cache script, so it is necessary to disable it by setting the registry key
|
||||
|
||||
```sh
|
||||
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Lanmanworkstation\Parameters\DirectoryCacheLifetime
|
||||
```
|
||||
|
||||
to 0. More information: https://stackoverflow.com/a/9935126
|
||||
|
||||
## Building
|
||||
|
||||
```sh
|
||||
|
|
|
@ -58,40 +58,6 @@ $ sudo dnf install clang dbus-devel gtk3-devel libnotify-devel \
|
|||
Other distributions may offer similar packages for installation via package
|
||||
managers such as pacman. Or one can compile from source code.
|
||||
|
||||
## Getting the Code
|
||||
|
||||
```sh
|
||||
$ git clone https://github.com/electron/electron
|
||||
```
|
||||
|
||||
## Bootstrapping
|
||||
|
||||
The bootstrap script will download all necessary build dependencies and create
|
||||
the build project files. You must have Python 2.7.x for the script to succeed.
|
||||
Downloading certain files can take a long time. Notice that we are using
|
||||
`ninja` to build Electron so there is no `Makefile` generated.
|
||||
|
||||
To bootstrap for a static, non-developer build, run:
|
||||
|
||||
```sh
|
||||
$ cd electron
|
||||
$ npm run bootstrap
|
||||
```
|
||||
|
||||
Or to bootstrap for a development session that builds faster by not statically linking:
|
||||
|
||||
```sh
|
||||
$ cd electron
|
||||
$ npm run bootstrap:dev
|
||||
```
|
||||
|
||||
If you are using editor supports [JSON compilation database](http://clang.llvm.org/docs/JSONCompilationDatabase.html) based
|
||||
language server, you can generate it:
|
||||
|
||||
```sh
|
||||
$ ./script/build.py --compdb
|
||||
```
|
||||
|
||||
### Cross compilation
|
||||
|
||||
If you want to build for an `arm` target you should also install the following
|
||||
|
@ -110,60 +76,15 @@ $ sudo apt-get install libc6-dev-arm64-cross linux-libc-dev-arm64-cross \
|
|||
```
|
||||
|
||||
And to cross-compile for `arm` or `ia32` targets, you should pass the
|
||||
`--target_arch` parameter to the `bootstrap.py` script:
|
||||
`target_cpu` parameter to `gn gen`:
|
||||
|
||||
```sh
|
||||
$ ./script/bootstrap.py -v --target_arch=arm
|
||||
$ gn gen out/Debug --args='import(...) target_cpu="arm"'
|
||||
```
|
||||
|
||||
## Building
|
||||
|
||||
If you would like to build both `Release` and `Debug` targets:
|
||||
|
||||
```sh
|
||||
$ npm run build
|
||||
```
|
||||
|
||||
This script will cause a very large Electron executable to be placed in
|
||||
the directory `out/R`. The file size is in excess of 1.3 gigabytes. This
|
||||
happens because the Release target binary contains debugging symbols.
|
||||
To reduce the file size, run the `create-dist.py` script:
|
||||
|
||||
```sh
|
||||
$ ./script/create-dist.py
|
||||
```
|
||||
|
||||
This will put a working distribution with much smaller file sizes in
|
||||
the `dist` directory. After running the `create-dist.py` script, you
|
||||
may want to remove the 1.3+ gigabyte binary which is still in `out/R`.
|
||||
|
||||
You can also build either the `Debug` or `Release` target on its own:
|
||||
|
||||
```sh
|
||||
$ npm run build:dev
|
||||
```
|
||||
|
||||
```sh
|
||||
$ npm run build:release
|
||||
```
|
||||
|
||||
After building is done, you can find the `electron` debug binary under `out/D`.
|
||||
|
||||
## Cleaning
|
||||
|
||||
To clean the build files:
|
||||
|
||||
```sh
|
||||
$ npm run clean
|
||||
```
|
||||
|
||||
To clean only `out` and `dist` directories:
|
||||
|
||||
```sh
|
||||
$ npm run clean-build
|
||||
```
|
||||
|
||||
**Note:** Both clean commands require running `bootstrap` again before building.
|
||||
See [Build Instructions: GN](build-instructions-gn.md)
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
|
@ -176,87 +97,26 @@ architecture, symlink to appropriate `libncurses`:
|
|||
$ sudo ln -s /usr/lib/libncurses.so.5 /usr/lib/libtinfo.so.5
|
||||
```
|
||||
|
||||
## Tests
|
||||
|
||||
See [Build System Overview: Tests](build-system-overview.md#tests)
|
||||
|
||||
## Advanced topics
|
||||
|
||||
The default building configuration is targeted for major desktop Linux
|
||||
distributions. To build for a specific distribution or device, the following
|
||||
information may help you.
|
||||
|
||||
### Building `libchromiumcontent` locally
|
||||
|
||||
To avoid using the prebuilt binaries of `libchromiumcontent`, you can build `libchromiumcontent` locally. To do so, follow these steps:
|
||||
|
||||
1. Install [depot_tools](https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_instructions.md#Install)
|
||||
2. Install [additional build dependencies](https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_instructions.md#Install-additional-build-dependencies)
|
||||
3. Fetch the git submodules:
|
||||
|
||||
```sh
|
||||
$ git submodule update --init --recursive
|
||||
```
|
||||
4. Pass the `--build_release_libcc` switch to `bootstrap.py` script:
|
||||
|
||||
```sh
|
||||
$ ./script/bootstrap.py -v --build_release_libcc
|
||||
```
|
||||
|
||||
Note that by default the `shared_library` configuration is not built, so you can
|
||||
only build `Release` version of Electron if you use this mode:
|
||||
|
||||
```sh
|
||||
$ ./script/build.py -c R
|
||||
```
|
||||
|
||||
### Using system `clang` instead of downloaded `clang` binaries
|
||||
|
||||
By default Electron is built with prebuilt
|
||||
[`clang`](https://clang.llvm.org/get_started.html) binaries provided by the
|
||||
Chromium project. If for some reason you want to build with the `clang`
|
||||
installed in your system, you can call `bootstrap.py` with `--clang_dir=<path>`
|
||||
switch. By passing it the build script will assume the `clang` binaries reside
|
||||
in `<path>/bin/`.
|
||||
installed in your system, you can specify the `clang_base_path` argument in the
|
||||
GN args.
|
||||
|
||||
For example if you installed `clang` under `/user/local/bin/clang`:
|
||||
For example if you installed `clang` under `/usr/local/bin/clang`:
|
||||
|
||||
```sh
|
||||
$ ./script/bootstrap.py -v --build_release_libcc --clang_dir /usr/local
|
||||
$ ./script/build.py -c R
|
||||
$ gn gen out/Debug --args='import("//electron/build/args/debug.gn") clang_base_path = "/usr/local/bin"'
|
||||
```
|
||||
|
||||
### Using compilers other than `clang`
|
||||
|
||||
To build Electron with compilers like `g++`, you first need to disable `clang`
|
||||
with `--disable_clang` switch first, and then set `CC` and `CXX` environment
|
||||
variables to the ones you want.
|
||||
|
||||
For example building with GCC toolchain:
|
||||
|
||||
```sh
|
||||
$ env CC=gcc CXX=g++ ./script/bootstrap.py -v --build_release_libcc --disable_clang
|
||||
$ ./script/build.py -c R
|
||||
```
|
||||
|
||||
### Environment variables
|
||||
|
||||
Apart from `CC` and `CXX`, you can also set the following environment variables to
|
||||
customise the build configuration:
|
||||
|
||||
* `CPPFLAGS`
|
||||
* `CPPFLAGS_host`
|
||||
* `CFLAGS`
|
||||
* `CFLAGS_host`
|
||||
* `CXXFLAGS`
|
||||
* `CXXFLAGS_host`
|
||||
* `AR`
|
||||
* `AR_host`
|
||||
* `CC`
|
||||
* `CC_host`
|
||||
* `CXX`
|
||||
* `CXX_host`
|
||||
* `LDFLAGS`
|
||||
|
||||
The environment variables have to be set when executing the `bootstrap.py`
|
||||
script, it won't work in the `build.py` script.
|
||||
Building Electron with compilers other than `clang` is not supported.
|
||||
|
|
|
@ -57,80 +57,6 @@ You will also need to enable Xcode to build against the 10.10 SDK:
|
|||
- Set the `MinimumSDKVersion` to `10.10`
|
||||
- Save the file
|
||||
|
||||
## Getting the Code
|
||||
## Building Electron
|
||||
|
||||
```sh
|
||||
$ git clone https://github.com/electron/electron
|
||||
```
|
||||
|
||||
## Bootstrapping
|
||||
|
||||
The bootstrap script will download all necessary build dependencies and create
|
||||
the build project files. Notice that we're using [ninja](https://ninja-build.org/)
|
||||
to build Electron so there is no Xcode project generated.
|
||||
|
||||
To bootstrap for a static, non-developer build, run:
|
||||
|
||||
```sh
|
||||
$ cd electron
|
||||
$ npm run bootstrap
|
||||
```
|
||||
|
||||
Or to bootstrap for a development session that builds faster by not statically linking:
|
||||
|
||||
```sh
|
||||
$ cd electron
|
||||
$ npm run bootstrap:dev
|
||||
```
|
||||
|
||||
If you are using editor supports [JSON compilation database](http://clang.llvm.org/docs/JSONCompilationDatabase.html) based
|
||||
language server, you can generate it:
|
||||
|
||||
```sh
|
||||
$ ./script/build.py --compdb
|
||||
```
|
||||
|
||||
## Building
|
||||
|
||||
To build both `Release` and `Debug` targets:
|
||||
|
||||
```sh
|
||||
$ npm run build
|
||||
```
|
||||
|
||||
You can also build either the `Debug` or `Release` target on its own:
|
||||
|
||||
```sh
|
||||
$ npm run build:dev
|
||||
```
|
||||
|
||||
```sh
|
||||
$ npm run build:release
|
||||
```
|
||||
|
||||
After building is done, you can find `Electron.app` under `out/D`.
|
||||
|
||||
## 32bit Support
|
||||
|
||||
Electron can only be built for a 64bit target on macOS and there is no plan to
|
||||
support 32bit macOS in the future.
|
||||
|
||||
## Cleaning
|
||||
|
||||
To clean the build files:
|
||||
|
||||
```sh
|
||||
$ npm run clean
|
||||
```
|
||||
|
||||
To clean only `out` and `dist` directories:
|
||||
|
||||
```sh
|
||||
$ npm run clean-build
|
||||
```
|
||||
|
||||
**Note:** Both clean commands require running `bootstrap` again before building.
|
||||
|
||||
## Tests
|
||||
|
||||
See [Build System Overview: Tests](build-system-overview.md#tests)
|
||||
See [Build Instructions: GN](build-instructions-gn.md).
|
|
@ -25,52 +25,9 @@ building with Visual Studio will come in the future.
|
|||
**Note:** Even though Visual Studio is not used for building, it's still
|
||||
**required** because we need the build toolchains it provides.
|
||||
|
||||
## Getting the Code
|
||||
|
||||
```powershell
|
||||
$ git clone https://github.com/electron/electron.git
|
||||
```
|
||||
|
||||
## Bootstrapping
|
||||
|
||||
The bootstrap script will download all necessary build dependencies and create
|
||||
the build project files. Notice that we're using `ninja` to build Electron so
|
||||
there is no Visual Studio project generated.
|
||||
|
||||
To bootstrap for a static, non-developer build, run:
|
||||
|
||||
```powershell
|
||||
$ cd electron
|
||||
$ npm run bootstrap
|
||||
```
|
||||
|
||||
Or to bootstrap for a development session that builds faster by not statically linking:
|
||||
|
||||
```powershell
|
||||
$ cd electron
|
||||
$ npm run bootstrap:dev
|
||||
```
|
||||
|
||||
## Building
|
||||
|
||||
Build both `Release` and `Debug` targets:
|
||||
|
||||
```powershell
|
||||
$ npm run build
|
||||
```
|
||||
|
||||
You can also build either the `Debug` or `Release` target on its own:
|
||||
|
||||
```powershell
|
||||
$ npm run build:dev
|
||||
```
|
||||
|
||||
```powershell
|
||||
$ npm run build:release
|
||||
```
|
||||
|
||||
After building is done, you can find `electron.exe` under `out\D` (debug
|
||||
target) or under `out\R` (release target).
|
||||
See [Build Instructions: GN](build-instructions-gn.md)
|
||||
|
||||
## 32bit Build
|
||||
|
||||
|
@ -85,32 +42,13 @@ The other building steps are exactly the same.
|
|||
|
||||
## Visual Studio project
|
||||
|
||||
To generate a Visual Studio project, you can pass the `--msvs` parameter:
|
||||
To generate a Visual Studio project, you can pass the `--ide=vs2017` parameter
|
||||
to `gn gen`:
|
||||
|
||||
```powershell
|
||||
$ python script\bootstrap.py --msvs
|
||||
$ gn gen out/Debug --ide=vs2017
|
||||
```
|
||||
|
||||
## Cleaning
|
||||
|
||||
To clean the build files:
|
||||
|
||||
```powershell
|
||||
$ npm run clean
|
||||
```
|
||||
|
||||
To clean only `out` and `dist` directories:
|
||||
|
||||
```sh
|
||||
$ npm run clean-build
|
||||
```
|
||||
|
||||
**Note:** Both clean commands require running `bootstrap` again before building.
|
||||
|
||||
## Tests
|
||||
|
||||
See [Build System Overview: Tests](build-system-overview.md#tests)
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Command xxxx not found
|
||||
|
@ -122,34 +60,6 @@ the `VS2015 Command Prompt` console to execute the build scripts.
|
|||
|
||||
Make sure you have the latest Visual Studio update installed.
|
||||
|
||||
### Assertion failed: ((handle))->activecnt >= 0
|
||||
|
||||
If building under Cygwin, you may see `bootstrap.py` failed with following
|
||||
error:
|
||||
|
||||
```sh
|
||||
Assertion failed: ((handle))->activecnt >= 0, file src\win\pipe.c, line 1430
|
||||
|
||||
Traceback (most recent call last):
|
||||
File "script/bootstrap.py", line 87, in <module>
|
||||
sys.exit(main())
|
||||
File "script/bootstrap.py", line 22, in main
|
||||
update_node_modules('.')
|
||||
File "script/bootstrap.py", line 56, in update_node_modules
|
||||
execute([NPM, 'install'])
|
||||
File "/home/zcbenz/codes/raven/script/lib/util.py", line 118, in execute
|
||||
raise e
|
||||
subprocess.CalledProcessError: Command '['npm.cmd', 'install']' returned non-zero exit status 3
|
||||
```
|
||||
|
||||
This is caused by a bug when using Cygwin Python and Win32 Node together. The
|
||||
solution is to use the Win32 Python to execute the bootstrap script (assuming
|
||||
you have installed Python under `C:\Python27`):
|
||||
|
||||
```powershell
|
||||
$ /cygdrive/c/Python27/python.exe script/bootstrap.py
|
||||
```
|
||||
|
||||
### LNK1181: cannot open input file 'kernel32.lib'
|
||||
|
||||
Try reinstalling 32bit Node.js.
|
||||
|
|
|
@ -1,20 +1,18 @@
|
|||
# Build System Overview
|
||||
|
||||
Electron uses [gyp](https://gyp.gsrc.io/) for project generation and
|
||||
Electron uses [GN](https://gn.googlesource.com/gn) for project generation and
|
||||
[ninja](https://ninja-build.org/) for building. Project configurations can
|
||||
be found in the `.gyp` and `.gypi` files.
|
||||
be found in the `.gn` and `.gni` files.
|
||||
|
||||
## Gyp Files
|
||||
## GN Files
|
||||
|
||||
Following `gyp` files contain the main rules for building Electron:
|
||||
The following `gn` files contain the main rules for building Electron:
|
||||
|
||||
* `electron.gyp` defines how Electron itself is built.
|
||||
* `common.gypi` adjusts the build configurations of Node to make it build
|
||||
together with Chromium.
|
||||
* `brightray/brightray.gyp` defines how `brightray` is built and
|
||||
* `BUILD.gn` defines how Electron itself is built.
|
||||
* `brightray/BUILD.gn` defines how `brightray` is built and
|
||||
includes the default configurations for linking with Chromium.
|
||||
* `brightray/brightray.gypi` includes general build configurations about
|
||||
building.
|
||||
* `build/args/{debug,release,all}.gn` contain the default build arguments for
|
||||
building Electron.
|
||||
|
||||
## Component Build
|
||||
|
||||
|
@ -24,56 +22,17 @@ this, Chromium introduced the "component build", which builds each component as
|
|||
a separate shared library, making linking very quick but sacrificing file size
|
||||
and performance.
|
||||
|
||||
In Electron we took a very similar approach: for `Debug` builds, the binary
|
||||
will be linked to a shared library version of Chromium's components to achieve
|
||||
fast linking time; for `Release` builds, the binary will be linked to the static
|
||||
library versions, so we can have the best possible binary size and performance.
|
||||
|
||||
## Minimal Bootstrapping
|
||||
|
||||
All of Chromium's prebuilt binaries (`libchromiumcontent`) are downloaded when
|
||||
running the bootstrap script. By default both static libraries and shared
|
||||
libraries will be downloaded and the final size should be between 800MB and 2GB
|
||||
depending on the platform.
|
||||
|
||||
By default, `libchromiumcontent` is downloaded from Amazon Web Services.
|
||||
If the `LIBCHROMIUMCONTENT_MIRROR` environment variable is set, the bootstrap
|
||||
script will download from it.
|
||||
[`libchromiumcontent-qiniu-mirror`](https://github.com/hokein/libchromiumcontent-qiniu-mirror)
|
||||
is a mirror for `libchromiumcontent`. If you have trouble in accessing AWS, you
|
||||
can switch the download address to it via
|
||||
`export LIBCHROMIUMCONTENT_MIRROR=http://7xk3d2.dl1.z0.glb.clouddn.com/`
|
||||
|
||||
If you only want to build Electron quickly for testing or development, you
|
||||
can download the shared library versions by passing the `--dev` parameter:
|
||||
|
||||
```sh
|
||||
$ ./script/bootstrap.py --dev
|
||||
$ ./script/build.py -c D
|
||||
```
|
||||
|
||||
## Two-Phase Project Generation
|
||||
|
||||
Electron links with different sets of libraries in `Release` and `Debug`
|
||||
builds. `gyp`, however, doesn't support configuring different link settings for
|
||||
different configurations.
|
||||
|
||||
To work around this Electron uses a `gyp` variable
|
||||
`libchromiumcontent_component` to control which link settings to use and only
|
||||
generates one target when running `gyp`.
|
||||
|
||||
## Target Names
|
||||
|
||||
Unlike most projects that use `Release` and `Debug` as target names, Electron
|
||||
uses `R` and `D` instead. This is because `gyp` randomly crashes if there is
|
||||
only one `Release` or `Debug` build configuration defined, and Electron only has
|
||||
to generate one target at a time as stated above.
|
||||
|
||||
This only affects developers, if you are building Electron for rebranding
|
||||
you are not affected.
|
||||
Electron inherits this build option from Chromium. In `Debug` builds, the
|
||||
binary will be linked to a shared library version of Chromium's components to
|
||||
achieve fast linking time; for `Release` builds, the binary will be linked to
|
||||
the static library versions, so we can have the best possible binary size and
|
||||
performance.
|
||||
|
||||
## Tests
|
||||
|
||||
**NB** _this section is out of date and contains information that is no longer
|
||||
relevant to the GN-built electron._
|
||||
|
||||
Test your changes conform to the project coding style using:
|
||||
|
||||
```sh
|
||||
|
|
|
@ -12,76 +12,3 @@
|
|||
- [Discussion Groups](http://www.chromium.org/developers/discussion-groups)
|
||||
|
||||
See also [V8 Development](v8-development.md)
|
||||
|
||||
# Chromium development with Electron
|
||||
|
||||
It is possible to debug Chromium with Electron by passing
|
||||
`--build_debug_libcc` to the bootstrap script:
|
||||
|
||||
```sh
|
||||
$ ./script/bootstrap.py -d --build_debug_libcc
|
||||
```
|
||||
|
||||
This will download and build libchromiumcontent locally, similarly to the
|
||||
`--build_release_libcc`, but it will create a shared library build of
|
||||
libchromiumcontent and won't strip any symbols, making it ideal for debugging.
|
||||
|
||||
When built like this, you can make changes to files in
|
||||
`vendor/libchromiumcontent/src` and rebuild quickly with:
|
||||
|
||||
```sh
|
||||
$ ./script/build.py -c D --libcc
|
||||
```
|
||||
|
||||
When developing on linux with gdb, it is recommended to add a gdb index to speed
|
||||
up loading symbols. This doesn't need to be executed on every build, but it is
|
||||
recommended to do it at least once to index most shared libraries:
|
||||
|
||||
```sh
|
||||
$ ./vendor/libchromiumcontent/src/build/gdb-add-index ./out/D/electron
|
||||
```
|
||||
|
||||
Building libchromiumcontent requires a powerful machine and takes a long time
|
||||
(though incremental rebuilding the shared library component is fast). With an
|
||||
8-core/16-thread Ryzen 1700 CPU clocked at 3ghz, fast SSD and 32GB of RAM, it
|
||||
should take about 40 minutes. It is not recommended to build with less than 16GB
|
||||
of RAM.
|
||||
|
||||
## Chromium git cache
|
||||
|
||||
`depot_tools` has an undocumented option that allows the developer to set a
|
||||
global cache for all git objects of Chromium + dependencies. This option uses
|
||||
`git clone --shared` to save bandwidth/space on multiple clones of the same
|
||||
repositories.
|
||||
|
||||
On electron/libchromiumcontent, this option is exposed through the
|
||||
`LIBCHROMIUMCONTENT_GIT_CACHE` environment variable. If you intend to have
|
||||
several libchromiumcontent build trees on the same machine(to work on different
|
||||
branches for example), it is recommended to set the variable to speed up the
|
||||
download of Chromium source. For example:
|
||||
|
||||
```sh
|
||||
$ mkdir ~/.chromium-git-cache
|
||||
$ LIBCHROMIUMCONTENT_GIT_CACHE=~/.chromium-git-cache ./script/bootstrap.py -d --build_debug_libcc
|
||||
```
|
||||
|
||||
If the bootstrap script is interrupted while using the git cache, it will leave
|
||||
the cache locked. To remove the lock, delete the files ending in `.lock`:
|
||||
|
||||
```sh
|
||||
$ find ~/.chromium-git-cache/ -type f -name '*.lock' -delete
|
||||
```
|
||||
|
||||
It is possible to share this directory with other machines by exporting it as
|
||||
SMB share on linux, but only one process/machine can be using the cache at a
|
||||
time. The locks created by git-cache script will try to prevent this, but it may
|
||||
not work perfectly in a network.
|
||||
|
||||
On Windows, SMBv2 has a directory cache that will cause problems with the git
|
||||
cache script, so it is necessary to disable it by setting the registry key
|
||||
|
||||
```sh
|
||||
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Lanmanworkstation\Parameters\DirectoryCacheLifetime
|
||||
```
|
||||
|
||||
to 0. More information: https://stackoverflow.com/a/9935126
|
||||
|
|
|
@ -36,7 +36,7 @@ To start a debugging session, open up PowerShell/CMD and execute your debug
|
|||
build of Electron, using the application to open as a parameter.
|
||||
|
||||
```powershell
|
||||
$ ./out/D/electron.exe ~/my-electron-app/
|
||||
$ ./out/Debug/electron.exe ~/my-electron-app/
|
||||
```
|
||||
|
||||
### Setting Breakpoints
|
||||
|
|
|
@ -1,40 +1,15 @@
|
|||
## Debugging with XCode
|
||||
|
||||
### Build Debug Electron with Release libchromiumcontent
|
||||
You can create a debug build of Electron by following [build instructions for macOS](build-instructions-osx.md).
|
||||
The bootstrap process will download Release version of libchromiumcontent by default,
|
||||
so you will not be able to step through the Chromium source.
|
||||
|
||||
### Build Debug Electron with Debug libchromiumcontent
|
||||
If you want to debug and step through libchromiumcontent, you will have to run the
|
||||
bootsrap script with the `--build_debug_libcc` argument.
|
||||
|
||||
```sh
|
||||
$ cd electron
|
||||
$ ./script/bootstrap.py -v --build_debug_libcc
|
||||
```
|
||||
This can take a significant amount of time depending on build machine as it has to
|
||||
build all of the libchromium source.
|
||||
|
||||
Once, the lib is built, create a symlink to the built directory under download
|
||||
|
||||
`ln -s vendor/libchromiumcontent/dist/main/shared_library vendor/download/libchromiumcontent/shared_library`
|
||||
|
||||
Electron debug builds will use this shared library to link against.
|
||||
|
||||
```sh
|
||||
$ ./script/build.py -c D --libcc
|
||||
```
|
||||
This will build debug Electron with debug version of libchromiumcontent.
|
||||
|
||||
### Generate xcode project for debugging sources (cannot build code from xcode)
|
||||
Run the update script with the --xcode argument.
|
||||
Run `gn gen` with the --ide=xcode argument.
|
||||
```sh
|
||||
$ ./script/update.py --xcode
|
||||
$ gn gen out/Debug --ide=xcode
|
||||
```
|
||||
This will generate the electron.ninjs.xcworkspace. You will have to open this workspace
|
||||
This will generate the electron.ninja.xcworkspace. You will have to open this workspace
|
||||
to set breakpoints and inspect.
|
||||
|
||||
See `gn help gen` for more information on generating IDE projects with GN.
|
||||
|
||||
### Debugging and breakpoints
|
||||
|
||||
Launch Electron app after build.
|
||||
|
|
|
@ -29,9 +29,9 @@ To start a debugging session, open up Terminal and start `lldb`, passing a debug
|
|||
build of Electron as a parameter.
|
||||
|
||||
```sh
|
||||
$ lldb ./out/D/Electron.app
|
||||
(lldb) target create "./out/D/Electron.app"
|
||||
Current executable set to './out/D/Electron.app' (x86_64).
|
||||
$ lldb ./out/Debug/Electron.app
|
||||
(lldb) target create "./out/Debug/Electron.app"
|
||||
Current executable set to './out/Debug/Electron.app' (x86_64).
|
||||
```
|
||||
|
||||
### Setting Breakpoints
|
||||
|
@ -63,7 +63,7 @@ The app will immediately be paused, since Electron sets the app's name on launch
|
|||
|
||||
```sh
|
||||
(lldb) run
|
||||
Process 25244 launched: '/Users/fr/Code/electron/out/D/Electron.app/Contents/MacOS/Electron' (x86_64)
|
||||
Process 25244 launched: '/Users/fr/Code/electron/out/Debug/Electron.app/Contents/MacOS/Electron' (x86_64)
|
||||
Process 25244 stopped
|
||||
* thread #1: tid = 0x839a4c, 0x0000000100162db4 Electron Framework`atom::Browser::SetName(this=0x0000000108b14f20, name="Electron") + 20 at browser.cc:118, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
|
||||
frame #0: 0x0000000100162db4 Electron Framework`atom::Browser::SetName(this=0x0000000108b14f20, name="Electron") + 20 at browser.cc:118
|
||||
|
|
|
@ -46,9 +46,7 @@ Electron
|
|||
├── native_mate/ - A fork of Chromium's gin library that makes it easier to marshal
|
||||
| types between C++ and JavaScript.
|
||||
├── spec/ - Automatic tests.
|
||||
├── electron.gyp - Building rules of Electron.
|
||||
└── common.gypi - Compiler specific settings and building rules for other
|
||||
components like `node` and `breakpad`.
|
||||
└── BUILD.gn - Building rules of Electron.
|
||||
```
|
||||
|
||||
## `/chromium_src`
|
||||
|
@ -68,7 +66,7 @@ libcc patches we maintain now.
|
|||
|
||||
* **script** - Scripts used for development purpose like building, packaging,
|
||||
testing, etc.
|
||||
* **tools** - Helper scripts used by gyp files, unlike `script`, scripts put
|
||||
* **tools** - Helper scripts used by GN files, unlike `script`, scripts put
|
||||
here should never be invoked by users directly.
|
||||
* **vendor** - Source code of third party dependencies, we didn't use
|
||||
`third_party` as name because it would confuse it with the same directory in
|
||||
|
@ -78,7 +76,7 @@ libcc patches we maintain now.
|
|||
* **dist** - Temporary directory created by `script/create-dist.py` script
|
||||
when creating a distribution.
|
||||
* **external_binaries** - Downloaded binaries of third-party frameworks which
|
||||
do not support building with `gyp`.
|
||||
do not support building with `gn`.
|
||||
|
||||
## Keeping Git Submodules Up to Date
|
||||
|
||||
|
@ -89,8 +87,8 @@ when running `git status`:
|
|||
```sh
|
||||
$ git status
|
||||
|
||||
modified: vendor/libchromiumcontent (new commits)
|
||||
modified: vendor/node (new commits)
|
||||
modified: vendor/depot_tools (new commits)
|
||||
modified: vendor/boto (new commits)
|
||||
```
|
||||
|
||||
To update these vendored dependencies, run the following command:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue