Skip to content

Move download, SHA256 check and unzip of Windows buildenv from windows_buildenv.bat to CMakelists.txt#13306

Merged
daschuer merged 4 commits into
mixxxdj:2.6from
JoergAtGithub:cmake_download_buildenv_zip
Jun 27, 2025
Merged

Move download, SHA256 check and unzip of Windows buildenv from windows_buildenv.bat to CMakelists.txt#13306
daschuer merged 4 commits into
mixxxdj:2.6from
JoergAtGithub:cmake_download_buildenv_zip

Conversation

@JoergAtGithub
Copy link
Copy Markdown
Member

This move the VCPKG buildenv download, SHA256 verification and unzipping into CMakelists.txt. This removes the need for third party tools like 7zip and Powershell (see #11524 for reference).

For the developer everything should behave as before. No change in the build instructions is neccessary - just the tasks mentioned above are executed later.

Out of scope of this PR is:

  • macOS
  • Replacing windows_buildenv.bat and CMakeSettings.json by CMake Presets

@github-actions github-actions Bot added the build label May 30, 2024
@JoergAtGithub JoergAtGithub force-pushed the cmake_download_buildenv_zip branch from 22b1df5 to ecc462a Compare May 30, 2024 16:52
Copy link
Copy Markdown
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

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

Thank for adopting this.

Comment thread CMakeLists.txt Outdated
Comment thread CMakeLists.txt Outdated
Comment thread CMakeLists.txt Outdated
@JoergAtGithub JoergAtGithub requested a review from daschuer June 28, 2024 18:23
@JoergAtGithub JoergAtGithub force-pushed the cmake_download_buildenv_zip branch from 9cea1ee to b09ace0 Compare June 29, 2024 07:09
@JoergAtGithub
Copy link
Copy Markdown
Member Author

@daschuer Friendly Ping

@JoergAtGithub
Copy link
Copy Markdown
Member Author

@daschuer Can we merge this?

Comment thread CMakeLists.txt Outdated
endif()


if(WIN32)
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.

I know you mentioned it as out-of-scope, but I agree that sharing this logic with macOS would be great, given that the vcpkg envs are structured practically identically as far as I understand.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It would be great if you could create a follow-up PR for macOS.

@JoergAtGithub
Copy link
Copy Markdown
Member Author

@daschuer Can we merge this now?

Copy link
Copy Markdown
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

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

This only works if we make sure
"MIXXX_VCPKG_ROOT = BUILDENV_BASEPATH/BUILDENV_NAME"

What are the use cases if this is not the case?

If we tray to use an alternative build environment "MIXXX_VCPKG_ROOT" needs to be set.
If that exists, I think we can skip the whole evaluation of "BUILDENV_BASEPATH/BUILDENV_NAME"

In case it does not exists, I think there is no point in downloading to a diffrent folder than "MIXXX_VCPKG_ROOT".
So we may fail fatal in that case. However if we are in a shell where "BUILDENV_BASEPATH/BUILDENV_NAME" is set it will allways fail.

Conclusion we may only use "MIXXX_VCPKG_ROOT" and may dispose "BUILDENV_BASEPATH/BUILDENV_NAME"

What do you think?

Comment thread CMakeLists.txt Outdated
Comment thread CMakeLists.txt Outdated
Comment thread CMakeLists.txt Outdated
Comment thread CMakeLists.txt Outdated
@JoergAtGithub JoergAtGithub force-pushed the cmake_download_buildenv_zip branch from b09ace0 to efa7b67 Compare February 9, 2025 16:36
@acolombier
Copy link
Copy Markdown
Member

/softfix:squash

feat: move buildenv setup to CMakeFile

@acolombier acolombier mentioned this pull request Feb 18, 2025
@github-actions github-actions Bot force-pushed the cmake_download_buildenv_zip branch from f1ac722 to 7db1d4f Compare February 18, 2025 01:25
@acolombier
Copy link
Copy Markdown
Member

/softfix

feat: move buildenv setup to CMakeFile

@github-actions github-actions Bot force-pushed the cmake_download_buildenv_zip branch from 7db1d4f to 8779ff3 Compare February 18, 2025 01:43
@acolombier
Copy link
Copy Markdown
Member

@daschuer were your change requests addressed? Merge?

Comment thread CMakeLists.txt Outdated
@acolombier
Copy link
Copy Markdown
Member

Sorry for the early fixup @JoergAtGithub , I missred that PR and thought it was ready to go

@JoergAtGithub JoergAtGithub force-pushed the cmake_download_buildenv_zip branch from 8779ff3 to f1ac722 Compare March 14, 2025 18:14
@github-actions github-actions Bot added the developer experience Issues, bugs and PRs related to the development process, development environment & developer docs label Mar 14, 2025
@JoergAtGithub
Copy link
Copy Markdown
Member Author

Restored original commits

@JoergAtGithub JoergAtGithub added this to the 2.6-beta milestone Mar 14, 2025
@JoergAtGithub
Copy link
Copy Markdown
Member Author

All done!

@JoergAtGithub JoergAtGithub requested a review from daschuer March 14, 2025 22:34
@Eve00000
Copy link
Copy Markdown
Contributor

All done!

Hi Jörg,
So if I understand it correct, you moved the downloading and extraction of the dependencies from the bat to cmake.
While working on these, can you please make the error-messages more clrear?
Before a lot of errors where covered under the message 'did you execute the windows_buildenv.bat' without mentioning the right error.
Can you also add a note at the beginning of the cmake to explain whitch lines need to be adapted if the dependencies are downloaded manual, and maybe some line to enter the name and sha of the latest dependencies that were downloaded manual.
Thank you.

@JoergAtGithub
Copy link
Copy Markdown
Member Author

@Eve00000 The code with the message 'did you execute the windows_buildenv.bat' is not touched by this PR. This is therefore out of scope. The final goal is of cause to get rid of this batch file at all, but this is up to future PRs.

There is no need to modify the CMakelists.txt code when you use a zip file from other sources (a GitHub PR build artifact). Just manual download the ZIP file in the directory specified as BUILDENV_BASEPATH, set BUILDENV_NAME to the name of these manual downloaded file(without the file extension .zip).
For a command line build you could specify a manual downloaded buildenv zip by:
cmake ../ -DBUILDENV_BASEPATH="D:\mixxx\buildenv" -DBUILDENV_NAME="mixxx-deps-2.5-x64-windows-c15790e"
using an VisualStudio, you will find the same CMake settings in the GUI, where you can overwrite them.

@Eve00000
Copy link
Copy Markdown
Contributor

Eve00000 commented Mar 15, 2025

Cool!
I will give it a go this w-e.
I will post my findings & experience.

@daschuer
Copy link
Copy Markdown
Member

@Eve00000 while testing, can you keep an eye in the documentation? I can imagine that some wiki docks needs to be adjusted, error messages rephrased.

@daschuer
Copy link
Copy Markdown
Member

If the project is configured and the BUILD_ENV, we can't safely reconfigure. That's why the only chance we have that the buildenv variables can win is to ask for deleting the cache.

@JoergAtGithub
Copy link
Copy Markdown
Member Author

Yes, that is the behavior we currently have and works very well for me. I will not change this in this PR!
Changenging the general behavior is out of scope of this PR!

Copy link
Copy Markdown
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

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

This works good on Linux as far as I can tell. I am pretty sure that clanging the environment without clearing the Cache does not work. But I can't prove it yet.

Comment thread CMakeLists.txt Outdated
Comment thread CMakeLists.txt Outdated
@daschuer
Copy link
Copy Markdown
Member

Here is a CI run that demonstrates the issue
https://github.com/daschuer/mixxx/actions/runs/13958279397/job/39074483674
It configures the build directory as usual. Than It move the vcpkg package directory and re-configures the project with the new location and fails.

It will work, if the original environment still exists and you download the new in addition, However this leads to a dubious situation where some parts of the old and some parts of the new environment are used. I consider this as maximal confusing and therefore the early error message with a clear instruction is helpful.

@github-project-automation github-project-automation Bot moved this to In progress in Releases Mar 25, 2025
@daschuer daschuer modified the milestones: 2.6-beta, 2.6.0 May 12, 2025
@JoergAtGithub JoergAtGithub force-pushed the cmake_download_buildenv_zip branch from 04db0c1 to cf364ea Compare May 25, 2025 10:26
@JoergAtGithub JoergAtGithub changed the base branch from main to 2.6 May 25, 2025 11:05
@JoergAtGithub JoergAtGithub force-pushed the cmake_download_buildenv_zip branch from cf364ea to c6066d0 Compare May 25, 2025 11:23
@JoergAtGithub
Copy link
Copy Markdown
Member Author

The requested fata error message is added, this is ready now!

@JoergAtGithub JoergAtGithub requested a review from daschuer May 25, 2025 12:22
@JoergAtGithub
Copy link
Copy Markdown
Member Author

@daschuer A friendling ping, that this is ready to merge!

Comment thread CMakeLists.txt Outdated
This additional condition doesn't harm my use cases

Co-authored-by: Daniel Schürmann <daschuer@mixxx.org>
@JoergAtGithub JoergAtGithub requested a review from daschuer June 26, 2025 21:11
Comment thread CMakeLists.txt Outdated
Co-authored-by: Daniel Schürmann <daschuer@mixxx.org>
@JoergAtGithub JoergAtGithub requested a review from daschuer June 26, 2025 21:31
Comment thread CMakeLists.txt Outdated
Comment thread CMakeLists.txt
Fix wrong variable use syntax in condition
Unified directory seperator between BUILDENV_BASEPATH and BUILDENV_NAME
Inhibited warnings about unused external specified variables if the buildenv is already there
@JoergAtGithub JoergAtGithub requested a review from daschuer June 27, 2025 00:36
Copy link
Copy Markdown
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

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

LGTM, Thank you.

@daschuer daschuer merged commit 66f2d35 into mixxxdj:2.6 Jun 27, 2025
3 checks passed
@github-project-automation github-project-automation Bot moved this from In progress to Done in Releases Jun 27, 2025
@JoergAtGithub JoergAtGithub deleted the cmake_download_buildenv_zip branch June 27, 2025 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build developer experience Issues, bugs and PRs related to the development process, development environment & developer docs

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants