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

bootstrap failed to build on Centos (devtoolset-7, 8) #9955

Closed
yamcenutzer opened this issue Feb 7, 2020 · 15 comments · Fixed by #12201
Closed

bootstrap failed to build on Centos (devtoolset-7, 8) #9955

yamcenutzer opened this issue Feb 7, 2020 · 15 comments · Fixed by #12201
Assignees
Labels
category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)

Comments

@yamcenutzer
Copy link

yamcenutzer commented Feb 7, 2020

Describe the bug
after commit :
e62d136 ("[vcpkg] Add Supports: field. Use contents of triplets instead of names for dependency resolution. (#8601)", 2020-02-03)

Environment

  • OS: Centos 7
  • Compiler: Gcc 7, gcc 8 (devtoolset-7, devtoolset-8)

To Reproduce
Steps to reproduce the behavior:

  1. ./bootstrap-vcpkg.sh
  2. See error below, example is for devtoolset-8 (gcc8.3.1), same happens with devtoolset-7(gcc7xx). Interestingly, it does work on ubuntu1804 with the builtin gcc 8.3.0

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.
@JackBoosY JackBoosY added the category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) label Feb 7, 2020
@li-wu
Copy link
Contributor

li-wu commented Feb 15, 2020

I encountered the same problem as above.

@MarcKLohr
Copy link

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.

@patrick-i-mosher
Copy link

Same issue, MarcKLohr's work-around worked for me in CentOS 7.

@yamcenutzer
Copy link
Author

The question remains: why does it compile in Ubnutu with gcc 8 ?

@zydxhs
Copy link

zydxhs commented Feb 19, 2020

I encountered the same problem as above.

@BaldurMar
Copy link

Same problem on Centos 7 - devtoolset-7 - gcc 7.3.1
MarcKLohr's work-around worked for me

@yamcenutzer
Copy link
Author

it seems vcpkg has dropped support for centos starting in 2020
vcpkg with git tag 2019.12 is the lat one that works

@JGamache-autodesk
Copy link

JGamache-autodesk commented Apr 29, 2020

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.

@amacgillivray
Copy link

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.

@yamcenutzer
Copy link
Author

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; to PackageSpec() = default; (line 22)
FullPackageSpec() noexcept = default; to FullPackageSpec() = default; (line 99)

.

@JackBoosY
Copy link
Contributor

@BillyONeal What do you think?

@yamcenutzer
Copy link
Author

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.

@BillyONeal
Copy link
Member

@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...

@ras0219
Copy link
Contributor

ras0219 commented Jul 1, 2020

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!

ras0219-msft added a commit that referenced this issue Jul 2, 2020
#12201)

Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
@yamcenutzer
Copy link
Author

yamcenutzer commented Jul 2, 2020

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,

E452003 added a commit to E452003/vcpkg that referenced this issue Jul 6, 2020
* 'master' of https://github.com/microsoft/vcpkg: (1418 commits)
  [vcpkg integrate] Clean up vcpkg.target file (microsoft#4608)
  [vcpkg_from_sourceforge] Add retry mirror function (2/2) (microsoft#12018)
  [pcre2] Restore the https://ftp.pcre.org/ mirror in addition to the SourceForge mirrors. (microsoft#12233)
  [xercesc] rename feature from xmlch_wchar to xmlch-wchar (microsoft#12205)
  [safeint] Update to 3.24 (microsoft#12217)
  [vcpkg] Remove the tombstones and 'ignore' baseline concepts. (microsoft#12197)
  [msbuild] Revert the importance to Normal (microsoft#12212)
  [vtk] Added opengl feature. (microsoft#11399)
  [span-lite] Update to 0.7.0 (microsoft#12206)
  [cmocka libarchive libiconv libpq libxml2 plibsys] fix drive-by error in vcpkg-cmake-wrappers (microsoft#12196)
  [azure-iot-sdk-c] Fix feature name and enable to build (microsoft#12209)
  [vcpkg] Improve performance of compiler tracking by suppressing aspects of CMake's compiler detection. (microsoft#12203)
  [vcpkg] Remove all uses of Foo::Foo() noexcept = default; to fix microsoft#9955 (microsoft#12201)
  [sqlite3] update to 3.32.3 to deal with security issues (microsoft#12185)
  [infoware] Bump version to 0.5.4 (microsoft#12167)
  [imgui] Update to 1.77 (microsoft#12155)
  [vcpkg] Update message in bootstrap.ps1 (microsoft#12145)
  [vcpkg] Enable NuGet-based binary caching via mono (microsoft#12170)
  Don't change manifest root when manifest isn't enabled. (microsoft#12191)
  Fix sourceparagraph:BooleanField (microsoft#12192)
  ...
strega-nil pushed a commit to strega-nil/vcpkg that referenced this issue May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)
Projects
None yet
Development

Successfully merging a pull request may close this issue.