Uh oh!
There was an error while loading. Please reload this page.
build: fix cctest build failure in Windows - #21228
Conversation
yhwang
commented
Jun 9, 2018
I've verified the change on Windows 2016 and Ubuntu 16.04. |
Trott
commented
Jun 9, 2018
@nodejs/platform-windows @nodejs/build @nodejs/testing |
Trott
commented
Jun 9, 2018
refack
left a comment
There was a problem hiding this comment.
LGTM, but have some stuff to discuss
There was a problem hiding this comment.
Is it because of condition evaluation order.
In that case it's also possible to > or "late variable expansion operator", or just put a comment.
There was a problem hiding this comment.
because the only variables we need in cctest target are var_defines and dep_objs. Other variables are just intermediate. I can flatten them if variable scope is minor.
There was a problem hiding this comment.
@refack after trying to flatten the variables, I need to use > for late variable expansion and I found it's easy to get confused. I'd prefer 2 level variable and I will put a comment there. how do you think?
There was a problem hiding this comment.
👍
Comment is totally reasonable, but IMHO it's needed since it's a non-trivial pattern.
There was a problem hiding this comment.
So GYP has default list appending semantics so no need for the + suffix+ just means "prepend"
There was a problem hiding this comment.
I ran into some issues when I didn't use + sign in other place. In this case, I can remove it.
There was a problem hiding this comment.
Let's go with obj_inspetor_path
There was a problem hiding this comment.
IMHO this could be kept on one line (it's not the only >80 line anyway). But others may disagree.
There was a problem hiding this comment.
I realized there are other >80 lines. however, let me follow the convention :-).
There was a problem hiding this comment.
Why can't we merge these lists?
There was a problem hiding this comment.
merge? can you elaborate it more?
There was a problem hiding this comment.
are you talking about merging this into variables? I don't know sources is available inside variables. If yes, I will merge them.
There was a problem hiding this comment.
@refack I can't access sources inside variables. then what do you mean by merge?
There was a problem hiding this comment.
It's just that having the condition in multiple point makes it hard to grok.
So maybe define a conditionally filled variable
'node_inspector_sources' : [],
...
['v8_enable_inspector==1', {
'node_inspector_sources' : [
'test/cctest/test_inspector_socket.cc',
'test/cctest/test_inspector_socket_server.cc',
'<@(node_inspector_generated_sources)',
]Then here (or anywhere else where sources if appended) just have an unconditional
'sources': [ '>@(node_inspector_sources)']There was a problem hiding this comment.
@refack I found gyp throws an error when the variable is an empty array (./configure --without-inspector). Therefore, I need to preload the sources in cctest target into that new variable: var_sources. Same as var_defines.
Looks good in general, left some comments and questions. Resume CI: https://ci.nodejs.org/job/node-test-commit/19141/ |
b2a4611 to
13d7c48Compare13d7c48 to
748464bCompareyhwang
commented
Jun 18, 2018
rebase the code and new CI: https://ci.nodejs.org/job/node-test-commit/19311/ |
bnoordhuis
left a comment
There was a problem hiding this comment.
This PR basically reverts 30f89df from a few months ago and (re)introduces a lot of duplication.
cctest needs to access some internal APIs in node core.
I'd say a better way forward is to identify those internal APIs and decide on a case-by-case basis what to do with them. Can you list them?
I could also live with disabling cctest for shared library builds; the static build gives good enough coverage.
bnoordhuis
commented
Jun 22, 2018
Another solution: introduce a |
addaleax
commented
Jul 18, 2018
@yhwang What’s the status here? |
yhwang
commented
Jul 19, 2018
@addaleax sorry for the lack of activity for this one. I was not able to have time handle this last month. Based on @bnoordhuis 's comment. I will disable the cctest in Windows when building shared lib. For those internal APIs that are needed by cctest, I think introducing a |
addaleax
commented
Jul 19, 2018
@yhwang thanks for the update, makes sense to me! |
cctest depends on some internal APIs which don't declare `__declspec(dllexport)` and causes build failure when building node as shared lib on Windows. Since we already have good test coverage in static lib, we decide to skip the cctest in shared lib build on Windows. Signed-off-by: Yihong Wang <yh.wang@ibm.com>
748464b to
0ec2e1dCompareyhwang
commented
Jul 24, 2018
@bnoordhuis@refack I completely removed my original change and just skip cctest target in the new change based on the feedback. Please review the change again. Thanks. |
yhwang
commented
Aug 1, 2018
ping @bnoordhuis@refack@danbev . for now, I just disable the cctest on Windows when building shared lib. Let's discuss re-enabling it in another issue if needed. |
jasnell
commented
Sep 10, 2018
Ping... any updates on this one? |
yhwang
commented
Sep 11, 2018
I updated the change based on the comments and wait for review/comment. after the update, I haven't received any feedback yet. |
refack
commented
Sep 11, 2018
I'm fine with the current workaround... |
yhwang
commented
Sep 13, 2018
@bnoordhuis 's review is for old change. let me dismiss his old review |
yhwang
commented
Sep 13, 2018
yhwang
commented
Sep 13, 2018
CI is green |
addaleax
commented
Sep 17, 2018
Landed in 29cf335 |
cctest depends on some internal APIs which don't declare `__declspec(dllexport)` and causes build failure when building node as shared lib on Windows. Since we already have good test coverage in static lib, we decide to skip the cctest in shared lib build on Windows. Signed-off-by: Yihong Wang <yh.wang@ibm.com> PR-URL: #21228 Reviewed-By: Refael Ackermann <refack@gmail.com>
cctest depends on some internal APIs which don't declare `__declspec(dllexport)` and causes build failure when building node as shared lib on Windows. Since we already have good test coverage in static lib, we decide to skip the cctest in shared lib build on Windows. Signed-off-by: Yihong Wang <yh.wang@ibm.com> PR-URL: #21228 Reviewed-By: Refael Ackermann <refack@gmail.com>
cctest depends on some internal APIs which don't declare `__declspec(dllexport)` and causes build failure when building node as shared lib on Windows. Since we already have good test coverage in static lib, we decide to skip the cctest in shared lib build on Windows. Signed-off-by: Yihong Wang <yh.wang@ibm.com> PR-URL: #21228 Reviewed-By: Refael Ackermann <refack@gmail.com>
cctest depends on some internal APIs which don't declare `__declspec(dllexport)` and causes build failure when building node as shared lib on Windows. Since we already have good test coverage in static lib, we decide to skip the cctest in shared lib build on Windows. Signed-off-by: Yihong Wang <yh.wang@ibm.com> PR-URL: #21228 Reviewed-By: Refael Ackermann <refack@gmail.com>
cctest depends on some internal APIs which don't declare `__declspec(dllexport)` and causes build failure when building node as shared lib on Windows. Since we already have good test coverage in static lib, we decide to skip the cctest in shared lib build on Windows. Signed-off-by: Yihong Wang <yh.wang@ibm.com> PR-URL: nodejs#21228 Reviewed-By: Refael Ackermann <refack@gmail.com>
cctest depends on some internal APIs which don't declare `__declspec(dllexport)` and causes build failure when building node as shared lib on Windows. Since we already have good test coverage in static lib, we decide to skip the cctest in shared lib build on Windows. Signed-off-by: Yihong Wang <yh.wang@ibm.com> Backport-PR-URL: #25758 PR-URL: #21228 Reviewed-By: Refael Ackermann <refack@gmail.com>
cctest needs to access some internal APIs in node core. Putting
node_lib_target_name as dependency would causes linking error when
node_lib is built as shared lib in Windows. The reason being is
those internal APIs don't have
__declspec(dllexport). For cctestwe still need to specify individual obj files and link them instead
of node_lib. In Windows, changes of the dependencies in
librariestrigger the cctest to rebuild. However, in Linux platforms, it
doesn't work. Instead, need to put obj dependencies into
sources.Signed-off-by: Yihong Wang yh.wang@ibm.com
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes