Describe the bug
after commit :
e62d13612 ("[vcpkg] Add Supports: field. Use contents of triplets instead of names for dependency resolution. (#8601)", 2020-02-03)
Environment
To Reproduce
Steps to reproduce the behavior:
Expected behavior
should build vcpkg
Failure logs
[c7-local vcpkg]$ ./bootstrap-vcpkg.sh
-- The C compiler identification is GNU 8.3.1
-- The CXX compiler identification is GNU 8.3.1
-- Check for working C compiler: /opt/rh/devtoolset-8/root/usr/bin/cc
-- Check for working C compiler: /opt/rh/devtoolset-8/root/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /opt/rh/devtoolset-8/root/usr/bin/g++
-- Check for working CXX compiler: /opt/rh/devtoolset-8/root/usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
-- Performing Test LINKS_TO_STDCXX_FS
-- Performing Test LINKS_TO_STDCXX_FS - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mitra/vcpkg/toolsrc/build.rel
[0/2] Re-checking globbed directories...
[14/69] Building CXX object CMakeFiles/vcpkglib.dir/src/vcpkg/binaryparagraph.cpp.o
FAILED: CMakeFiles/vcpkglib.dir/src/vcpkg/binaryparagraph.cpp.o
/opt/rh/devtoolset-8/root/usr/bin/g++ -DDISABLE_METRICS=0 -I../include -O3 -DNDEBUG -std=c++1z -pthread -MD -MT CMakeFiles/vcpkglib.dir/src/vcpkg/binaryparagraph.cpp.o -MF CMakeFiles/vcpkglib.dir/src/vcpkg/binaryparagraph.cpp.o.d -o CMakeFiles/vcpkglib.dir/src/vcpkg/binaryparagraph.cpp.o -c ../src/vcpkg/binaryparagraph.cpp
../src/vcpkg/binaryparagraph.cpp:31:5: note: ‘vcpkg::BinaryParagraph::BinaryParagraph()’ is implicitly deleted because the default definition would be ill-formed:
BinaryParagraph::BinaryParagraph() = default;
^~~~~~~~~~~~~~~
../src/vcpkg/binaryparagraph.cpp:31:5: error: use of deleted function ‘vcpkg::PackageSpec::PackageSpec()’
In file included from ../include/vcpkg/binaryparagraph.h:3,
from ../src/vcpkg/binaryparagraph.cpp:7:
../include/vcpkg/packagespec.h:26:9: note: ‘vcpkg::PackageSpec::PackageSpec() noexcept’ is implicitly deleted because its exception-specification does not match the implicit exception-specification ‘’
PackageSpec() noexcept = default;
^~~~~~~~~~~
../src/vcpkg/binaryparagraph.cpp: In constructor ‘vcpkg::BinaryParagraph::BinaryParagraph(vcpkg::Parse::RawParagraph)’:
../src/vcpkg/binaryparagraph.cpp:33:64: error: use of deleted function ‘vcpkg::PackageSpec::PackageSpec()’
BinaryParagraph::BinaryParagraph(Parse::RawParagraph fields)
^
../src/vcpkg/binaryparagraph.cpp: In constructor ‘vcpkg::BinaryParagraph::BinaryParagraph(const vcpkg::SourceParagraph&, const vcpkg::Triplet&, const string&, const std::vector<vcpkg::FeatureSpec>&)’:
../src/vcpkg/binaryparagraph.cpp:87:25: error: use of deleted function ‘vcpkg::PackageSpec::PackageSpec()’
, type(spgh.type)
^
../src/vcpkg/binaryparagraph.cpp: In constructor ‘vcpkg::BinaryParagraph::BinaryParagraph(const vcpkg::SourceParagraph&, const vcpkg::FeatureParagraph&, const vcpkg::Triplet&, const std::vector<vcpkg::FeatureSpec>&)’:
../src/vcpkg/binaryparagraph.cpp:98:101: error: use of deleted function ‘vcpkg::PackageSpec::PackageSpec()’
: version(), description(fpgh.description), maintainer(), feature(fpgh.name), type(spgh.type)
^
[19/69] Building CXX object CMakeFiles/vcpkglib.dir/src/vcpkg/build.cpp.o
ninja: build stopped: subcommand failed.
I encountered the same problem as above.
Same behaviour with a fresh CentOS installation with devtoolset-8.
I manage to compile by removing noexcept keyword of default constructors in file packagespec.h :
PackageSpec() noexcept = default; to PackageSpec() = default; (line 22)
FullPackageSpec() noexcept = default; to FullPackageSpec() = default; (line 99)
With this workaround, it's compiling in Linux (CentOS) and Windows.
Same issue, MarcKLohr's work-around worked for me in CentOS 7.
The question remains: why does it compile in Ubnutu with gcc 8 ?
I encountered the same problem as above.
Same problem on Centos 7 - devtoolset-7 - gcc 7.3.1
MarcKLohr's work-around worked for me
it seems vcpkg has dropped support for centos starting in 2020
vcpkg with git tag 2019.12 is the lat one that works
On some platforms, the standard libraries might not yet be fully C++17 compliant.
Perfect fix would require checking for std::is_nothrow_default_constructible(std::basic_string) before declaring that PackageSpec is noexcept. Similarly, a check for std::is_nothrow_default_constructible(std::vector<std::string>) would be required for FullPackageSpec. The enclosing class can not have a noexcept default constructor if one of the members can throw in it own default constructor.
I will add that the workaround posted by @MarcKLohr still works as of the latest commit of Master, #11559 (tested on CentOS 7.6 (x64) with G++ 7.3 and 8.3 as provided in devtoolset-7 and devtoolset-8).
After I finished that, I did encounter 1 other error that turned out to be unrelated. Due to a lack of adequate RAM (a total of 1GB) on the server where VCPKG was being compiled, the bootstrap script would fail at step 22:
[22/75] Building CXX object CMakeFiles/vcpkglib.dir/src/vcpkg/build.cpp.o
FAILED: CMakeFiles/vcpkglib.dir/src/vcpkg/build.cpp.o
/opt/rh/devtoolset-8/root/usr/bin/g++ -DVCPKG_DISABLE_METRICS=0 -DVCPKG_USE_STD_FILESYSTEM=1 -I../include -O3 -DNDEBUG -pthread -std=c++17 -MD -MT CMakeFiles/vcpkglib.dir/src/vcpkg/build.cpp.o -MF CMakeFiles/vcpkglib.dir/src/vcpkg/build.cpp.o.d -o CMakeFiles/vcpkglib.dir/src/vcpkg/build.cpp.o -c ../src/vcpkg/build.cpp
g++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
[23/75] Building CXX object CMakeFiles/vcpkglib.dir/src/vcpkg/cmakevars.cpp.o
ninja: build stopped: subcommand failed.
I resolved this by creating a swap file:
sudo dd if=/dev/zero of=/swapfile bs=1024 count=1048576
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
With the extra "memory", the compiler was able to compile VCC correctly (bootstrap-vcpkg.sh). After that, I removed the swapfile with:
sudo swapoff /swapfile
sudo rm /swapfile
Hopefully this will help anyone having the same headaches as I did.
So does someone have the balls to apply the patch as mentioned by MarcKLohr above ?
Why does vcpkg insist on using language features more advanced than the libraries being installed?
I manage to compile by removing noexcept keyword of default constructors in file packagespec.h :
PackageSpec() noexcept = default;toPackageSpec() = default; (line 22)
FullPackageSpec() noexcept = default;toFullPackageSpec() = default; (line 99).
@BillyONeal What do you think?
I think not
I am using my own fork for now,where I really try to avoid adding any new annoying 'features' or unecessary updates just to be c++ latest compliant.
vcpkg is oss, so essentially a play ground for testing new and cool stuff. No actual target definitions for what it is supposed to be useful.
However, as vcpkg builds got broken recently for vc2015, someone mentioned that the backward compatibitlty to vc2015 actually is a target, and the problem got fixed.
So I ask, why not also Centos7. Its bad enough c++11 isn't enough anymore (gcc 4.8),
Centos7 is not exactly a rare platform for real world projects.
@ras0219 @ras0219-msft I think your binary caching changes might have broken this?
So I ask, why not also Centos7. Its bad enough c++11 isn't enough anymore (gcc 4.8),
We don't hate Centos7 or anything, that just isn't offered as one of the default Azure VMs so it is considerably more difficult for us to test. We should almost certainly fix this...
Sorry for the long delay on getting this fixed; I've opened #12201 which fixes the issue for now, however it does not introduce CentOS testing into our CI system.
I would really appreciate anyone on this thread experiencing this issue to chime in on the PR and confirm it solves the problem!
confirmed ./bootstrap.sh works now on Centos7 with devtoolset-8.
Would you mind adding a tag 2020.07 or so, it seems like a 'milestone' that centos7 is back >6 months after the working 2019.12 tag?
Thx,
Most helpful comment
Same behaviour with a fresh CentOS installation with devtoolset-8.
I manage to compile by removing noexcept keyword of default constructors in file packagespec.h :
PackageSpec() noexcept = default;toPackageSpec() = default; (line 22)FullPackageSpec() noexcept = default;toFullPackageSpec() = default; (line 99)With this workaround, it's compiling in Linux (CentOS) and Windows.