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

ENV (superenv / stdenv): Mark every future version of GCC above gcc-4.8 (including the as-of-current-writing gcc-7) as supporting C++11, which fixes ENV.cxx11 usage in Tigerbrew formulae. #767

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

akemin-dayo
Copy link
Contributor

@akemin-dayo akemin-dayo commented Oct 15, 2021

The previous version of the regular expression only detected gcc-4.8, gcc-4.9, and gcc-5 as supporting C++11, but erroneously fails to detect newer versions of GCC as supporting C++11.

This currently results in any Tigerbrew formulae using ENV.cxx11 to incorrectly throw an error when a user has the latest version of the gcc formula installed (which installs gcc-7 as of this writing).

The updated regular expression successfully detects not only gcc-7, but also future versions all the way up to gcc-99(!) for futureproofing purposes, in case the gcc formula gets updated to a newer version of GCC at some point in the future.


Here are some strings I tested against my modified regular expression to make sure it works correctly:
gcc-4.0 → No match
gcc-4.2 → No match
gcc-4.8Match
gcc-4.9Match
gcc-5Match
gcc-5.1Match
gcc-7Match
gcc-11Match
gcc-42Match
gcc-99Match

…luding the as-of-current-writing gcc-7) as supporting C++11, which fixes `ENV.cxx11` usage in Tigerbrew formulae.

The previous version of the regular expression only detected `gcc-4.8`, `gcc-4.9`, and `gcc-5` as supporting C++11, but erroneously fails to detect newer versions of GCC as supporting C++11.

This currently results in any Tigerbrew formulae using `ENV.cxx11` to incorrectly throw an error when a user has the latest version of the `gcc` formula installed (which installs `gcc-7` as of this writing).

The updated regular expression successfully detects not only `gcc-7`, but also future versions all the way up to `gcc-99`(!) for futureproofing purposes, in case the `gcc` formula gets updated to a newer version of GCC at some point in the future.
@akemin-dayo akemin-dayo force-pushed the c++11-gcc-support-detection-regex-fix branch from a1b7364 to 8cc569b Compare October 15, 2021 09:00
@akemin-dayo akemin-dayo changed the title ENV (superenv / stdenv): Mark every future version of GCC above gcc-4.8 (which includes the as-of-current-writing gcc-7) as supporting C++11, which fixes ENV.cxx11 usage in Tigerbrew formulae. ENV (superenv / stdenv): Mark every future version of GCC above gcc-4.8 (including the as-of-current-writing gcc-7) as supporting C++11, which fixes ENV.cxx11 usage in Tigerbrew formulae. Oct 15, 2021
akemin-dayo added a commit to akemin-dayo/tigerbrew that referenced this pull request Oct 15, 2021
…1` flag will be correctly passed on to GCC.

This depends on changes to ENV (superenv / stdenv) made in PR mistydemeo#767.

Interestingly, aria2 actually builds fine even without `ENV.cxx11` being present… but including it is a much better / "proper" way to do this.
akemin-dayo added a commit to akemin-dayo/tigerbrew that referenced this pull request Oct 16, 2021
…1` flag will be correctly passed on to GCC.

This depends on changes to ENV (superenv / stdenv) made in PR mistydemeo#767.

Interestingly, aria2 actually builds fine even without `ENV.cxx11` being present… but including it is a much better / "proper" way to do this.
@sevan
Copy link
Collaborator

sevan commented Nov 17, 2023

Just tried to use ENV.cxx11 in a formula with GCC 7 installed and needed the patches here before it would work.

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