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: enable cctest to use generated objects #11956

Closed
wants to merge 2 commits into from

Conversation

danbev
Copy link
Contributor

@danbev danbev commented Mar 21, 2017

This commit tries to make it simpler to add unit tests (cctest) for
code that needs to test node core funtionality but that might not be
appropriate as an addon or a JavaScript test. An example of this could
be adding functionality targeted for situations when Node itself is
embedded.

Currently it was not as easy, or efficient, as one would have hoped to
add such tests. The object output directories vary for different
operating systems which we need to link to so that we don't have an
additional compilation step.

Details of changes

move LIBS inside of --start-group --end-group

Currently the LIBS specified in the 'libraries' section are not
being included in the --start-group --end-group section which
means that these libraries will not be searched causing issue
with linkers where the order matters.

add win specific paths for object files/libs

The OBJ_DIR on Windows seems to be Release\obj and all the object
files get placed in Release\obj\node. This differs from the unix
environments which specify the output object files using $@ which
will include the path. I thought about updating this and use $(@f)
to simply use the file name on unix and that way having all the
object files in the same directory like it is done on windows, but
that would mean a lot of changes to the gyp generator which I was
not comfortable doing as part of this commit.

add paths specific to aix

On AIX the output directory for object files seems to be named
'node_base' and not 'node' causing a failure on AIX.

add include ldflag for solaris

It looks like when cctest is to be compiled the includes are
missing. Added the SHARED_INTERMEDIATE_DIR as an include.

Refs: #9163

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

build

This commit tries to make it simpler to add unit tests (cctest) for
code that needs to test node core funtionality but that might not be
appropriate as an addon or a JavaScript test. An example of this could
be adding functionality targeted for situations when Node itself is
embedded.

Currently it was not as easy, or efficient, as one would have hoped to
add such tests. The object output directories vary for different
operating systems which we need to link to so that we don't have an
additional compilation step.

Refs: nodejs#9163
@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to build files or the CI. tools Issues and PRs related to the tools directory. labels Mar 21, 2017
@danbev
Copy link
Contributor Author

danbev commented Mar 21, 2017

Copy link
Member

@jasnell jasnell left a comment

Choose a reason for hiding this comment

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

LGTM

Side note: we should probably add details on how to create this kind of tests to the test guide.

@danbev
Copy link
Contributor Author

danbev commented Mar 23, 2017

Side note: we should probably add details on how to create this kind of tests to the test guide.

I'll take a look and add a suggestion to the test guide.

jasnell pushed a commit that referenced this pull request Mar 24, 2017
This commit tries to make it simpler to add unit tests (cctest) for
code that needs to test node core funtionality but that might not be
appropriate as an addon or a JavaScript test. An example of this could
be adding functionality targeted for situations when Node itself is
embedded.

Currently it was not as easy, or efficient, as one would have hoped to
add such tests. The object output directories vary for different
operating systems which we need to link to so that we don't have an
additional compilation step.

PR-URL: #11956
Ref: #9163
Reviewed-By: James M Snell <jasnell@gmail.com>
jasnell pushed a commit that referenced this pull request Mar 24, 2017
PR-URL: #11956
Ref: #9163
Reviewed-By: James M Snell <jasnell@gmail.com>
@jasnell
Copy link
Member

jasnell commented Mar 24, 2017

Landed in 6a09a69...64af398

@MylesBorins
Copy link
Member

This requires a manual backport to v7.x

@jasnell jasnell mentioned this pull request Apr 4, 2017
aqrln pushed a commit to aqrln/node that referenced this pull request Apr 12, 2017
This commit tries to make it simpler to add unit tests (cctest) for
code that needs to test node core funtionality but that might not be
appropriate as an addon or a JavaScript test. An example of this could
be adding functionality targeted for situations when Node itself is
embedded.

Currently it was not as easy, or efficient, as one would have hoped to
add such tests. The object output directories vary for different
operating systems which we need to link to so that we don't have an
additional compilation step.

PR-URL: nodejs#11956
Ref: nodejs#9163
Reviewed-By: James M Snell <jasnell@gmail.com>
aqrln pushed a commit to aqrln/node that referenced this pull request Apr 12, 2017
PR-URL: nodejs#11956
Ref: nodejs#9163
Reviewed-By: James M Snell <jasnell@gmail.com>
@refack
Copy link
Contributor

refack commented Apr 16, 2017

[post mortem] IMHO and keeping with previous practices, patches to tools/gyp should be in their own commit, for easy rebasing.

@danbev is the change in tools/gyp/pylib/gyp/generator/make.py#L150 meaningful? since I'm vendoring the new GYP and wanted to know if it's needed?

@refack
Copy link
Contributor

refack commented Apr 16, 2017

MN just found your comment

move LIBS inside of --start-group --end-group

Currently the LIBS specified in the 'libraries' section are not
being included in the --start-group --end-group section which
means that these libraries will not be searched causing issue
with linkers where the order matters.

danbev added a commit to danbev/node that referenced this pull request May 30, 2017
This commit tries to make it simpler to add unit tests (cctest) for
code that needs to test node core funtionality but that might not be
appropriate as an addon or a JavaScript test. An example of this could
be adding functionality targeted for situations when Node itself is
embedded.

Currently it was not as easy, or efficient, as one would have hoped to
add such tests. The object output directories vary for different
operating systems which we need to link to so that we don't have an
additional compilation step.

PR-URL: nodejs#11956
Ref: nodejs#9163
Reviewed-By: James M Snell <jasnell@gmail.com>
gibfahn pushed a commit to gibfahn/node that referenced this pull request Jun 17, 2017
This commit tries to make it simpler to add unit tests (cctest) for
code that needs to test node core funtionality but that might not be
appropriate as an addon or a JavaScript test. An example of this could
be adding functionality targeted for situations when Node itself is
embedded.

Currently it was not as easy, or efficient, as one would have hoped to
add such tests. The object output directories vary for different
operating systems which we need to link to so that we don't have an
additional compilation step.

PR-URL: nodejs#11956
Backport-PR-URL: nodejs#12948
Ref: nodejs#9163
Reviewed-By: James M Snell <jasnell@gmail.com>
@gibfahn
Copy link
Member

gibfahn commented Jun 20, 2017

