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

cmake(install): include vcpkg dlls #2971

Merged
merged 2 commits into from
Jan 21, 2021
Merged

cmake(install): include vcpkg dlls #2971

merged 2 commits into from
Jan 21, 2021

Conversation

dennisameling
Copy link

@dennisameling dennisameling commented Jan 8, 2021

Fixes #2970 🎉

With this PR, the DLLs are added correctly to the CMake build output:

image

image

Signed-off-by: Dennis Ameling <dennis@dennisameling.com>

# Copy the necessary vcpkg DLLs (like iconv) to the install dir
set(X_VCPKG_APPLOCAL_DEPS_INSTALL ON)
set(CMAKE_TOOLCHAIN_FILE ${VCPKG_DIR}/scripts/buildsystems/vcpkg.cmake CACHE STRING "Vcpkg toolchain file")
Copy link
Member

Choose a reason for hiding this comment

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

This causes the build to fail:

 CMake Error at C:/Program Files/CMake/share/cmake-3.19/Modules/CMakeDetermineSystem.cmake:110 (message):
  Could not find toolchain file:
  D:/a/git/git/contrib/buildsystems/../../compat/vcbuild/vcpkg/scripts/buildsystems/vcpkg.cmake

Copy link
Author

@dennisameling dennisameling Jan 8, 2021

Choose a reason for hiding this comment

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

It works locally, so something is missing in your vcpkg artifacts in GH Actions. I just checked:

Downloaded https://dev.azure.com/git/4c888a9b-b30a-4c62-9301-8dfa18a71976/_apis/build/builds/2101/artifacts?artifactName=compat&api-version=6.0&%24format=zip

The scripts folder is missing, which causes the error:

image

Could you please include vcpkg/scripts/buildsystems/vcpkg.cmake in your vckpg artifacts, @dscho? That should resolve the issue 👍🏼

The alternative is that we could checkout vcpkg in GH Actions and then download your artifact with the prebuilt DLLs.

Copy link
Member

Choose a reason for hiding this comment

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

Hrm. I did that, and now the vs-build jobs take longer than even the linux-gcc build (which builds Git on Linux and then runs the test suite twice). To test the hypothesis that this is triggered by including scripts, I started https://github.com/dscho/git/actions/runs/474627271. Let's see how that fares. If its vs-build jobs also take excruciatingly long, I will have to roll back that scripts change.

Copy link
Member

Choose a reason for hiding this comment

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

Nope, seems that https://github.com/dscho/git/runs/1674724825?check_suite_focus=true was done with the generate Visual Studio solution step within 1.5 minutes, but https://github.com/git-for-windows/git/pull/2971/checks?check_run_id=1674658393 has now been running for more than 30 minutes.

Copy link
Author

Choose a reason for hiding this comment

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

That's weird. Looks like it just wasn't doing anything for 6 (!) hours. It's probably better if we first clone vcpkg in CI and then download your artifacts over it. I'll try that tomorrow evening if I can make it work time-wise. To be continued 👍🏼

Copy link
Member

Choose a reason for hiding this comment

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

I don't even know what purpose this toolchain file serves.

Copy link
Author

Choose a reason for hiding this comment

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

I tried without the CMAKE_TOOLCHAIN_FILE but then it doesn't copy over the DLLs. So it is needed. But I was able to fix CI in d8cf02e, how does that look @dscho? 😊

Copy link
Member

Choose a reason for hiding this comment

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

Doesn't that take super long because it rebuilds vcpkg.exe every single time? I'd rather have a manual copy step, using constants defined by find_package(), if that is at all possible.

Copy link
Author

Choose a reason for hiding this comment

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

1m51, that is: https://github.com/git-for-windows/git/pull/2971/checks?check_run_id=1687684942. But I see that vcpkg.exe is also included in your artifact, so let me try to exclude the vcpkg.exe build step and see if that works

Copy link
Author

Choose a reason for hiding this comment

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

Fixed in 09d1573. Now the new step initialize vcpkg only takes 6s 👍🏼

run: |
echo Fetching vcpkg in %cwd%vcpkg
git.exe clone https://github.com/Microsoft/vcpkg vcpkg
IF ERRORLEVEL 1 ( EXIT /B 1 )
Copy link
Member

Choose a reason for hiding this comment

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

I think we could use actions/checkout here, simplifying the added code (and accelerating it by the implicit shallow clone).

@dennisameling what do you think?

Copy link
Author

Choose a reason for hiding this comment

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

Done @dscho, the initialize vcpkg step now takes 12s instead of 6-7s, but I guess that's okay 😄

Copy link
Member

Choose a reason for hiding this comment

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

I think that time is very variable, anyway.

@dscho
Copy link
Member

dscho commented Jan 21, 2021

Very good. Would you mind squashing the latest three commits into a single one, explaining the need for it in the commit message?

No worries if you lack the time, I should have a little today.

This commit adds a step called "initialize vcpkg" to the GitHub Actions
workflow, because we need some build scripts from vcpkg that aren't
present in our vcpkg artifacts from Azure Pipelines.

Signed-off-by: Dennis Ameling <dennis@dennisameling.com>
@dennisameling
Copy link
Author

Done @dscho, I think you meant the last four commits instead of three, as those four were all related to GH Actions. Hope this looks good now!

Copy link
Member

@dscho dscho left a comment

Choose a reason for hiding this comment

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

Thank you so much!

