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

configure: fix comparing double-digit versions #21183

Closed

Conversation

mistydemeo
Copy link
Contributor

  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Performing this comparison using strings means that 10 is considered to be smaller than 3, which is not correct in this case. It results in spurious "compiler is too old" warnings. Since the values are already parsed into tuples, this does the comparison using all three values of the tuple instead of comparing them as x.y.z strings.

This patch fixes a warning not addressed in #21173.
Refs #21175.

@nodejs-github-bot nodejs-github-bot added the build Issues and PRs related to build files or the CI. label Jun 6, 2018
Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

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

Hi, @mistydemeo and welcome! Thanks for the fix!

@Trott
Copy link
Member

Trott commented Jun 7, 2018

@apapirovski
Copy link
Member

Could the tuples not be compared directly rather than creating a helper function? Been a while since I wrote any python...

@mistydemeo
Copy link
Contributor Author

I didn't think that would work, but lo and hehold: https://docs.python.org/2.7/tutorial/datastructures.html#comparing-sequences-and-other-types

I'll update this to use that.

@mistydemeo mistydemeo force-pushed the configure_fix_clang_warning branch from 6462d4e to 5759b3e Compare June 7, 2018 22:48
@apapirovski
Copy link
Member

@Trott
Copy link
Member

Trott commented Jun 9, 2018

@Trott Trott added the python PRs and issues that require attention from people who are familiar with Python. label Jun 9, 2018
Trott pushed a commit to Trott/io.js that referenced this pull request Jun 9, 2018
Compare versions using tuples instead of strings so that it is
future-proofed against versions that contain a number that is more than
one digit.

PR-URL: nodejs#21183
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
@Trott
Copy link
Member

Trott commented Jun 9, 2018

Landed in 641d4a4.
Thanks for the contribution! 🎉

@Trott Trott closed this Jun 9, 2018
targos pushed a commit that referenced this pull request Jun 10, 2018
Compare versions using tuples instead of strings so that it is
future-proofed against versions that contain a number that is more than
one digit.

PR-URL: #21183
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Trott pushed a commit to Trott/io.js that referenced this pull request Jun 13, 2018
Compare versions using tuples instead of strings so that it is
future-proofed against versions that contain a number that is more than
one digit.

PR-URL: nodejs#21183
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
@Trott
Copy link
Member

Trott commented Jun 13, 2018

This land cleanly on all current release lines except v6.x-staging. I'll open a backport PR.

@richardlau
Copy link
Member

Setting lts-watch-v8.x label based on #21299 (comment).

Trott pushed a commit to Trott/io.js that referenced this pull request Jun 13, 2018
Compare versions using tuples instead of strings so that it is
future-proofed against versions that contain a number that is more than
one digit.

PR-URL: nodejs#21183
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jun 14, 2018
Compare versions using tuples instead of strings so that it is
future-proofed against versions that contain a number that is more than
one digit.

PR-URL: #21183
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jun 14, 2018
Compare versions using tuples instead of strings so that it is
future-proofed against versions that contain a number that is more than
one digit.

Backport-PR-URL: #21301
PR-URL: #21183
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Jul 9, 2018
rvagg pushed a commit that referenced this pull request Aug 16, 2018
Compare versions using tuples instead of strings so that it is
future-proofed against versions that contain a number that is more than
one digit.

PR-URL: #21183
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
rvagg pushed a commit that referenced this pull request Aug 16, 2018
Compare versions using tuples instead of strings so that it is
future-proofed against versions that contain a number that is more than
one digit.

Backport-PR-URL: #21301
PR-URL: #21183
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
rvagg pushed a commit that referenced this pull request Nov 24, 2018
Compare versions using tuples instead of strings so that it is
future-proofed against versions that contain a number that is more than
one digit.

Backport-PR-URL: #21301
PR-URL: #21183
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
rvagg pushed a commit that referenced this pull request Nov 28, 2018
Compare versions using tuples instead of strings so that it is
future-proofed against versions that contain a number that is more than
one digit.

Backport-PR-URL: #21301
PR-URL: #21183
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 26, 2018
Compare versions using tuples instead of strings so that it is
future-proofed against versions that contain a number that is more than
one digit.

Backport-PR-URL: #21301
PR-URL: #21183
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
rvagg pushed a commit that referenced this pull request Feb 28, 2019
Compare versions using tuples instead of strings so that it is
future-proofed against versions that contain a number that is more than
one digit.

Backport-PR-URL: #21301
PR-URL: #21183
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
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. python PRs and issues that require attention from people who are familiar with Python.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants