Skip to content
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

cmake-oldest-deps build is broken #6699

Closed
devjgm opened this issue Jun 5, 2021 · 3 comments · Fixed by #6701
Closed

cmake-oldest-deps build is broken #6699

devjgm opened this issue Jun 5, 2021 · 3 comments · Fixed by #6701
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@devjgm
Copy link
Contributor

devjgm commented Jun 5, 2021

GCB: https://console.cloud.google.com/cloud-build/builds;region=us-east1/0684b9b8-3891-44b1-82f6-527a15409384;tab=detail?project=cloud-cpp-testing-resources
Raw: https://storage.googleapis.com/cloud-cpp-community-publiclogs/logs/google-cloud-cpp/main/4032b07e9f3556d4d29d17ee2bb214d5d136292c/ubuntu-focal-cmake-oldest-deps/log-0684b9b8-3891-44b1-82f6-527a15409384.txt

This error is reproducible locally with:

$ ./ci/cloudbuild/build.sh -t cmake-oldest-deps-pr --docker
...
-------------------
|   Configuring   |
-------------------
-- Running vcpkg install
-- Running vcpkg install - failed
CMake Error at cmake-out/vcpkg/scripts/buildsystems/vcpkg.cmake:815 (message):
  vcpkg install failed.  See logs for more information:
  /workspace/cmake-out/build/vcpkg-manifest-install.log
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/CMakeDetermineSystem.cmake:93 (include)
  CMakeLists.txt:26 (project)


CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
...

The error is from vcpkg. The cmake-oldest-deps build clones vcpkg at head

git clone https://github.com/microsoft/vcpkg.git "${vcpkg_root}"

so the problem could be some recent commit to vcpkg that happened today.

Here are commits from today (June 4): https://github.com/microsoft/vcpkg/commits/master

@devjgm devjgm added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Jun 5, 2021
@devjgm
Copy link
Contributor Author

devjgm commented Jun 5, 2021

Here's vcpkg's manifest install log

$ cat /workspace/cmake-out/build/vcpkg-manifest-install.log
Detecting compiler hash for triplet x64-linux...
The following packages will be built and installed:
    abseil[core]:x64-linux -> 2020-09-23#3 -- /workspace/cmake-out/vcpkg/buildtrees/versioning/versions/abseil/184230b7622b1be5630f893dcecdaac7acde101f
    benchmark[core]:x64-linux -> 1.5.2 -- /workspace/cmake-out/vcpkg/buildtrees/versioning/versions/benchmark/9edadb1ffe2869bf6c1b2271e89576e05234e9a5
    c-ares[core]:x64-linux -> 1.17.1 -- /workspace/cmake-out/vcpkg/buildtrees/versioning/versions/c-ares/a35b0a23f91ec79cecdcb83c82840f7305dbd709
    crc32c[core]:x64-linux -> 1.1.1 -- /workspace/cmake-out/vcpkg/buildtrees/versioning/versions/crc32c/0e0e15c0dc05913aa952e8d0ce68b145ce8cdfdf
    curl[core,non-http,openssl,ssl]:x64-linux -> 7.74.0#3 -- /workspace/cmake-out/vcpkg/buildtrees/versioning/versions/curl/1f69a2a2ce714cb05b0c419b07c4da22ca0f40a6
    grpc[core]:x64-linux -> 1.33.1#3 -- /workspace/cmake-out/vcpkg/buildtrees/versioning/versions/grpc/1d0adf4a9c4f719dd9d0d22dd2bd58ba34ff921c
    gtest[core]:x64-linux -> 1.10.0#4 -- /workspace/cmake-out/vcpkg/buildtrees/versioning/versions/gtest/9f4e8f94a3fe61d4abcc1929129b2e21ad6cc066
    nlohmann-json[core]:x64-linux -> 3.9.1 -- /workspace/cmake-out/vcpkg/buildtrees/versioning/versions/nlohmann-json/3b9a6d5f3d94db5699d4448f717ff32e4ea5722b
    openssl[core]:x64-linux -> 1.1.1j -- /workspace/cmake-out/vcpkg/buildtrees/versioning/versions/openssl/009a7ee95741b939859c77b8e1ddd6c146ffe54e
    protobuf[core]:x64-linux -> 3.14.0#3 -- /workspace/cmake-out/vcpkg/buildtrees/versioning/versions/protobuf/9f8c80db7cf8a925199facba3ba0c6c8436c41c8
    re2[core]:x64-linux -> 2020-10-01 -- /workspace/cmake-out/vcpkg/buildtrees/versioning/versions/re2/f64f9d63a95c27658c5c67753cf2ab9a9272858e
    upb[core]:x64-linux -> 2020-08-19 -- /workspace/cmake-out/vcpkg/buildtrees/versioning/versions/upb/f62deabc33313987277b9c9b6fec1498d87f9164
    zlib[core]:x64-linux -> 1.2.11#9 -- /workspace/cmake-out/vcpkg/buildtrees/versioning/versions/zlib/827111046e37c98153d9d82bb6fa4183b6d728e4
Could not locate cached archive: /h/.cache/vcpkg/archives/1c/1c26b5e8e733fdb6b6d37fe3e8b663cf7b0029d1.zip
Could not locate cached archive: /h/.cache/vcpkg/archives/74/748dd8e84dca9b70f0a86f3e72ff0402bd762612.zip
Could not locate cached archive: /h/.cache/vcpkg/archives/d8/d889b1d6afaac2a524e8a475440454b99a6a685a.zip
Could not locate cached archive: /h/.cache/vcpkg/archives/45/45912841252eda4b72270cab27f38e336fd3317b.zip
Could not locate cached archive: /h/.cache/vcpkg/archives/c7/c70aaa0a1f45f04c88543e8bb7dd3676c18144a5.zip
Could not locate cached archive: /h/.cache/vcpkg/archives/13/1317c9ad306c60fa3438dc92fda0823893fcf9c8.zip
Could not locate cached archive: /h/.cache/vcpkg/archives/ba/bad02b61527b8e229e77bba4b885939eff1463f3.zip
Could not locate cached archive: /h/.cache/vcpkg/archives/6f/6f09cd5b05a4f18d9c75a0d9a0cfa8a76e292700.zip
Could not locate cached archive: /h/.cache/vcpkg/archives/79/79a27b170a00457c1dc61283b3035e7702c68b53.zip
Could not locate cached archive: /h/.cache/vcpkg/archives/75/757a2e6eedc58fdd55c9ddeccdd3cc5f3c6dd727.zip
Could not locate cached archive: /h/.cache/vcpkg/archives/2e/2e06a1c8d011635e05dd660dca09d4e0a7c42d23.zip
Could not locate cached archive: /h/.cache/vcpkg/archives/2f/2f7d78fbd8f5f89edc64b8dc76da1d83eb34f08a.zip
Could not locate cached archive: /h/.cache/vcpkg/archives/bf/bf41c28b7689798c2129045f8f93033fc2d598c7.zip
Starting package 1/13: abseil:x64-linux
Building package abseil[core]:x64-linux...
-- Installing port from location: /workspace/cmake-out/vcpkg/buildtrees/versioning/versions/abseil/184230b7622b1be5630f893dcecdaac7acde101f
-- Downloading https://github.com/abseil/abseil-cpp/archive/6f9d96a1f41439ac172ee2ef7ccd8edf0e5d068c.tar.gz -> abseil-abseil-cpp-6f9d96a1f41439ac172ee2ef7ccd8edf0e5d068c.tar.gz...
[DEBUG] Feature flag 'binarycaching' unset
[DEBUG] Feature flag 'manifests' unset
[DEBUG] Feature flag 'compilertracking' unset
[DEBUG] Feature flag 'registries' unset
[DEBUG] Feature flag 'versions' unset
[DEBUG] BuiltinRegistry initialized with: ""
[DEBUG] Using vcpkg-root: /workspace/cmake-out/vcpkg
[DEBUG] Using manifest-root: /workspace
[DEBUG] Using vcpkg_installed-root: /workspace/vcpkg_installed
[DEBUG] Waiting to take filesystem lock on /workspace/cmake-out/vcpkg/.vcpkg-root...
Failed to take the filesystem lock on /workspace/cmake-out/vcpkg/.vcpkg-root:
    Device or resource busy
[DEBUG] /workspace/cmake-out/vcpkg/buildtrees/_vcpkg/src/vcpkg-tool-2021-05-05-9f849c4c43e50d1b16186ae76681c27b0c1be9d9/src/vcpkg/vcpkgpaths.cpp(353)
[DEBUG] Exiting after 1502536 us (1500842 us)

CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:220 (message):

      Failed to download file.
      If you use a proxy, please check your proxy setting. Possible causes are:

      1. You are actually using an HTTP proxy, but setting HTTPS_PROXY variable
         to `https://address:port`. This is not correct, because `https://` prefix
         claims the proxy is an HTTPS proxy, while your proxy (v2ray, shadowsocksr
         , etc..) is an HTTP proxy. Try setting `http://address:port` to both
         HTTP_PROXY and HTTPS_PROXY instead.

      2. You are using Fiddler. Currently a bug (https://github.com/microsoft/vcpkg/issues/17752)
         will set HTTPS_PROXY to `https://fiddler_address:port` which lead to problem 1 above.
         Workaround is open Windows 10 Settings App, and search for Proxy Configuration page,
         Change `http=address:port;https=address:port` to `address`, and fill the port number.

      3. You proxy's remote server is out of service.

      In future vcpkg releases, if you are using Windows, you no longer need to set
      HTTP(S)_PROXY environment variables. Vcpkg will simply apply Windows IE Proxy
      Settings set by your proxy software. See (https://github.com/microsoft/vcpkg-tool/pull/49)
      and (https://github.com/microsoft/vcpkg-tool/pull/77)

      Otherwise, please submit an issue at https://github.com/Microsoft/vcpkg/issues

Call Stack (most recent call first):
  scripts/cmake/vcpkg_from_github.cmake:147 (vcpkg_download_distfile)
  buildtrees/versioning/versions/abseil/184230b7622b1be5630f893dcecdaac7acde101f/portfile.cmake:5 (vcpkg_from_github)
  scripts/ports.cmake:139 (include)


Error: Building package abseil:x64-linux failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `./vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: abseil:x64-linux
  Vcpkg version: 2021-05-05-unknownhash

Additionally, attach any relevant sections from the log files above.

@devjgm
Copy link
Contributor Author

devjgm commented Jun 5, 2021

I currently suspect: microsoft/vcpkg#13639

@devjgm
Copy link
Contributor Author

devjgm commented Jun 5, 2021

The relevant part of our build script where we use vcpkg and invoke cmake is here:

vcpkg_root="${PROJECT_ROOT}/cmake-out/vcpkg"
if [[ ! -d "${vcpkg_root}" ]]; then
mkdir -p "${vcpkg_root}"
# To enable versioning we need to clone the vcpkg history. It seems that
# vcpkg uses `git` to find out what was the state of their packages at a
# given "baseline" (totally reasonable, otherwise they would need to
# implement another version control system).
git clone https://github.com/microsoft/vcpkg.git "${vcpkg_root}"
fi
io::log_h2 "Bootstrapping vcpkg"
env CC="ccache ${CC}" CXX="ccache ${CXX}" "${vcpkg_root}"/bootstrap-vcpkg.sh
io::log_h2 "Configuring"
cmake -GNinja -S . -B cmake-out/build \
"-DCMAKE_TOOLCHAIN_FILE=${vcpkg_root}/scripts/buildsystems/vcpkg.cmake" \
"-DVCPKG_MANIFEST_DIR=ci/etc/oldest-deps" \
"-DVCPKG_FEATURE_FLAGS=versions,manifest"

devjgm added a commit to devjgm/google-cloud-cpp that referenced this issue Jun 5, 2021
Fixes: googleapis#6699

This PR changes the `cmake-oldest-deps` build to use a release tarball
of vcpkg, the same as our other builds that use vcpkg, instead of
cloning the whole vcpkg repo, which picks up new changes from vcpkg that
can break our build unexpectedly.

This change appears to work in my local tests, but I'm concerned that
it's wrong because the previous code had a comment saying that cloning
the repo was required. So I suppose this PR is just for discussion to
see if this is the right direction or if we should fix the issue some
other way.
devjgm added a commit to devjgm/google-cloud-cpp that referenced this issue Jun 5, 2021
Fixes: googleapis#6699

This PR factors the code to fetch the vcpkg repo into a library that's
reused in a couple places. It also clones the repo at a recent release
tag rather than cloning at HEAD which may break our builds and is not
hermetic, or downloading a tarball, which lacks git history.
devjgm added a commit to devjgm/google-cloud-cpp that referenced this issue Jun 5, 2021
Fixes: googleapis#6699

This PR factors the code to fetch the vcpkg repo into a library that's
reused in a couple places. It also clones the repo at a recent release
tag rather than cloning at HEAD which may break our builds and is not
hermetic, or downloading a tarball, which lacks git history.
devjgm added a commit to devjgm/google-cloud-cpp that referenced this issue Jun 5, 2021
Fixes: googleapis#6699

This PR factors the code to fetch the vcpkg repo into a library that's
reused in a couple places. It also clones the repo at a recent release
tag rather than cloning at HEAD which may break our builds and is not
hermetic, or downloading a tarball, which lacks git history.
devjgm added a commit to devjgm/google-cloud-cpp that referenced this issue Jun 5, 2021
Fixes: googleapis#6699

This PR factors the code to fetch the vcpkg repo into a library that's
reused in a couple places. It also clones the repo at a recent release
tag rather than cloning at HEAD which may break our builds and is not
hermetic, or downloading a tarball, which lacks git history.
devjgm added a commit that referenced this issue Jun 5, 2021
Fixes: #6699

This PR factors the code to fetch the vcpkg repo into a library that's
reused in a couple places. It also clones the repo at a recent release
tag rather than cloning at HEAD which may break our builds and is not
hermetic, or downloading a tarball, which lacks git history.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
1 participant