-
Notifications
You must be signed in to change notification settings - Fork 313
[cpp] - Introducing new option for c++ template to install gcc from source. #337
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
base: main
Are you sure you want to change the base?
Conversation
if command -v gcc &>/dev/null; then | ||
installed_version=$(gcc -dumpfullversion) | ||
if [ "$(printf '%s\n' "$installed_version" "$GCC_VERSION" | sort -V | tail -n1)" = "$installed_version" ]; then | ||
echo "Installed GCC version ($installed_version) is equal or newer than requested version ($GCC_VERSION). Skipping installation." |
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.
I wonder why the installation should be skipped in this scenario? I interpret the introduced reinstallGccVersionFromSource
option as a request from the image user to install one specific GCC version. This condition here turns that option into a specifying a minimum GCC version instead of a specific 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.
The rationale behind this is that if the default GCC version is higher than that of the one specified in the template, then its better to retain the default one as it would already contain better features compared to the given GCC
version in the template. Besides the actual issue was created to be able to use GCC 14 & 15 versions which were not available by default with the image.
Ref# devcontainers/images#1280
Description: New option to be introduced
reinstallGccVersionFromSource
to reinstall the gcc version from source overriding the default version provided by the OS.Changelog: Following changes done for this PR.
reinstallGccVersionFromSource
.Checklist: