Skip to content

Fix gfortran f951 lookup failure on cflinuxfs5#380

Merged
tnikolova82 merged 2 commits into
masterfrom
fix-cflinuxfs5-fortran-f951
Apr 14, 2026
Merged

Fix gfortran f951 lookup failure on cflinuxfs5#380
tnikolova82 merged 2 commits into
masterfrom
fix-cflinuxfs5-fortran-f951

Conversation

@tnikolova82
Copy link
Copy Markdown
Contributor

Summary

  • Fixes Fortran package compilation failure (hexbin, forecast, etc.) on cflinuxfs5 by setting GCC_EXEC_PREFIX in the R package installation environment
  • The bundled gfortran binary searches GCC's compiled-in libexec path for f951, which does not exist in the cflinuxfs5 runtime container
  • By setting GCC_EXEC_PREFIX to the R binary's bin directory (which contains the bundled f951), gfortran can locate it during install.packages()

Root Cause

The specs-switchblade-docker-cflinuxfs5 test fails on the fortran_required fixture with:

gfortran: fatal error: cannot execute 'f951': execvp: No such file or directory

The R binary artifact bundles both gfortran and f951 in R/bin/. At staging time, gfortran is found via PATH (set up by SetStagingEnvironment()), but when gfortran tries to invoke f951, it uses GCC's internal search paths (e.g. /usr/libexec/gcc/x86_64-linux-gnu/14/) rather than PATH. Since the cflinuxfs5 runtime Docker image doesn't have gfortran installed system-wide, f951 is not found at those paths.

Changes

  • src/r/supply/supply.go: Set GCC_EXEC_PREFIX env var in InstallPackages() pointing to $DEPS_DIR/<idx>/r/bin/ so the bundled gfortran finds f951
  • src/r/supply/supply_test.go: Added assertion verifying GCC_EXEC_PREFIX is set in the command environment

Testing

  • All 6 unit tests pass
  • The fix targets the failing specs-switchblade-docker-cflinuxfs5 build Please configure GITBOT #1 (10/11 tests pass, only fortran_required fails)

The bundled gfortran binary cannot find the f951 compiler frontend on
cflinuxfs5 because it searches GCC's compiled-in libexec path, which
does not exist in the runtime container. Set GCC_EXEC_PREFIX to point
to the R binary's bin directory (which contains f951) so gfortran can
locate it during CRAN package installation.
…ssion

GCC_EXEC_PREFIX caused gcc and g++ to fail with 'cannot execute cc1/cc1plus'
on cflinuxfs4 because those binaries are not in the R bin directory.
COMPILER_PATH adds extra search directories without overriding the default
paths, so gfortran finds f951 in the R bin dir while gcc/g++ still find
cc1/cc1plus in /usr/libexec/gcc/.
Copy link
Copy Markdown
Contributor

@ivanovac ivanovac left a comment

Choose a reason for hiding this comment

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

lgtm

@tnikolova82 tnikolova82 merged commit 7bbf18f into master Apr 14, 2026
6 checks passed
@tnikolova82 tnikolova82 deleted the fix-cflinuxfs5-fortran-f951 branch April 14, 2026 08:12
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