@danbev if you want to backport this, can you backport it with any fixes that landed since (e.g. #12484).

Also do you know if there are any open issues that relate to this, or was everything fixed?

MylesBorins pushed a commit that referenced this pull request Jul 11, 2017
This commit tries to make it simpler to add unit tests (cctest) for
code that needs to test node core funtionality but that might not be
appropriate as an addon or a JavaScript test. An example of this could
be adding functionality targeted for situations when Node itself is
embedded.

Currently it was not as easy, or efficient, as one would have hoped to
add such tests. The object output directories vary for different
operating systems which we need to link to so that we don't have an
additional compilation step.

PR-URL: #11956
Backport-PR-URL: #12948
Ref: #9163
Reviewed-By: James M Snell <jasnell@gmail.com>
refack pushed a commit to refack/node that referenced this pull request Jul 18, 2017
this is a re-base of the gyp part of
6a09a69
after bumping GYP version to
https://chromium.googlesource.com/external/gyp/+/eb296f67da078ec01f5e3a9ea9cdc6d26d680161

Original-PR-URL: nodejs#11956
Original-Ref: nodejs#9163
Original-Reviewed-By: James M Snell <jasnell@gmail.com>

PR-URL: nodejs#12450
Reviewed-By: João Reis <reis@janeasystems.com>
@MylesBorins MylesBorins mentioned this pull request Jul 18, 2017
@refack refack added the embedding Issues and PRs related to embedding Node.js in another project. label Aug 17, 2017
refack pushed a commit to refack/node that referenced this pull request Aug 23, 2017
this is a re-base of the gyp part of
6a09a69
after bumping GYP version to
https://chromium.googlesource.com/external/gyp/+/eb296f67da078ec01f5e3a9ea9cdc6d26d680161

Original-PR-URL: nodejs#11956
Original-Ref: nodejs#9163
Original-Reviewed-By: James M Snell <jasnell@gmail.com>

PR-URL: nodejs#12450
Reviewed-By: João Reis <reis@janeasystems.com>
addaleax pushed a commit to addaleax/ayo that referenced this pull request Aug 25, 2017
this is a re-base of the gyp part of
6a09a69
after bumping GYP version to
https://chromium.googlesource.com/external/gyp/+/eb296f67da078ec01f5e3a9ea9cdc6d26d680161

Original-PR-URL: nodejs/node#11956
Original-Ref: nodejs/node#9163
Original-Reviewed-By: James M Snell <jasnell@gmail.com>

PR-URL: nodejs/node#12450
Reviewed-By: João Reis <reis@janeasystems.com>
addaleax pushed a commit to ayojs/ayo that referenced this pull request Aug 28, 2017
this is a re-base of the gyp part of
6a09a69
after bumping GYP version to
https://chromium.googlesource.com/external/gyp/+/eb296f67da078ec01f5e3a9ea9cdc6d26d680161

Original-PR-URL: nodejs/node#11956
Original-Ref: nodejs/node#9163
Original-Reviewed-By: James M Snell <jasnell@gmail.com>

PR-URL: nodejs/node#12450
Reviewed-By: João Reis <reis@janeasystems.com>
MylesBorins pushed a commit that referenced this pull request Sep 10, 2017
this is a re-base of the gyp part of
6a09a69
after bumping GYP version to
https://chromium.googlesource.com/external/gyp/+/eb296f67da078ec01f5e3a9ea9cdc6d26d680161

Original-PR-URL: #11956
Original-Ref: #9163
Original-Reviewed-By: James M Snell <jasnell@gmail.com>

PR-URL: #12450
Reviewed-By: João Reis <reis@janeasystems.com>
MylesBorins pushed a commit that referenced this pull request Sep 12, 2017
this is a re-base of the gyp part of
6a09a69
after bumping GYP version to
https://chromium.googlesource.com/external/gyp/+/eb296f67da078ec01f5e3a9ea9cdc6d26d680161

Original-PR-URL: #11956
Original-Ref: #9163
Original-Reviewed-By: James M Snell <jasnell@gmail.com>

PR-URL: #12450
Reviewed-By: João Reis <reis@janeasystems.com>
rvagg pushed a commit to nodejs/node-gyp that referenced this pull request Aug 9, 2018
this is a re-base of the gyp part of
6a09a69ec9d36b705e9bde2ac1a193566a702d96
after bumping GYP version to
https://chromium.googlesource.com/external/gyp/+/eb296f67da078ec01f5e3a9ea9cdc6d26d680161

Original-PR-URL: nodejs/node#11956
Original-Ref: nodejs/node#9163
Original-Reviewed-By: James M Snell <jasnell@gmail.com>

PR-URL: nodejs/node#12450
Reviewed-By: João Reis <reis@janeasystems.com>
rvagg pushed a commit to nodejs/node-gyp that referenced this pull request Aug 9, 2018
this is a re-base of the gyp part of
6a09a69ec9d36b705e9bde2ac1a193566a702d96
after bumping GYP version to
https://chromium.googlesource.com/external/gyp/+/eb296f67da078ec01f5e3a9ea9cdc6d26d680161

Original-PR-URL: nodejs/node#11956
Original-Ref: nodejs/node#9163
Original-Reviewed-By: James M Snell <jasnell@gmail.com>

PR-URL: nodejs/node#12450
Reviewed-By: João Reis <reis@janeasystems.com>
@MylesBorins MylesBorins removed the baking-for-lts PRs that need to wait before landing in a LTS release. label Aug 17, 2018
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. embedding Issues and PRs related to embedding Node.js in another project. tools Issues and PRs related to the tools directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants