[cpp] - Introducing new option for c++ template to install gcc from source.#337
[cpp] - Introducing new option for c++ template to install gcc from source.#337Kaniska244 wants to merge 15 commits intodevcontainers:mainfrom
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.
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.
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
reinstallGccVersionFromSourceto reinstall the gcc version from source overriding the default version provided by the OS.Changelog: Following changes done for this PR.
reinstallGccVersionFromSource.Checklist: