-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Prepare nodejs for v18 #16966
Prepare nodejs for v18 #16966
Conversation
I detected other pull requests that are modifying nodejs/all recipe: This message is automatically generated by https://github.com/ericLemanissier/conan-center-conflicting-prs so don't hesitate to report issues/improvements there. |
This comment has been minimized.
This comment has been minimized.
07cf61b
to
1b5f10e
Compare
This comment has been minimized.
This comment has been minimized.
f2725fc
to
ad013a5
Compare
This comment has been minimized.
This comment has been minimized.
92a6b68
to
bb3ca5f
Compare
This comment has been minimized.
This comment has been minimized.
1510196
to
ee4342b
Compare
This comment has been minimized.
This comment has been minimized.
ee4342b
to
f45d3ea
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking the time to submit this PR, there's a quiet a fe things i was not expecting so there are lots of questions if you dont mind answering that would be great
recipes/nodejs/all/conanfile.py
Outdated
|
||
@property | ||
def _source_subfolder(self): | ||
return os.path.join(self.source_folder, "source_subfolder") | ||
|
||
@property | ||
def _nodejs_arch(self): | ||
if str(self.settings.os) == "Linux": | ||
if str(self.settings.arch).startswith("armv7"): | ||
if str(self.info.settings.os) == "Linux": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.info
should only be used in package_info
this looks very bizarre 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the reason here: conan-io/conan#13506 Basically it is a bug in conan itself ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No no, it's usually a sign of doing something funky that probably has a different solution.
There are checks that need to happen in both generate and package_id
return str(self.info.settings.arch) | ||
|
||
@property | ||
def _glibc_version(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test will fail otherwise. See supported platforms here: https://github.com/nodejs/node/blob/main/BUILDING.md#platform-list It states glibc>=2.17
recipes/nodejs/all/conanfile.py
Outdated
not (str(self.settings.os) in self.conan_data["sources"][self.version]) or | ||
not (self._nodejs_arch in self.conan_data["sources"][self.version][str(self.settings.os)] ) ): | ||
if not self.version in self.conan_data["sources"] or \ | ||
not str(self.info.settings.os) in self.conan_data["sources"][self.version] or \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
info should not be add here 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the reason here: conan-io/conan#13506 Basically it is a bug in conan itself ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No no, that issue was specific to using it in package
for validate the recommendation is to access self.settings
directly.
Thank you for your review. I've added some changes and comments. The usage |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Alexander Kozhinov <[email protected]>
Signed-off-by: Alexander Kozhinov <[email protected]>
Oh wow. the recipe was just bad before? pre compiled binaries should be downloaded in the build folder not the source method Check the cmake recipe for an example
|
Co-authored-by: Chris Mc <[email protected]>
Co-authored-by: Chris Mc <[email protected]>
Co-authored-by: Chris Mc <[email protected]>
Co-authored-by: Chris Mc <[email protected]>
Signed-off-by: Alexander Kozhinov <[email protected]>
Signed-off-by: Alexander Kozhinov <[email protected]>
Sometimes I am wondering the restrictions you tell me :) I've never seen thouse in conan docs. And I am using conan v1 already 1,5 years in my company :D |
Signed-off-by: Alexander Kozhinov <[email protected]>
Conan v1 pipeline ✔️All green in build 43 (
Conan v2 pipeline ✔️
All green in build 43 ( |
Actually, there is a package template named prebuild_tool_package, which does it the same way: conan-center-index/docs/package_templates/prebuilt_tool_package/all/conanfile.py Lines 36 to 46 in eccffc6
I always try to follow one of the templates. |
self.output.info("Node version:") | ||
self.run("node --version", run_environment=True) | ||
self.run("node --version") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.run("node --version") | |
self.run("node --version") | |
self.run("npm --version") | |
self.run("npx --version") |
def test(self): | ||
if not cross_building(self): | ||
self.output.info("Node version:") | ||
self.run("node --version") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.run("node --version") | |
self.run("node --version") | |
self.run("npm --version") | |
self.run("npx --version") |
And thank you for all your work and patience! 🐝 |
The biggest sin of 1.x was letting you do anything even thought it was not recommended or error prone. Reviewing PRs is not my job but I actually enjoy it so I make a few hours a week to do them. As for the docs, they are never complete of finished so there's a done of things missing. Completely features are just undocumented still so as much as they are a source of truth they are sometimes missing things. On the flip side CCI's community has a difference of opinion when it comes to writing recipes, not all of the conventions here are the "recommendation" from Conan itself... for example how we apply patches... it's easier to review and maintain the CCI way but not necessarily required. But it's super hard to explain and looks and review for corner cases. Lastly you have all the enterprise users who build packages from CCI, they prefer constancy so they can more easily patch and fix large amount of recipes at once. We do not support this but the more uniform a recipe gets the easier they re to wrk with. |
Thank you very much for detailed explanation and taking time for review. Basically I am okay with it and happy to do the things right way. Some stuff was just very new to me, I've never seen in that context. But now, I can say, that a lot of developers writing recipes ...hmmh... not completely right :D |
❤️ Just trying to fill in the context since this project has changed over the last almost 4 years :) |
* nodejs: conanfile.py: prepare for v18 Signed-off-by: Alexander Kozhinov <[email protected]> * test_package: conanfile.py: update for conan v2 usage Signed-off-by: Alexander Kozhinov <[email protected]> * Update recipes/nodejs/all/conanfile.py Co-authored-by: Chris Mc <[email protected]> * nodejs: conanfile.py: remove compiler verification Signed-off-by: Alexander Kozhinov <[email protected]> * nodejs: test_package: rework for v1 and v2 Signed-off-by: Alexander Kozhinov <[email protected]> * Update recipes/nodejs/all/conanfile.py Co-authored-by: Chris Mc <[email protected]> * nodejse: conanfile.py: rework conan_version test Signed-off-by: Alexander Kozhinov <[email protected]> * Update recipes/nodejs/all/conanfile.py Co-authored-by: Gregor Jasny <[email protected]> * Update recipes/nodejs/all/test_package/conanfile.py Co-authored-by: Gregor Jasny <[email protected]> * Update recipes/nodejs/all/conanfile.py Co-authored-by: Gregor Jasny <[email protected]> * Update recipes/nodejs/all/conanfile.py Co-authored-by: Gregor Jasny <[email protected]> * nodejs: conanfile.py: use self.settings instead of self.info.settings Signed-off-by: Alexander Kozhinov <[email protected]> * nodejs: conanfile.py: do not use self.settings in source() method Signed-off-by: Alexander Kozhinov <[email protected]> * nodejs: conanfile.py: use subprocess in _glibc_version Signed-off-by: Alexander Kozhinov <[email protected]> * Update recipes/nodejs/all/conanfile.py Co-authored-by: Chris Mc <[email protected]> * Update recipes/nodejs/all/conanfile.py Co-authored-by: Chris Mc <[email protected]> * Update recipes/nodejs/all/conanfile.py Co-authored-by: Chris Mc <[email protected]> * Update recipes/nodejs/all/conanfile.py Co-authored-by: Chris Mc <[email protected]> * nodejs: conanfile.py: fix arch / revert _glibc_version Signed-off-by: Alexander Kozhinov <[email protected]> * nodejs: conanfile.py: remove dobule defined build() method Signed-off-by: Alexander Kozhinov <[email protected]> * nodejs: conanfile.py: fix glibc version aquisition Signed-off-by: Alexander Kozhinov <[email protected]> --------- Signed-off-by: Alexander Kozhinov <[email protected]> Co-authored-by: Chris Mc <[email protected]> Co-authored-by: Gregor Jasny <[email protected]>
Prepare nodjs package for version 18