Skip to content

Compiler detection: Cache compiler hash#42994

Merged
BillyONeal merged 4 commits into
microsoft:masterfrom
autoantwort:feature/cache-compiler-hash
Jan 16, 2025
Merged

Compiler detection: Cache compiler hash#42994
BillyONeal merged 4 commits into
microsoft:masterfrom
autoantwort:feature/cache-compiler-hash

Conversation

@autoantwort

@autoantwort autoantwort commented Dec 30, 2024

Copy link
Copy Markdown
Contributor

Implements microsoft/vcpkg-tool#362 (comment)
Speeds up the compiler hashing if the compiler file is large like on macOS (250 MB for cc and c++ each)
image

@Mengna-Li Mengna-Li added the category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly label Dec 30, 2024
Comment thread scripts/detect_compiler/portfile.cmake
@Mengna-Li Mengna-Li added the info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. label Jan 2, 2025
@JavierMatosD JavierMatosD added the requires:vcpkg-team-review This PR or issue requires someone on the vcpkg team to take a further look. label Jan 3, 2025
Comment thread scripts/detect_compiler/CMakeLists.txt Outdated
set(${out_var} "${HASH}" PARENT_SCOPE)
endfunction()

if(VCPKG_COMPILER_CACHE_FILE)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be

Suggested change
if(VCPKG_COMPILER_CACHE_FILE)
if(DEFINED VCPKG_COMPILER_CACHE_FILE)

?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. The variable is passed to this port by -DVCPKG_COMPILER_CACHE_FILE=${VCPKG_COMPILER_CACHE_FILE}, but if an "old" vcpkg-tool is used the variable is not defined in the portfile and an empty variable gets defined.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What defines the empty value?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread scripts/detect_compiler/CMakeLists.txt Outdated
Comment thread scripts/detect_compiler/CMakeLists.txt Outdated
Comment thread scripts/detect_compiler/CMakeLists.txt Outdated
Comment thread scripts/detect_compiler/CMakeLists.txt Outdated
Comment thread scripts/detect_compiler/CMakeLists.txt
autoantwort and others added 2 commits January 3, 2025 21:19
Comment thread scripts/detect_compiler/portfile.cmake Outdated
Co-authored-by: Kai Pastor <dg0yt@darc.de>
@BillyONeal BillyONeal merged commit 96dbba1 into microsoft:master Jan 16, 2025
@BillyONeal

Copy link
Copy Markdown
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. requires:vcpkg-team-review This PR or issue requires someone on the vcpkg team to take a further look.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants