Uh oh!
There was an error while loading. Please reload this page.
Use cares_get_32bit as a function helper - #34944
Conversation
nodejs-github-bot
commented
Aug 27, 2020
Review requested:
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
juanarbol
commented
Aug 27, 2020
Refs: #34827 |
There was a problem hiding this comment.
This should go into base64.h if the corresponding function is defined in base64-inl.h, I would say
There was a problem hiding this comment.
It’s not common practice to include another header just so that its definitions are also available from here – it’s probably better to remove this line and add it to the source files that use the ReadUint32BE function?
juanarbol
commented
Aug 31, 2020
It is compiling with clang++ ccache /usr/bin//clang++ -o /home/juanarbol/GitHub/node/out/Release/node -pthread -rdynamic -m64 /home/juanarbol/GitHub/node/out/Release/obj.target/node_text_start/src/large_pages/node_text_start.o -Wl,--whole-archive /home/juanarbol/GitHub/node/out/Release/obj.target/libnode.a /home/juanarbol/GitHub/node/out/Release/obj.target/tools/v8_gypfiles/libv8_base_without_compiler.a -Wl,--no-whole-archive -Wl,--whole-archive /home/juanarbol/GitHub/node/out/Release/obj.target/deps/zlib/libzlib.a -Wl,--no-whole-archive -Wl,--whole-archive /home/juanarbol/GitHub/node/out/Release/obj.target/deps/uv/libuv.a -Wl,--no-whole-archive -Wl,-z,noexecstack -Wl,--whole-archive /home/juanarbol/GitHub/node/out/Release/obj.target/tools/v8_gypfiles/libv8_snapshot.a -Wl,--no-whole-archive -Wl,-z,relro -Wl,-z,now -Wl,--whole-archive,/home/juanarbol/GitHub/node/out/Release/obj.target/deps/openssl/libopenssl.a -Wl,--no-whole-archive -pthread -Wl,--start-group /home/juanarbol/GitHub/node/out/Release/obj.target/node/src/node_main.o /home/juanarbol/GitHub/node/out/Release/obj.target/node/gen/node_code_cache.o /home/juanarbol/GitHub/node/out/Release/obj.target/node/gen/node_snapshot.o /home/juanarbol/GitHub/node/out/Release/obj.target/deps/histogram/libhistogram.a /home/juanarbol/GitHub/node/out/Release/obj.target/deps/uvwasi/libuvwasi.a /home/juanarbol/GitHub/node/out/Release/obj.target/libnode.a /home/juanarbol/GitHub/node/out/Release/obj.target/libnode_text_start.a /home/juanarbol/GitHub/node/out/Release/obj.target/tools/v8_gypfiles/libv8_snapshot.a /home/juanarbol/GitHub/node/out/Release/obj.target/tools/v8_gypfiles/libv8_libplatform.a /home/juanarbol/GitHub/node/out/Release/obj.target/tools/icu/libicui18n.a /home/juanarbol/GitHub/node/out/Release/obj.target/deps/zlib/libzlib.a /home/juanarbol/GitHub/node/out/Release/obj.target/deps/llhttp/libllhttp.a /home/juanarbol/GitHub/node/out/Release/obj.target/deps/cares/libcares.a /home/juanarbol/GitHub/node/out/Release/obj.target/deps/uv/libuv.a /home/juanarbol/GitHub/node/out/Release/obj.target/deps/nghttp2/libnghttp2.a /home/juanarbol/GitHub/node/out/Release/obj.target/deps/brotli/libbrotli.a /home/juanarbol/GitHub/node/out/Release/obj.target/deps/openssl/libopenssl.a /home/juanarbol/GitHub/node/out/Release/obj.target/tools/icu/libicuucx.a /home/juanarbol/GitHub/node/out/Release/obj.target/tools/icu/libicudata.a /home/juanarbol/GitHub/node/out/Release/obj.target/tools/v8_gypfiles/libv8_base_without_compiler.a /home/juanarbol/GitHub/node/out/Release/obj.target/tools/v8_gypfiles/libv8_libbase.a /home/juanarbol/GitHub/node/out/Release/obj.target/tools/v8_gypfiles/libv8_libsampler.a /home/juanarbol/GitHub/node/out/Release/obj.target/tools/v8_gypfiles/libv8_zlib.a /home/juanarbol/GitHub/node/out/Release/obj.target/tools/v8_gypfiles/libv8_compiler.a /home/juanarbol/GitHub/node/out/Release/obj.target/tools/v8_gypfiles/libv8_initializers.a -latomic -lm -ldl -Wl,--end-group
rm fc49da6c53794ce8643a014f0dae2e757fbf8b5d.intermediate
if [ !-r node -o!-L node ];then \
ln -fs out/Release/node node;fi |
There was a problem hiding this comment.
Can you remove this line, and replace #include "base64.h" with #include "base64-inl.h" instead where necessary?
The general idea here is:
.hheader files contain declarations, and sometimes some definitions that don’t require including other headers (e.g. for getters/setters).hheader files include only other.hheaders
-inl.hheader files contain definitions of inline functions from the corresponding.hheader file, i.e. functions markedinlinein the declaration ortemplatefunctions-inl.hheader files include the corresponding.hheader file, and other.hand-inl.hheader files as needed- It’s not always necessary to split out the definitions from the
.hfile into an-inl.hfile, but it becomes necessary when the contents of other-inl.hfiles start being used, and it is very much recommended when the functions are longer than a few lines to keep the corresponding.hfile readable - All visible definitions from this file should have been declared in the corresponding
.hheader file
.ccfiles contain definitions of non-inline functions from the corresponding.hheader file.ccfiles also include the corresponding.hheader file, and other.hand-inl.hheader files as needed
I hope this is helpful?
Refs: nodejs#34944 (comment) Co-authored-by: Anna Henningsen <anna@addaleax.net>
3fa5ef2 to
d78c1beComparejuanarbol
commented
Sep 9, 2020
Hey, sorry about the delay. :/ |
juanarbol
commented
Sep 29, 2020
Ping @addaleax you think is ok to land this one? |
addaleax
commented
Sep 29, 2020
@juanarbol I think this comment is outstanding: #34944 (comment) If you prefer, you can merge this and I’ll open a PR to address that comment, that’s also totally fine 👍 (This needs another CI though, so I’ll kick one off.) |
@addaleax, Shame on me, haha, the comment is totally clear, but I don't get it (I'm kind of a non-C++ programmer), so when I try to follow that out, I just get a compile or linking error (with no very useful information). |
addaleax
commented
Sep 30, 2020
Landed in ff4cf81 :) |
Refs: #34944 (comment) PR-URL: #35432 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
BethGriggs
commented
Oct 13, 2020
This had a large number of changes/conflicts on v14.x, please raise a backport PR if you think it should land on v14.x |
juanarbol
commented
Oct 13, 2020
I could work on backporting. |
Refs: #34944 (comment) Co-authored-by: Anna Henningsen <anna@addaleax.net> PR-URL: #35000 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Refs: #34944 (comment) Co-authored-by: Anna Henningsen <anna@addaleax.net> PR-URL: #35000 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Refs: #34944 (comment) Co-authored-by: Anna Henningsen <anna@addaleax.net> PR-URL: #35000 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Refs: #34944 (comment) Co-authored-by: Anna Henningsen <anna@addaleax.net> PR-URL: #35000 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Refs: #34944 (comment) Co-authored-by: Anna Henningsen <anna@addaleax.net> PR-URL: #35000 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Fixes: nodejs#34827 PR-URL: nodejs#34944 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Refs: nodejs#34944 (comment) PR-URL: nodejs#35432 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Refs: #34944 (comment) PR-URL: #35432 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes