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] Reduce dependencies and contents of vcpkgpaths.h #12876

Merged
merged 5 commits into from
Aug 14, 2020

Conversation

ras0219
Copy link
Contributor

@ras0219 ras0219 commented Aug 12, 2020

vcpkg/vcpkgpaths.h is omnipresent throughout the codebase; every dependency of this file slows compilation and makes circular dependencies more difficult and more common when writing new code.

This PR reduces the omniscience of this file to only use vcpkg/base/* files.

As a drive-by improvement, this PR (nearly) removes all uses of global, pre-defined triplets from the main tool. An exception still remains for per-platform default triplets, but this is logically the only place which should require hard-coded definitions.

(per-commit review is recommended)

@strega-nil

The tool should be as triplet-agnostic as possible, which leaves little room for special, pre-defined names like this. However, tests do have use of them: moved into test assets.
@strega-nil strega-nil added the info:reviewed Pull Request changes follow basic guidelines label Aug 12, 2020
@JackBoosY JackBoosY added category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed info:internal This PR or Issue was filed by the vcpkg team. labels Aug 13, 2020
@JackBoosY
Copy link
Contributor

[1/111] Building CXX object CMakeFiles\vcpkg-test.dir\src\vcpkg-test\dependencies.cpp.obj
FAILED: CMakeFiles/vcpkg-test.dir/src/vcpkg-test/dependencies.cpp.obj 
"C:\PROGRA~2\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.26.28801\bin\Hostx86\x86\cl.exe"  /nologo /TP -DVCPKG_USE_STD_FILESYSTEM=1 -IC:\agent\_work\1\s\toolsrc\include /DWIN32 /D_WINDOWS  /GR /EHsc /MDd /Zi /Ob0 /Od /RTC1   -FC -permissive- -utf-8 -W4 -analyze -WX -std:c++17 /showIncludes /FoCMakeFiles\vcpkg-test.dir\src\vcpkg-test\dependencies.cpp.obj /FdCMakeFiles\vcpkg-test.dir\ /FS -c C:\agent\_work\1\s\toolsrc\src\vcpkg-test\dependencies.cpp
C:\agent\_work\1\s\toolsrc\src\vcpkg-test\dependencies.cpp(104): error C2039: 'X86_WINDOWS': is not a member of 'vcpkg::Triplet'
C:\agent\_work\1\s\toolsrc\include\vcpkg\vcpkgpaths.h(48): note: see declaration of 'vcpkg::Triplet'
C:\agent\_work\1\s\toolsrc\src\vcpkg-test\dependencies.cpp(117): error C2039: 'X86_WINDOWS': is not a member of 'vcpkg::Triplet'
C:\agent\_work\1\s\toolsrc\include\vcpkg\vcpkgpaths.h(48): note: see declaration of 'vcpkg::Triplet'
C:\agent\_work\1\s\toolsrc\src\vcpkg-test\dependencies.cpp(125): error C2039: 'X86_WINDOWS': is not a member of 'vcpkg::Triplet'
C:\agent\_work\1\s\toolsrc\include\vcpkg\vcpkgpaths.h(48): note: see declaration of 'vcpkg::Triplet'
C:\agent\_work\1\s\toolsrc\src\vcpkg-test\dependencies.cpp(132): error C2039: 'X86_WINDOWS': is not a member of 'vcpkg::Triplet'
C:\agent\_work\1\s\toolsrc\include\vcpkg\vcpkgpaths.h(48): note: see declaration of 'vcpkg::Triplet'
C:\agent\_work\1\s\toolsrc\src\vcpkg-test\dependencies.cpp(139): error C2039: 'X86_WINDOWS': is not a member of 'vcpkg::Triplet'
C:\agent\_work\1\s\toolsrc\include\vcpkg\vcpkgpaths.h(48): note: see declaration of 'vcpkg::Triplet'
C:\agent\_work\1\s\toolsrc\src\vcpkg-test\dependencies.cpp(147): error C2039: 'X86_WINDOWS': is not a member of 'vcpkg::Triplet'
C:\agent\_work\1\s\toolsrc\include\vcpkg\vcpkgpaths.h(48): note: see declaration of 'vcpkg::Triplet'

@JackBoosY JackBoosY removed the info:reviewed Pull Request changes follow basic guidelines label Aug 13, 2020
@PhoebeHui PhoebeHui added the info:reviewed Pull Request changes follow basic guidelines label Aug 14, 2020
@strega-nil strega-nil merged commit 0c21178 into microsoft:master Aug 14, 2020
remz1337 pushed a commit to remz1337/vcpkg that referenced this pull request Aug 23, 2020
…2876)

* [vcpkg] Remove globally-constructed pre-defined Triplets from vcpkg.exe

The tool should be as triplet-agnostic as possible, which leaves little room for special, pre-defined names like this. However, tests do have use of them: moved into test assets.

* [vcpkg] Move predefined tools strings vcpkgpaths.h -> tools.h

* [vcpkg] Add forward declarations to vcpkgpaths.h to reduce header deps

* Merge from origin/master

Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
strega-nil pushed a commit to strega-nil/vcpkg that referenced this pull request May 5, 2021
…2876)

* [vcpkg] Remove globally-constructed pre-defined Triplets from vcpkg.exe

The tool should be as triplet-agnostic as possible, which leaves little room for special, pre-defined names like this. However, tests do have use of them: moved into test assets.

* [vcpkg] Move predefined tools strings vcpkgpaths.h -> tools.h

* [vcpkg] Add forward declarations to vcpkgpaths.h to reduce header deps

* Merge from origin/master

Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed info:internal This PR or Issue was filed by the vcpkg team. info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants