Skip to content

Find the bootstrapped go compiler - #4392

Merged
vvolkl merged 1 commit into
cvmfs:develfrom
kadircanyildirm-crypto:fix-find-bootstrapped-go
Aug 3, 2026
Merged

vvolkl merged 1 commit into
cvmfs:develfrom
kadircanyildirm-crypto:fix-find-bootstrapped-go

Conversation

@kadircanyildirm-crypto

Copy link
Copy Markdown
Contributor

This is the first pull request I've sent to CVMFS following the
discussion in #4373. Please let me know if there is anything I missed
during the process.

This applies @vvolkl's suggestion from #4373 as-is: find_program now
honors CVMFS_GO_DIR (CMake variable or environment, as exported by
ci/build_install_builddeps.sh) and falls back to
/go/bin, so a go bootstrapped by
ci/bootstrap_golang.sh is found in a plain cmake; make install
workflow.

Tested on Ubuntu 24.04 without a system go (ci/bootstrap_golang.sh,
then cmake -DBUILD_GATEWAY=ON -DBUILTIN_EXTERNALS_EXCLUDE=golang_rev2):
configure fails with "go compiler not found" before this change and
finds the bootstrapped go with it; CVMFS_GO_DIR alone also works, a go
on PATH is still found when the hints are empty, and gateway, ducc and
snapshotter all build with the located compiler. I used AI assistance
for testing and drafting; the change itself is unchanged from the
suggestion.

A go toolchain bootstrapped by ci/bootstrap_golang.sh into the
externals install location was not found by find_program in a plain
`cmake; make install` workflow. Honor CVMFS_GO_DIR (CMake variable or
environment, as exported by ci/build_install_builddeps.sh) and fall
back to <externals install location>/go/bin.

Suggested-by: Valentin Volkl <[email protected]>

@vvolkl vvolkl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the PR!

@vvolkl
vvolkl merged commit cc6b557 into cvmfs:devel Aug 3, 2026
18 checks passed
@andrey-utkin

Copy link
Copy Markdown
Contributor

Current devel as of commit cc6b557 still fails to bootstrap on clean Ubuntu 24.04:

podman exec --workdir "/usr/local/src/cvmfs"/build "vanilla-ubuntu_24.04"  bash -l -c "cmake  .. -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_BUILD_TYPE=Debug -DBUILD_GEOAPI=no  -DBUILD_SERVER=yes -DBUILD_SERVER_DEBUG=yes -DBUILD_LIBCVMFS=yes -DBUILD_LIBCVMFS_CACHE=yes -DBUILD_SHRINKWRAP=yes -DBUILD_DUCC=no  -DBUILD_RECEIVER=yes -DBUILD_RECEIVER_DEBUG=yes -DBUILD_ZLIB_NG=ON -DCFLAGS="-DCVMFS_SUPPRESS_ASSERTS=1" -DBUILD_UNITTESTS=ON -DINSTALL_UNITTESTS=ON -DBUILD_UNITTESTS_DEBUG=ON -DBUILD_GATEWAY=yes -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX:PATH=/usr  -DBUILD_UBENCHMARKS=no -DBUILD_STRESS_TESTS=yes -DBUILD_DOCUMENTATION=no -DBUILD_QC_TESTS=no -DBUILD_COVERAGE=no -DENABLE_ASAN=no -DBUILD_SNAPSHOTTER=yes -DBUILD_POSIX_TOOLS=yes """
...
Downloading Go Binaries ...
Downloading https://go.dev/dl/go1.24.2.linux-amd64.tar.gz ...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    75  100    75    0     0    331      0 --:--:-- --:--:-- --:--:--   331
100 74.8M  100 74.8M    0     0  8123k      0  0:00:09  0:00:09 --:--:-- 9868k
/usr/local/src/cvmfs
--> Building golang_rev2
rm: cannot remove '/usr/local/src/cvmfs/externals_install.x86_64.ubuntu24.04/bin/go': No such file or directory
rm: cannot remove '/usr/local/src/cvmfs/externals_install.x86_64.ubuntu24.04/bin/gofmt': No such file or directory
ln: failed to create symbolic link '/usr/local/src/cvmfs/externals_install.x86_64.ubuntu24.04/bin/go': No such file or directory
ln: failed to create symbolic link '/usr/local/src/cvmfs/externals_install.x86_64.ubuntu24.04/bin/gofmt': No such file or directory
CMake Error at CMakeLists.txt:291 (message):
  bootstrapping failed


-- Configuring incomplete, errors occurred!

@kadircanyildirm-crypto

Copy link
Copy Markdown
Contributor Author

This failure happens one step before the change in this PR: on a clean tree the externals bootstrap only creates include/ and lib/, so the go symlinks into the missing bin/ directory fail. That part is addressed by #4373.

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.

3 participants