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] Update parallel vcpkg_cmake_configure #21507

Merged
merged 8 commits into from Jul 25, 2022

Conversation

dg0yt
Copy link
Contributor

@dg0yt dg0yt commented Nov 18, 2021

  • What does your PR fix?

    Enables parallel cmake whenever ninja is available (non-windows hosts, system Ninja).
    Adds "Unix Makefiles" as fallback generator for non-Windows system.
    Establishs this order for generator selection:

    • If the host is x86 or VCPKG_FORCE_SYSTEM_BINARIES is set, try to find Ninja via find_program.
      • It it cannot be found, then assume that msbuild is requested for windows.
    • If msbuild is requested and suitable, use it.
    • Else if a particular generator is requested, use it.
    • Else if ninja is available, use it.
    • Else on non-windows host, use "Unix Makefiles".
  • Which triplets are supported/not supported? Have you updated the CI baseline?

    all, no

  • 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?

    incomplete

@JonLiu1993 JonLiu1993 assigned JonLiu1993 and JackBoosY and unassigned JonLiu1993 Nov 18, 2021
@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 18, 2021
@JackBoosY
Copy link
Contributor

Should we also fix vcpkg_configure_cmake?

@dg0yt
Copy link
Contributor Author

dg0yt commented Nov 18, 2021

Should we also fix vcpkg_configure_cmake?

I tend to not change it:

  • Ports shall be switched to vcpkg_cmake_configure for corrected behaviour.
  • No behavioural change for building old versions of ports when they use vcpkg_configure_cmake.

@Neumann-A
Copy link
Contributor

i would really like separate logs for each config if it is possible.

@dg0yt
Copy link
Contributor Author

dg0yt commented Nov 18, 2021

i would really like separate logs for each config if it is possible.

Understood. However, this wasn't the case for windows before.
Note that within the single log, ninja clearly separates the individual outputs. (Tested locally with port cpr.)

@Neumann-A
Copy link
Contributor

Understood. However, this wasn't the case for windows before.
Note that within the single log, ninja clearly separates the individual outputs. (Tested locally with port cpr.)

Yeah I know. Windows always puts everything in the same file which is kind of annoying and harder to debug in my view.
The main purpose is

  • make the files comparable to easily see differences in configure between dbg/rel
  • make the errors more visible due to the separate logs

@dg0yt
Copy link
Contributor Author

dg0yt commented Nov 18, 2021

i would really like separate logs for each config if it is possible.

I don't see a simple way to do that portably in the ninja rule, for stdout and stderr.
This leaves only some post processing which also isn't trivial after a failed job.

OTOH the single config log does have some advantages:

  • The number of files is reduced.
  • Release config output is available even when debug config failed.

@dg0yt
Copy link
Contributor Author

dg0yt commented Nov 18, 2021

I don't see a simple way to do that portably in the ninja rule, for stdout and stderr.

cmd has the same redirection syntax as sh. cmd /C for windows then?
If yes, I would also move the cmake chdir to a plain cd.

@dg0yt
Copy link
Contributor Author

dg0yt commented Nov 18, 2021

bcg729:x64-linux: source write, fix in #21516.

@JackBoosY JackBoosY added the depends:different-pr This PR or Issue depends on a PR which has been filed label Nov 19, 2021
@dg0yt
Copy link
Contributor Author

dg0yt commented Nov 19, 2021

i would really like separate logs for each config if it is possible.

I'm also curious how you would think about parallelizing the build step. If this is possible at all, via subninja, there is no way to redirect the output. (However, I would leave the install step serialized.)

@dg0yt
Copy link
Contributor Author

dg0yt commented Nov 20, 2021

I don't see a simple way to do that portably in the ninja rule, for stdout and stderr.

cmd has the same redirection syntax as sh. cmd /C for windows then? If yes, I would also move the cmake chdir to a plain cd.

The cmd approach is doable, writing the command to a cmd file instead of build.ninja. Now the problem is a different one:
vcpkg_execute_required_process is unaware of the log files created via redirection. In case of error, it won't tell you to look at the split files.

@dg0yt
Copy link
Contributor Author

dg0yt commented Nov 23, 2021

This PR is twofold, a) fixing the working directory for parallel configure, and b) applying parallel configure outside windows. Since it rebuilds a lot of ports, it should be decided if b) shall be left in this PR.
IMO the change is okay, because the behaviour is unified, ninja already takes care of output order, and I prefer to see output of both build types on errors.

@JackBoosY JackBoosY removed the depends:different-pr This PR or Issue depends on a PR which has been filed label Nov 23, 2021
@JackBoosY
Copy link
Contributor

Waiting for test results.

@dg0yt
Copy link
Contributor Author

dg0yt commented Nov 24, 2021

This is now expensively rebuilding against an old version of master. Better merge HEAD of master, to fetch the bcg729 update.
(I didn't want to trigger CI by a PR update before knowing the desired direction.)

@JackBoosY
Copy link
Contributor

@dg0yt Fine, so please merge to master to retrigger the ci test.

@JackBoosY
Copy link
Contributor

hpx regression was fixed in #21617.
python3:x64-osx:

install: mkdir /Users/vagrant/Data/packages/python3_x64-osx/Users/vagrant/Data/installed/x64-osx/debug/lib: File exists
make: *** [altbininstall] Error 71

wavelib:arm-uwp:

       CUSTOMBUILD : CMake error : Cannot restore timestamp "D:/buildtrees/wavelib/arm-uwp-rel/test/CMakeFiles/generate.stamp": Access is denied. [D:\buildtrees\wavelib\arm-uwp-rel\test\modwttest.vcxproj]

@dg0yt
Copy link
Contributor Author

dg0yt commented Nov 26, 2021

wavelib has parallel source writes for test executables, #21671.

@dg0yt
Copy link
Contributor Author

dg0yt commented Nov 26, 2021

python3:x64-osx:

install: mkdir /Users/vagrant/Data/packages/python3_x64-osx/Users/vagrant/Data/installed/x64-osx/debug/lib: File exists
make: *** [altbininstall] Error 71

In install-x64-osx-dbg-out.log:

...
Creating directory /Users/vagrant/Data/installed/x64-osx/debug/lib
Creating directory /Users/vagrant/Data/installed/x64-osx/debug/lib
...

This error is not related to this PR: python3 uses cmake only for windows incl. uwp. The osx build uses configure+make.
make altinstall has a race condition: In Makefile.def, there are two subtargets which create $(DESTDIR)$(LIBDIR) after checking for its existence. This must be serialized.

If the host is x86, assume that msbuild is requested for windows.
If msbuild is requested and suitable, use it.
Else if a particular generator is requested, use it.
Else if ninja is available, use it.
Else on non-windows host, use "Unix Makefiles".
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

After committing all other changes, the version database must be updated
git add -u && git commit
git checkout de176433e9a8769eed0e43d61758f4cdc1dc6e20 -- versions
./vcpkg x-add-version --all
Diff
diff --git a/versions/baseline.json b/versions/baseline.json
index 471b840..5d0b378 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -4741,7 +4741,7 @@
       "port-version": 1
     },
     "ms-gltf": {
-      "baseline": "2022-06-28",
+      "baseline": "2022-07-18",
       "port-version": 0
     },
     "ms-gsl": {
@@ -7421,7 +7421,7 @@
       "port-version": 0
     },
     "vcpkg-cmake": {
-      "baseline": "2022-07-02",
+      "baseline": "2022-07-18",
       "port-version": 0
     },
     "vcpkg-cmake-config": {
diff --git a/versions/m-/ms-gltf.json b/versions/m-/ms-gltf.json
index 87af4d8..69b11e9 100644
--- a/versions/m-/ms-gltf.json
+++ b/versions/m-/ms-gltf.json
@@ -1,5 +1,10 @@
 {
   "versions": [
+    {
+      "git-tree": "1573e63635b8505134e0ecddcb2f0ab76874fb54",
+      "version-date": "2022-07-18",
+      "port-version": 0
+    },
     {
       "git-tree": "a9a91635168ea77faa39adb73b27483797fa8967",
       "version-date": "2022-06-28",
diff --git a/versions/v-/vcpkg-cmake.json b/versions/v-/vcpkg-cmake.json
index daad9b9..a329f1d 100644
--- a/versions/v-/vcpkg-cmake.json
+++ b/versions/v-/vcpkg-cmake.json
@@ -1,5 +1,10 @@
 {
   "versions": [
+    {
+      "git-tree": "a7b618b7782f3c841d7fd2d84a6ba3619815362a",
+      "version-date": "2022-07-18",
+      "port-version": 0
+    },
     {
       "git-tree": "94abbd71a7fe495e883b13c077312f6d419cbc41",
       "version-date": "2022-07-02",

@dg0yt
Copy link
Contributor Author

dg0yt commented Jul 18, 2022

I will update the version database when the PR received preliminary acceptance.

github-actions[bot]
github-actions bot previously approved these changes Jul 19, 2022
@@ -1,6 +1,6 @@
{
"name": "ms-gltf",
"version-date": "2022-06-28",
"version-date": "2022-07-18",
Copy link
Contributor

Choose a reason for hiding this comment

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

should bump port version, not version-date

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's what I would have done for other version schemes.

Copy link
Member

Choose a reason for hiding this comment

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

If the content of the stuff we install changed, then the version-date should be updated. If only maintainer improvement stuff in the port changed, port-version should be bumped.

@dg0yt dg0yt marked this pull request as ready for review July 20, 2022 05:38
@dg0yt
Copy link
Contributor Author

dg0yt commented Jul 20, 2022

It is nice to know that there is a micro issue with the ms-gltf version update. But before burning more CI time, I need feedback on the core part.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

After committing all other changes, the version database must be updated
git add -u && git commit
git checkout 8ff168270bc5977384b008bec6e879e15089d850 -- versions
./vcpkg x-add-version --all
Diff
diff --git a/versions/baseline.json b/versions/baseline.json
index 0114230..89c2864 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -4742,7 +4742,7 @@
     },
     "ms-gltf": {
       "baseline": "2022-06-28",
-      "port-version": 0
+      "port-version": 1
     },
     "ms-gsl": {
       "baseline": "4.0.0",
@@ -7421,7 +7421,7 @@
       "port-version": 0
     },
     "vcpkg-cmake": {
-      "baseline": "2022-07-02",
+      "baseline": "2022-07-18",
       "port-version": 0
     },
     "vcpkg-cmake-config": {
diff --git a/versions/m-/ms-gltf.json b/versions/m-/ms-gltf.json
index 87af4d8..82b9a8b 100644
--- a/versions/m-/ms-gltf.json
+++ b/versions/m-/ms-gltf.json
@@ -1,5 +1,10 @@
 {
   "versions": [
+    {
+      "git-tree": "b189e4d23ebe85437573b386d94b06b3f9fb6238",
+      "version-date": "2022-06-28",
+      "port-version": 1
+    },
     {
       "git-tree": "a9a91635168ea77faa39adb73b27483797fa8967",
       "version-date": "2022-06-28",
diff --git a/versions/v-/vcpkg-cmake.json b/versions/v-/vcpkg-cmake.json
index daad9b9..a329f1d 100644
--- a/versions/v-/vcpkg-cmake.json
+++ b/versions/v-/vcpkg-cmake.json
@@ -1,5 +1,10 @@
 {
   "versions": [
+    {
+      "git-tree": "a7b618b7782f3c841d7fd2d84a6ba3619815362a",
+      "version-date": "2022-07-18",
+      "port-version": 0
+    },
     {
       "git-tree": "94abbd71a7fe495e883b13c077312f6d419cbc41",
       "version-date": "2022-07-02",

Copy link
Member

@BillyONeal BillyONeal left a comment

Choose a reason for hiding this comment

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

I note that there is a preexisting issue related to vcpkg_find_acquire_program and FORCE_SYSTEM_BINARIES I did not comment on here since it's unrelated to this improvement. (And I don't think other reviewers should block for that either)

@JackBoosY JackBoosY added the info:reviewed Pull Request changes follow basic guidelines label Jul 21, 2022
@BillyONeal BillyONeal merged commit 49868fd into microsoft:master Jul 25, 2022
@BillyONeal
Copy link
Member

Thanks for making parallelism work in more places:)

@dg0yt
Copy link
Contributor Author

dg0yt commented Jul 25, 2022

Now I may turn to vpckg_configure_make. Which has quite some potential.

@dg0yt dg0yt deleted the parallel-cmake branch July 25, 2022 19:36
@Neumann-A
Copy link
Contributor

Now I may turn to vpckg_configure_make. Which has quite some potential.

do/test it outside of that function ;) Make a script port for it.

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:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants