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_cmake_configure does not change the cwd on windows #21198

Closed
autoantwort opened this issue Nov 5, 2021 · 11 comments · Fixed by #22124
Closed

vcpkg_cmake_configure does not change the cwd on windows #21198

autoantwort opened this issue Nov 5, 2021 · 11 comments · Fixed by #22124
Assignees
Labels
category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly

Comments

@autoantwort
Copy link
Contributor

While working on #21168 the following was detected:
It seems that vcpkg_cmake_configure does not change the cwd in contrast to vcpkg_configure_cmake on windows.
The line file(MAKE_DIRECTORY generated) generates the following error on windows but not on other platforms:

CMake Error at CMakeLists.txt:13 (file):
  file attempted to create a directory:
  C:/Users/LeanderSchulten/git_projects/vcpkg/buildtrees/offscale-libetcd-cpp/src/fdb87cf638-60a9ea69fd.clean/generated
  into a source directory.
@JackBoosY JackBoosY added the category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly label Nov 5, 2021
@JackBoosY
Copy link
Contributor

JackBoosY commented Nov 5, 2021

@strega-nil-ms can you please take a look?

I met this error also.

@sfhacker

This comment has been minimized.

@JackBoosY
Copy link
Contributor

According to cmake issue https://gitlab.kitware.com/cmake/cmake/-/issues/18811,
The reason why we got this error is CMAKE_DISABLE_SOURCE_CHANGES is enabled.
I will check the maintain history later.

@JackBoosY
Copy link
Contributor

Additional. we can use option DISABLE_PARALLEL_CONFIGURE to vcpkg_configure_cmake / vcpkg_cmake_configure to avoid this.

@JackBoosY
Copy link
Contributor

This option was introduced by PR #12846.

@JackBoosY JackBoosY added requires:discussion and removed category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly labels Nov 11, 2021
@dg0yt
Copy link
Contributor

dg0yt commented Nov 18, 2021

This analysis went in the wrong direction again. The problem is entirely in vcpkg_cmake_configure (and vcpkg_configure_cmake) which invokes cmake differently (from ninja) with parallel configure. It is more evident with the port version because it uses parallel by default.

@dg0yt
Copy link
Contributor

dg0yt commented Nov 18, 2021

While working on #21168 the following was detected: It seems that vcpkg_cmake_configure does not change the cwd in contrast to vcpkg_configure_cmake on windows. The line file(MAKE_DIRECTORY generated) generates the following error on windows but not on other platforms:

CMake Error at CMakeLists.txt:13 (file):
  file attempted to create a directory:
  C:/Users/LeanderSchulten/git_projects/vcpkg/buildtrees/offscale-libetcd-cpp/src/fdb87cf638-60a9ea69fd.clean/generated
  into a source directory.

What can be fixed is:
Change the cwd for uniform behaviour between parallel and non-parallel configure.

What can't be fixed is:
Enable (parallel!) safe writes to the source directory during parallel configure.

@dg0yt
Copy link
Contributor

dg0yt commented Dec 21, 2021

For parallel configure to work, offscale-libetcd-cpp must be patched. Cf. #22124 (comment).

@strega-nil-ms
Copy link
Contributor

Yeah, this is not a bug (as @dg0yt points out) - offscale-libetcd-cpp cannot use parallel configure.

@dg0yt
Copy link
Contributor

dg0yt commented Dec 29, 2021

It is a bug because it affects the working directory of execute_process, and a patch is pending in #22124.

@strega-nil-ms
Copy link
Contributor

mmh, okay, thanks! reopening

@strega-nil-ms strega-nil-ms reopened this Dec 29, 2021
@JackBoosY JackBoosY added category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly and removed requires:discussion labels Dec 30, 2021
@JackBoosY JackBoosY linked a pull request Dec 30, 2021 that will close this issue
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants