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

Correctly detect major version of GCC #20059

Merged
merged 1 commit into from
Jul 18, 2022

Conversation

kraptor
Copy link
Contributor

@kraptor kraptor commented Jul 18, 2022

We were doing a very poor job detecting the major version of GCC by
parsing the output of --version.

This patch uses -dumpversion to make this parsing straightforward and
it also fixes compiling issues on different platforms with
custom output for --version switches. For example, openSUSE first line
of the output includes the revision number and the parsing that was
being done did mix that number with the major version and breaks
building the compiler (as it doesn't find the 3 dots for an X.Y.Z semver
format).

In this patch, we simply use -dumpversion (which has been at least from
1993, so we are safe :)

@kraptor kraptor force-pushed the fix-gcc-major-version-detection branch from 4ee541c to 6c2692d Compare July 18, 2022 10:13
@kraptor kraptor force-pushed the fix-gcc-major-version-detection branch from 6c2692d to 48b2e00 Compare July 18, 2022 17:01
We were doing a very poor job detecting the major version of GCC by
parsing the output of --version.

This patches uses -dumpversion to make this parsing straightforward and
it also fixes a bunch of compiling issues on different platforms with
custom output for --version switches. For example, openSUSE first line
of the output includes the revision number and the parsing that was
being done did mix that number with the major version and breaks
building the nim compiler (as it doesn't find the 3 dots for an X.Y.Z semver
format, hence returning "false").

In this patch, we simply use -dumpversion (which has been at least from
1993, so we are safe :)
@kraptor kraptor force-pushed the fix-gcc-major-version-detection branch from 48b2e00 to 96de82e Compare July 18, 2022 17:03
@Araq Araq merged commit efcb89f into nim-lang:devel Jul 18, 2022
@github-actions
Copy link
Contributor

Thanks for your hard work on this PR!
The lines below are statistics of the Nim compiler built from efcb89f

Hint: mm: orc; threads: on; opt: speed; options: -d:release
163439 lines; 14.706s; 841.164MiB peakmem

narimiran pushed a commit that referenced this pull request Jul 25, 2022
We were doing a very poor job detecting the major version of GCC by
parsing the output of --version.

This patches uses -dumpversion to make this parsing straightforward and
it also fixes a bunch of compiling issues on different platforms with
custom output for --version switches. For example, openSUSE first line
of the output includes the revision number and the parsing that was
being done did mix that number with the major version and breaks
building the nim compiler (as it doesn't find the 3 dots for an X.Y.Z semver
format, hence returning "false").

In this patch, we simply use -dumpversion (which has been at least from
1993, so we are safe :)

(cherry picked from commit efcb89f)
FedericoCeratto pushed a commit to FedericoCeratto/Nim that referenced this pull request Jul 30, 2022
We were doing a very poor job detecting the major version of GCC by
parsing the output of --version.

This patches uses -dumpversion to make this parsing straightforward and
it also fixes a bunch of compiling issues on different platforms with
custom output for --version switches. For example, openSUSE first line
of the output includes the revision number and the parsing that was
being done did mix that number with the major version and breaks
building the nim compiler (as it doesn't find the 3 dots for an X.Y.Z semver
format, hence returning "false").

In this patch, we simply use -dumpversion (which has been at least from
1993, so we are safe :)
@kraptor kraptor deleted the fix-gcc-major-version-detection branch December 30, 2022 08:35
capocasa pushed a commit to capocasa/Nim that referenced this pull request Mar 31, 2023
We were doing a very poor job detecting the major version of GCC by
parsing the output of --version.

This patches uses -dumpversion to make this parsing straightforward and
it also fixes a bunch of compiling issues on different platforms with
custom output for --version switches. For example, openSUSE first line
of the output includes the revision number and the parsing that was
being done did mix that number with the major version and breaks
building the nim compiler (as it doesn't find the 3 dots for an X.Y.Z semver
format, hence returning "false").

In this patch, we simply use -dumpversion (which has been at least from
1993, so we are safe :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants