Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add DEBUG_ONLY to Makefile to support debug-only builds #49229

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

joyeecheung
Copy link
Member

Previously, when setting BUILDTYPE=Debug, make would build both
the release build and the debug build and use the release build
to run certain build steps before running the tests using the
debug build. This patch adds another DEBUG_ONLY switch to the
Makefile. When it's used in conjunction with BUILDTYPE=Debug
Node.js no longer builds the release build and instead would
just use the debug build to complete the build steps.

DEBUG_ONLY=1 BUILDTYPE=Debug BUILD_WITH=ninja make test-only

Previously, when setting BUILDTYPE=Debug, `make` would build both
the release build and the debug build and use the release build
to run certain build steps before running the tests using the
debug build. This patch adds another DEBUG_ONLY switch to the
Makefile. When it's used in conjunction with BUILDTYPE=Debug
Node.js no longer builds the release build and instead would
just use the debug build to complete the build steps.

```
DEBUG_ONLY=1 BUILDTYPE=Debug BUILD_WITH=ninja make test-only
```
@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to build files or the CI. needs-ci PRs that need a full CI run. labels Aug 18, 2023
@joyeecheung
Copy link
Member Author

Draft for now, I've only tested it with the ninja builds, not the make builds

@joyeecheung joyeecheung added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 18, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 18, 2023
@nodejs-github-bot
Copy link
Collaborator

@bnoordhuis
Copy link
Member

bnoordhuis commented Aug 19, 2023

Not that I have a super strong opinion but... I just make -j$(getconf _NPROCESSORS_ONLN) -C out BUILDTYPE=Debug. Maybe document that somewhere instead of hacking up the Makefile even further? It's already quite illegible and impenetrable.

@joyeecheung
Copy link
Member Author

joyeecheung commented Aug 21, 2023

Maybe document that somewhere instead of hacking up the Makefile even further?

The point is not just building debug builds, but also running all the tests with just the debug builds i.e. after running make test, out/Release is empty. Otherwise it just doubles the time it takes to run and test the debug builds if your machine already runs the debug build fast enough for the build steps of tests. (Personally, I always do ninja -C out/Debug, but then I still had to wait a long time to build the release build if I want to run the test suite with the debug build, which makes..little sense)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants