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

[vcpkg] Warning (as error) when building vcpgk/toolsrc with clang++ 10 or g++ 9.3 #15148

Closed
klalumiere opened this issue Dec 16, 2020 · 0 comments · Fixed by #15149
Closed

[vcpkg] Warning (as error) when building vcpgk/toolsrc with clang++ 10 or g++ 9.3 #15148

klalumiere opened this issue Dec 16, 2020 · 0 comments · Fixed by #15149
Assignees
Labels
category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)

Comments

@klalumiere
Copy link
Contributor

Describe the bug
There are 3 warnings that prevent the compilation since -Werror is enabled. I'll paste the log below.

Environment

  • OS: Ubuntu 20.04
  • Compiler: I tried both clang version 10.0.0-4ubuntu1 and g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0

To Reproduce

  1. cd toolsrc
  2. mkdir debug
  3. cd debug
  4. cmake -DCMAKE_BUILD_TYPE=Debug -G Ninja ..
  5. cmake --build .

Expected behavior
I expected the compilation to succeed.

Failure logs

First warning:

[13/114] Building CXX object CMakeFiles/vcpkg-test.dir/src/vcpkg-test/dependencies.cpp.o
FAILED: CMakeFiles/vcpkg-test.dir/src/vcpkg-test/dependencies.cpp.o 
/usr/bin/g++  -DVCPKG_USE_STD_FILESYSTEM=1 -I../include -g   -Wall -Wextra -Wpedantic -Wno-unknown-pragmas -Wno-missing-field-initializers -Wno-redundant-move -Wmissing-declarations -Werror -std=c++17 -MD -MT CMakeFiles/vcpkg-test.dir/src/vcpkg-test/dependencies.cpp.o -MF CMakeFiles/vcpkg-test.dir/src/vcpkg-test/dependencies.cpp.o.d -o CMakeFiles/vcpkg-test.dir/src/vcpkg-test/dependencies.cpp.o -c ../src/vcpkg-test/dependencies.cpp
../src/vcpkg-test/dependencies.cpp:606:96: error: integer constant is so large that it is unsigned [-Werror]
  606 |     check_relaxed_version(version_long, {1, 20, 300, 4000, 50000, 6000000, 70000000, 80000000, 18446744073709551610});
      |                                                                                                ^~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors

Second warning:

[80/102] Building CXX object CMakeFiles/vcpkglib.dir/src/vcpkg/portfileprovider.cpp.o
FAILED: CMakeFiles/vcpkglib.dir/src/vcpkg/portfileprovider.cpp.o 
/usr/bin/clang++  -DVCPKG_USE_STD_FILESYSTEM=1 -I../include -g   -Wall -Wextra -Wpedantic -Wno-unknown-pragmas -Wno-missing-field-initializers -Wno-redundant-move -Wmissing-prototypes -Werror -include /home/klalumiere/Projects/vcpkg-klalumiere/toolsrc/include/pch.h -pthread -std=c++17 -MD -MT CMakeFiles/vcpkglib.dir/src/vcpkg/portfileprovider.cpp.o -MF CMakeFiles/vcpkglib.dir/src/vcpkg/portfileprovider.cpp.o.d -o CMakeFiles/vcpkglib.dir/src/vcpkg/portfileprovider.cpp.o -c ../src/vcpkg/portfileprovider.cpp
In file included from <built-in>:1:
In file included from /home/klalumiere/Projects/vcpkg-klalumiere/toolsrc/include/pch.h:5:
In file included from ../include/vcpkg/base/files.h:14:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/filesystem:37:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/fs_path.h:37:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/locale:43:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/locale_conv.h:41:
/usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/unique_ptr.h:81:2: error: delete called on non-final 'vcpkg::PortFileProvider::PathsPortFileProvider' that has virtual functions but non-virtual destructor [-Werror,-Wdelete-non-abstract-non-virtual-dtor]
        delete __ptr;
        ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/unique_ptr.h:292:4: note: in instantiation of member function 'std::default_delete<vcpkg::PortFileProvider::PathsPortFileProvider>::operator()' requested here
          get_deleter()(std::move(__ptr));
          ^
../src/vcpkg/portfileprovider.cpp:299:13: note: in instantiation of member function 'std::unique_ptr<vcpkg::PortFileProvider::PathsPortFileProvider, std::default_delete<vcpkg::PortFileProvider::PathsPortFileProvider> >::~unique_ptr' requested here
            BaselineProviderImpl(const VcpkgPaths& paths) : paths(paths) { }
            ^
1 error generated.

Third warning :

[3/9] Building CXX object CMakeFiles/vcpkglib.dir/src/vcpkg/versiondeserializers.cpp.o
FAILED: CMakeFiles/vcpkglib.dir/src/vcpkg/versiondeserializers.cpp.o 
/usr/bin/clang++  -DVCPKG_USE_STD_FILESYSTEM=1 -I../include -g   -Wall -Wextra -Wpedantic -Wno-unknown-pragmas -Wno-missing-field-initializers -Wno-redundant-move -Wmissing-prototypes -Werror -include /home/klalumiere/Projects/vcpkg-klalumiere/toolsrc/include/pch.h -pthread -std=c++17 -MD -MT CMakeFiles/vcpkglib.dir/src/vcpkg/versiondeserializers.cpp.o -MF CMakeFiles/vcpkglib.dir/src/vcpkg/versiondeserializers.cpp.o.d -o CMakeFiles/vcpkglib.dir/src/vcpkg/versiondeserializers.cpp.o -c ../src/vcpkg/versiondeserializers.cpp
../src/vcpkg/versiondeserializers.cpp:15:29: error: unused variable 'GIT_TREE' [-Werror,-Wunused-const-variable]
    constexpr StringLiteral GIT_TREE = "git-tree";
                            ^
1 error generated.

Additional context
I fixed the issues and I'll make a PR in a few seconds.

@NancyLi1013 NancyLi1013 added the category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) label Dec 16, 2020
BillyONeal pushed a commit that referenced this issue Dec 17, 2020
ryukw7 pushed a commit to ryukw7/vcpkg that referenced this issue Dec 24, 2020
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.

2 participants