Skip to content

Conversation

danieljprice
Copy link
Contributor

Implementation of version: latest parsing, fixes #136 and #33

version: latest is now default for gcc and lfortran installations (since they use package managers) while also defaults to the latest "known" version for intel if explicitly specified in the workflow, e.g.

  - uses: fortran-lang/setup-fortran@v1
     with:
       compiler: intel
       version: latest

If the version option is not explicitly specified, the updated defaults are now:

gcc: latest
lfortran: latest
intel-classic: 2023.2.0 (pinned)
intel: 2025.0 (pinned)
nvidia-hpc: 25.1 (pinned)

The main changes to the logic are:

  • install_gcc_brew: Uses brew install gcc without version pinning for version: latest
  • install_gcc_apt: Installs gcc gfortran g++ without version pinning for version: latest
  • install_gcc_choco: Install unpinned gcc via choco install for version: latest
  • install_intel_apt: Installs last known version of Intel packages when version: latest, but only if version: latest explicitly specified
  • install_lfortran_*: All platforms install unpinned lfortran when latest

Note that the Cache key in action.yml uses ${{ inputs.version || 'latest' }} instead of just ${{ inputs.version }}. This ensures that when no version is specified, it defaults to 'latest' in the cache key. This should prevent cache conflicts between different "latest" installs.

Copy link
Contributor

@wpbonelli wpbonelli left a comment

Choose a reason for hiding this comment

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

thanks for doing this @danieljprice. what happens if you use

    compiler: intel
    version: latest

with an OS matrix? it will only work on linux right, and will fail on windows and mac? I'm tempted to say, for consistency's sake, map intel/latest to the most recent version supported on all platforms. or only support "latest" for gcc and lfortran for now

looks like the test matrix needs pruning, I'll work on that separately

Copy link
Contributor

@wpbonelli wpbonelli left a comment

Choose a reason for hiding this comment

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

with an OS matrix? it will only work on linux right, and will fail on windows and mac? I'm tempted to say, for consistency's sake, map intel/latest to the most recent version supported on all platforms. or only support "latest" for gcc and lfortran for now

on second thought, I think the inconsistency is fine, we often have inconsistent version support anyway whenever a new version of something is published there is some lag between apt, brew and chocolatey

@wpbonelli wpbonelli merged commit 911b7c6 into fortran-lang:main Sep 4, 2025
142 of 162 checks passed
@wpbonelli wpbonelli mentioned this pull request Sep 4, 2025
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.

option to just install latest version of a compiler
2 participants