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: extract common code from NODE_EXE/_G_EXE #22310

Closed
wants to merge 1 commit into from

Conversation

danbev
Copy link
Contributor

@danbev danbev commented Aug 14, 2018

This commit extracts common parts of the NODE_EXE, and NODE_G_EXE
recipes into a canned reciepe to reduce some code duplication.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the build Issues and PRs related to build files or the CI. label Aug 14, 2018
@danbev
Copy link
Contributor Author

danbev commented Aug 14, 2018

@refack
Copy link
Contributor

refack commented Aug 14, 2018

/cc @nodejs/build-files

This commit extracts common parts of the NODE_EXE, and NODE_G_EXE
recipes into a canned reciepe to reduce some code duplication.
@danbev danbev force-pushed the build_node_exe_target branch from e8e965d to db723a1 Compare August 20, 2018 11:43
@danbev
Copy link
Contributor Author

danbev commented Aug 20, 2018

@danbev
Copy link
Contributor Author

danbev commented Aug 22, 2018

Landed in 4e2fa8b.

@danbev danbev closed this Aug 22, 2018
@danbev danbev deleted the build_node_exe_target branch August 22, 2018 04:39
danbev added a commit that referenced this pull request Aug 22, 2018
This commit extracts common parts of the NODE_EXE, and NODE_G_EXE
recipes into a canned reciepe to reduce some code duplication.

PR-URL: #22310
Reviewed-By: Jon Moss <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
# The -r/-L check stops it recreating the link if it is already in place,
# otherwise $(NODE_EXE) being a .PHONY target means it is always re-run.
# Without the check there is a race condition between the link being deleted
# and recreated which can break the addons build when running test-ci
# See comments on the build-addons target for some more info
if [ ! -r $@ -o ! -L $@ ]; then ln -fs out/$1/$(NODE_EXE) $@; fi
endef
$(NODE_EXE): config.gypi out/Makefile
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICT $BUILDTYPE is already defined.

node/Makefile

Lines 64 to 68 in db723a1

ifeq ($(BUILDTYPE),Release)
all: out/Makefile $(NODE_EXE) ## Default target, builds node in out/Release/node.
else
all: out/Makefile $(NODE_EXE) $(NODE_G_EXE)
endif

so this could be:

$(NODE_EXE) $(NODE_G_EXE): config.gypi out/Makefile
  $(MAKE) -C out
  if [ ! -r $@ -o ! -L $@ ]; then ln -fs out/$(BUILDTYPE)/$(NODE_EXE) $@; fi

removing
BUILDTYPE is defined so no need to pass is explicitly
V=$(V) this is just 🤷‍♂️
and putting $(BUILDTYPE) in the link target

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants