-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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_execute_*_process] Add support for build profiling #22676
[vcpkg_execute_*_process] Add support for build profiling #22676
Conversation
i don't see why this should be an env variable. You cann simply pass |
I updated the patch so that it now uses a plain variable |
z_vcpkg_acquire_msys_declare_package( | ||
URL "https://repo.msys2.org/msys/x86_64/time-1.9-2-x86_64.pkg.tar.zst" | ||
SHA512 923607127f3a9c644136a3e6cc76885ddcd75e7f964e4732d6897af72ca334af5c8bd69debde19985c8e785979006da41d0df34a230b6bdebd5b6ca2ab29774b | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really needed? There is cmake -E time <cmd>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vcpkg also logs elapsed time required to build a package.
This change allows to measure configure/build stages separately.
I used it to measure libtool-related optimization fix (cuts off about 2x from gettext[tools] build time) and just submitted it because I thought it might be generally useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know what you are trying to achieve. I'm proposing you shouldn't use the time
command which doesn't exist on Windows but the portable alternative offered by CMake.
list(GET arg_COMMAND 0 command) | ||
if(NOT command MATCHES [[/msys2/]]) | ||
message(STATUS "Using MSYS2_ARG_CONV_EXCL=*") | ||
set(ENV{MSYS2_ARG_CONV_EXCL} "*") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes msys2 behaviour for all commands. This may create unexpected problems. Same for the other scripts where this pattern is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be I am missing something, but on the contrary - this chunk is to not change anything for msys2 and non-msys2 (do not convert arguments) commands
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This environment variable affects conversions deeper down below the initial command
:
- With
PORT_PROFILE
false: Default or user-defined msys argument conversion behaviour. - With
PORT_PROFILE
true: No msys argument conversion at all.
We don't know how often the flow of control crosses between msys (e.g. make) and windows (e.g. cmake) environments. If it works now (no PORT_PROFILE
), it can break with PORT_PROFILE
evaluating to true.
So it is a ticking bomb IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dg0yt I re-implemented the change using "cmake -E time"
@BillyONeal Any suggestions here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM, except that we'd like to first introduce this as an experimental flag (X_....
).
I would also suggest reversing the flag name to be X_PROFILE_PORT
, but that's a looser suggestion.
Thanks!
I was just following the "convention" of PORT_DEBUG flag |
I updated the PR to use X_PORT_PROFILE |
Not related to this changes. |
Ping @ras0219-msft for review this again. |
Can you please merge this branch to master so I can review again? Thanks! |
Depends on #24542. |
I killed the job attempting to "recheck" here because it wouldn't have gotten the merge of the dependent PR. We need a merge with master to pick up #24542 now that it has been merged. |
Please merge this branch to master, we don't have the permission to push any changes. |
Done |
When building
But file glcpp-lex.l only have 622 lines. |
@BillyONeal I think we can review this again. |
Is there a reason we shouldn't just always do this instead of requiring use of a flag? |
Ping @mkhon |
I removed X_PORT_PROFILE in the new version |
The failures I see are caused by individual port build errors and are not related to the change I suggest |
Can you please merge this branch to master since I have no permission to push to this branch? |
Use --x-cmake-args=-DX_PORT_PROFILE=TRUE to enable port build profiling
Done |
air-ctl regression is fixing in #25113. |
I think we might consider turning this on be default in the future, but this is at least a nice feature to have experimentally. Thanks for your contribution! |
Thanks for this PR! |
Describe the pull request
Use --x-cmake-args=-DX_PORT_PROFILE=TRUE to enable profiling
What does your PR fix?
Which triplets are supported/not supported? Have you updated the CI baseline?
all
Does your PR follow the maintainer guide?
Yes
If you have added/updated a port: Have you run
./vcpkg x-add-version --all
and committed the result?Yes
If you are still working on the PR, open it as a Draft: https://github.blog/2019-02-14-introducing-draft-pull-requests/