@dscho dscho merged commit e3396cf into git-for-windows:main Jan 21, 2021
dscho added a commit that referenced this pull request Jan 21, 2021
cmake(install): include vcpkg dlls
dscho added a commit that referenced this pull request Jan 21, 2021
cmake(install): include vcpkg dlls
dscho added a commit that referenced this pull request Jan 21, 2021
cmake(install): include vcpkg dlls
dscho added a commit that referenced this pull request Jan 21, 2021
cmake(install): include vcpkg dlls
dscho added a commit that referenced this pull request Jan 22, 2021
cmake(install): include vcpkg dlls
dscho added a commit that referenced this pull request Jan 25, 2021
cmake(install): include vcpkg dlls
dscho added a commit that referenced this pull request Jan 25, 2021
cmake(install): include vcpkg dlls
dscho added a commit that referenced this pull request Jan 26, 2021
cmake(install): include vcpkg dlls
dscho added a commit that referenced this pull request Jan 27, 2021
cmake(install): include vcpkg dlls
dscho added a commit that referenced this pull request Jan 27, 2021
cmake(install): include vcpkg dlls
dscho added a commit that referenced this pull request Jan 27, 2021
cmake(install): include vcpkg dlls
dscho added a commit that referenced this pull request Jan 28, 2021
cmake(install): include vcpkg dlls
dscho added a commit that referenced this pull request Jan 29, 2021
cmake(install): include vcpkg dlls
dscho added a commit that referenced this pull request Jan 29, 2021
cmake(install): include vcpkg dlls
dscho added a commit that referenced this pull request Feb 1, 2021
cmake(install): include vcpkg dlls
dscho added a commit that referenced this pull request Feb 2, 2021
cmake(install): include vcpkg dlls
dscho added a commit that referenced this pull request Feb 2, 2021
cmake(install): include vcpkg dlls
dscho added a commit that referenced this pull request Feb 2, 2021
cmake(install): include vcpkg dlls
dscho added a commit that referenced this pull request Feb 2, 2021
cmake(install): include vcpkg dlls
dscho added a commit that referenced this pull request May 5, 2021
cmake(install): include vcpkg dlls
git-for-windows-ci pushed a commit that referenced this pull request May 5, 2021
cmake(install): include vcpkg dlls
git-for-windows-ci pushed a commit that referenced this pull request May 6, 2021
cmake(install): include vcpkg dlls
git-for-windows-ci pushed a commit that referenced this pull request May 6, 2021
cmake(install): include vcpkg dlls
dscho added a commit that referenced this pull request May 6, 2021
cmake(install): include vcpkg dlls
dscho added a commit that referenced this pull request May 10, 2021
cmake(install): include vcpkg dlls
dscho added a commit that referenced this pull request May 10, 2021
cmake(install): include vcpkg dlls
dscho added a commit that referenced this pull request May 10, 2021
cmake(install): include vcpkg dlls
git-for-windows-ci pushed a commit that referenced this pull request May 11, 2021
cmake(install): include vcpkg dlls
git-for-windows-ci pushed a commit that referenced this pull request May 11, 2021
cmake(install): include vcpkg dlls
git-for-windows-ci pushed a commit that referenced this pull request May 11, 2021
cmake(install): include vcpkg dlls
git-for-windows-ci pushed a commit that referenced this pull request May 12, 2021
cmake(install): include vcpkg dlls
git-for-windows-ci pushed a commit that referenced this pull request May 12, 2021
cmake(install): include vcpkg dlls
dscho added a commit that referenced this pull request May 12, 2021
cmake(install): include vcpkg dlls
git-for-windows-ci pushed a commit that referenced this pull request May 13, 2021
cmake(install): include vcpkg dlls
git-for-windows-ci pushed a commit that referenced this pull request May 13, 2021
cmake(install): include vcpkg dlls
git-for-windows-ci pushed a commit that referenced this pull request May 13, 2021
cmake(install): include vcpkg dlls
git-for-windows-ci pushed a commit that referenced this pull request May 13, 2021
cmake(install): include vcpkg dlls
git-for-windows-ci pushed a commit that referenced this pull request May 13, 2021
cmake(install): include vcpkg dlls
git-for-windows-ci pushed a commit that referenced this pull request May 13, 2021
cmake(install): include vcpkg dlls
git-for-windows-ci pushed a commit that referenced this pull request May 14, 2021
cmake(install): include vcpkg dlls
git-for-windows-ci pushed a commit that referenced this pull request May 14, 2021
cmake(install): include vcpkg dlls
git-for-windows-ci pushed a commit that referenced this pull request May 14, 2021
cmake(install): include vcpkg dlls
dscho added a commit that referenced this pull request May 14, 2021
cmake(install): include vcpkg dlls
git-for-windows-ci pushed a commit that referenced this pull request May 16, 2021
cmake(install): include vcpkg dlls
git-for-windows-ci pushed a commit that referenced this pull request May 17, 2021
cmake(install): include vcpkg dlls
git-for-windows-ci pushed a commit that referenced this pull request May 17, 2021
cmake(install): include vcpkg dlls
dscho added a commit that referenced this pull request May 17, 2021
cmake(install): include vcpkg dlls
dscho added a commit that referenced this pull request May 19, 2021
cmake(install): include vcpkg dlls
dscho added a commit that referenced this pull request May 22, 2021
cmake(install): include vcpkg dlls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DLLs missing when building Git using CMake
3 participants