build: remove debug builds (#21016)
* build: remove debug builds * Update docs/development/debugging-instructions-macos.md Co-Authored-By: Robo <hop2deep@gmail.com>
This commit is contained in:
parent
f1e7393e30
commit
b06a479240
10 changed files with 30 additions and 168 deletions
|
@ -96,30 +96,30 @@ $ cd src
|
|||
$ export CHROMIUM_BUILDTOOLS_PATH=`pwd`/buildtools
|
||||
# this next line is needed only if building with sccache
|
||||
$ export GN_EXTRA_ARGS="${GN_EXTRA_ARGS} cc_wrapper=\"${PWD}/electron/external_binaries/sccache\""
|
||||
$ gn gen out/Debug --args="import(\"//electron/build/args/debug.gn\") $GN_EXTRA_ARGS"
|
||||
$ gn gen out/Testing --args="import(\"//electron/build/args/testing.gn\") $GN_EXTRA_ARGS"
|
||||
```
|
||||
|
||||
Or on Windows (without the optional argument):
|
||||
```sh
|
||||
$ cd src
|
||||
$ set CHROMIUM_BUILDTOOLS_PATH=%cd%\buildtools
|
||||
$ gn gen out/Debug --args="import(\"//electron/build/args/debug.gn\")"
|
||||
$ gn gen out/Testing --args="import(\"//electron/build/args/testing.gn\")"
|
||||
```
|
||||
|
||||
This will generate a build directory `out/Debug` under `src/` with
|
||||
debug build configuration. You can replace `Debug` with another name,
|
||||
This will generate a build directory `out/Testing` under `src/` with
|
||||
the testing build configuration. You can replace `Testing` with another name,
|
||||
but it should be a subdirectory of `out`.
|
||||
Also you shouldn't have to run `gn gen` again—if you want to change the
|
||||
build arguments, you can run `gn args out/Debug` to bring up an editor.
|
||||
build arguments, you can run `gn args out/Testing` to bring up an editor.
|
||||
|
||||
To see the list of available build configuration options, run `gn args
|
||||
out/Debug --list`.
|
||||
out/Testing --list`.
|
||||
|
||||
**For generating Debug (aka "component" or "shared") build config of
|
||||
**For generating Testing build config of
|
||||
Electron:**
|
||||
|
||||
```sh
|
||||
$ gn gen out/Debug --args="import(\"//electron/build/args/debug.gn\") $GN_EXTRA_ARGS"
|
||||
$ gn gen out/Testing --args="import(\"//electron/build/args/testing.gn\") $GN_EXTRA_ARGS"
|
||||
```
|
||||
|
||||
**For generating Release (aka "non-component" or "static") build config of
|
||||
|
@ -132,9 +132,9 @@ $ gn gen out/Release --args="import(\"//electron/build/args/release.gn\") $GN_EX
|
|||
**To build, run `ninja` with the `electron` target:**
|
||||
Nota Bene: This will also take a while and probably heat up your lap.
|
||||
|
||||
For the debug configuration:
|
||||
For the testing configuration:
|
||||
```sh
|
||||
$ ninja -C out/Debug electron
|
||||
$ ninja -C out/Testing electron
|
||||
```
|
||||
|
||||
For the release configuration:
|
||||
|
@ -147,19 +147,19 @@ This will build all of what was previously 'libchromiumcontent' (i.e. the
|
|||
so it will take a while.
|
||||
|
||||
To speed up subsequent builds, you can use [sccache][sccache]. Add the GN arg
|
||||
`cc_wrapper = "sccache"` by running `gn args out/Debug` to bring up an
|
||||
`cc_wrapper = "sccache"` by running `gn args out/Testing` to bring up an
|
||||
editor and adding a line to the end of the file.
|
||||
|
||||
[sccache]: https://github.com/mozilla/sccache
|
||||
|
||||
The built executable will be under `./out/Debug`:
|
||||
The built executable will be under `./out/Testing`:
|
||||
|
||||
```sh
|
||||
$ ./out/Debug/Electron.app/Contents/MacOS/Electron
|
||||
$ ./out/Testing/Electron.app/Contents/MacOS/Electron
|
||||
# or, on Windows
|
||||
$ ./out/Debug/electron.exe
|
||||
$ ./out/Testing/electron.exe
|
||||
# or, on Linux
|
||||
$ ./out/Debug/electron
|
||||
$ ./out/Testing/electron
|
||||
```
|
||||
|
||||
### Packaging
|
||||
|
@ -181,7 +181,7 @@ set the `target_cpu` and `target_os` GN arguments. For example, to compile an
|
|||
x86 target from an x64 host, specify `target_cpu = "x86"` in `gn args`.
|
||||
|
||||
```sh
|
||||
$ gn gen out/Debug-x86 --args='... target_cpu = "x86"'
|
||||
$ gn gen out/Testing-x86 --args='... target_cpu = "x86"'
|
||||
```
|
||||
|
||||
Not all combinations of source and target CPU/OS are supported by Chromium.
|
||||
|
@ -226,7 +226,7 @@ generate build headers for the modules to compile against, run the following
|
|||
under `src/` directory.
|
||||
|
||||
```sh
|
||||
$ ninja -C out/Debug third_party/electron_node:headers
|
||||
$ ninja -C out/Testing third_party/electron_node:headers
|
||||
```
|
||||
|
||||
You can now [run the tests](testing.md#unit-tests).
|
||||
|
@ -235,7 +235,7 @@ If you're debugging something, it can be helpful to pass some extra flags to
|
|||
the Electron binary:
|
||||
|
||||
```sh
|
||||
$ ./out/Debug/Electron.app/Contents/MacOS/Electron electron/spec \
|
||||
$ npm run test -- \
|
||||
--enable-logging -g 'BrowserWindow module'
|
||||
```
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ And to cross-compile for `arm` or `ia32` targets, you should pass the
|
|||
`target_cpu` parameter to `gn gen`:
|
||||
|
||||
```sh
|
||||
$ gn gen out/Debug --args='import(...) target_cpu="arm"'
|
||||
$ gn gen out/Testing --args='import(...) target_cpu="arm"'
|
||||
```
|
||||
|
||||
## Building
|
||||
|
@ -114,7 +114,7 @@ GN args.
|
|||
For example if you installed `clang` under `/usr/local/bin/clang`:
|
||||
|
||||
```sh
|
||||
$ gn gen out/Debug --args='import("//electron/build/args/debug.gn") clang_base_path = "/usr/local/bin"'
|
||||
$ gn gen out/Testing --args='import("//electron/build/args/testing.gn") clang_base_path = "/usr/local/bin"'
|
||||
```
|
||||
|
||||
### Using compilers other than `clang`
|
||||
|
|
|
@ -74,7 +74,7 @@ To generate a Visual Studio project, you can pass the `--ide=vs2017` parameter
|
|||
to `gn gen`:
|
||||
|
||||
```powershell
|
||||
$ gn gen out/Debug --ide=vs2017
|
||||
$ gn gen out/Testing --ide=vs2017
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
|
|
@ -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/Debug/electron.exe ~/my-electron-app/
|
||||
$ ./out/Testing/electron.exe ~/my-electron-app/
|
||||
```
|
||||
|
||||
### Setting Breakpoints
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
### Generate xcode project for debugging sources (cannot build code from xcode)
|
||||
Run `gn gen` with the --ide=xcode argument.
|
||||
```sh
|
||||
$ gn gen out/Debug --ide=xcode
|
||||
$ gn gen out/Testing --ide=xcode
|
||||
```
|
||||
This will generate the electron.ninja.xcworkspace. You will have to open this workspace
|
||||
to set breakpoints and inspect.
|
||||
|
|
|
@ -25,13 +25,13 @@ you prefer a graphical interface.
|
|||
|
||||
## Attaching to and Debugging Electron
|
||||
|
||||
To start a debugging session, open up Terminal and start `lldb`, passing a debug
|
||||
To start a debugging session, open up Terminal and start `lldb`, passing a non-release
|
||||
build of Electron as a parameter.
|
||||
|
||||
```sh
|
||||
$ lldb ./out/Debug/Electron.app
|
||||
(lldb) target create "./out/Debug/Electron.app"
|
||||
Current executable set to './out/Debug/Electron.app' (x86_64).
|
||||
$ lldb ./out/Testing/Electron.app
|
||||
(lldb) target create "./out/Testing/Electron.app"
|
||||
Current executable set to './out/Testing/Electron.app' (x86_64).
|
||||
```
|
||||
|
||||
### Setting Breakpoints
|
||||
|
@ -62,7 +62,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/Debug/Electron.app/Contents/MacOS/Electron' (x86_64)
|
||||
Process 25244 launched: '/Users/fr/Code/electron/out/Testing/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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue