Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upsrc: move arch, platform and release into node_metadata.cc #25293
Conversation
This comment has been minimized.
This comment has been minimized.
nodejs-github-bot
added
the
C++
label
Dec 31, 2018
This comment has been minimized.
This comment has been minimized.
| Release release; | ||
|
|
||
| std::string arch; | ||
| std::string platform; |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
joyeecheung
Jan 4, 2019
Author
Member
I don't think Metadata itself can be const - the ICU data versions have to be loaded after they are initialized. Other members should be able to be made const though.
|
Turning string literals into mutable std::strings is kind of inelegant. It'd be better to have some kind of struct that lives in rodata: extern "C" static const struct {
char arch[sizeof(NODE_ARCH)];
char platform[sizeof(NODE_PLATFORM)];
// etc.
} node_metadata = {
NODE_ARCH,
NODE_PLATFORM,
// etc.
}; |
This comment has been minimized.
This comment has been minimized.
|
I've marked |
|
Just reaffirming my LGTM |
joyeecheung
added
the
author ready
label
Jan 4, 2019
This comment has been minimized.
This comment has been minimized.
|
Landed in 6c01621 |
joyeecheung
closed this
Jan 6, 2019
This comment has been minimized.
This comment has been minimized.
|
This needs to be backported to v11.x. |
addaleax
added
the
backport-requested-v11.x
label
Jan 9, 2019
BridgeAR
added this to Backport requested
in v11.x
Jan 10, 2019
This comment has been minimized.
This comment has been minimized.
|
This applies cleanly now. |
joyeecheung commentedDec 31, 2018
•
edited
Move definitions of more metadata into node_metadata{.h, .cc}
so the data can be reused and easily inspected in C++.
In a peudo-release build:
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes