diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..c34e84e89 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,100 @@ +version: 2 + +# Keeps the pinned action SHAs moving. +# +# Every action reference under .github/workflows is a 40-character commit SHA +# with the version in a trailing comment. A SHA pin *without* this file is worse +# than a floating tag: it freezes CI on whatever was current the day it was +# written. This repository is the case study. Nothing had ever reported that an +# action moved, so actions/upload-artifact sat on v3.1.3 in all four Windows +# workflows -- four majors behind, and a version GitHub began auto-failing on +# 2025-01-30. actions/checkout sat on an unpinned @v4, three majors behind. +# +# Dependabot understands the SHA form and rewrites the trailing version comment +# together with the pin, so the comment cannot drift away from the SHA it +# describes. That is what keeps "which exact code ran in our CI" answerable from +# the repository, which the SBOM and certification work needs on its own. +# +# This follows the pattern set by eclipse-threadx/threadx, which added the same +# configuration in August 2026 after the same drift was measured there. +# +# What this does not fix: it reports drift, not silence. A workflow that never +# triggers rots unnoticed no matter what is pinned in it, and this repository had +# that failure in its more severe form -- the four Windows workflows requested +# runs-on: windows-2019 for more than a year after GitHub retired that image, so +# every run queued for 24 hours and was cancelled without reaching a runner. No +# amount of pinning would have said so. The runner image fix is a separate +# change; this file is the drift half only. +# +# There is no entry for any other ecosystem, and that is a decision rather than +# an oversight: the project forbids external dependencies and there are no +# submodules. The one pinned toolchain input -- the Windows SDK version passed +# to VsDevCmd in scripts/build_guix_studio.cmd -- lives in a batch file that no +# Dependabot ecosystem can parse. That pin moves by hand. +updates: + - package-ecosystem: "github-actions" + # "/" is the only accepted value for this ecosystem; it covers + # .github/workflows and .github/actions. The cross-repository reusable + # workflow in regression_test.yml + # (eclipse-threadx/threadx/.github/workflows/regression_template.yml@master) + # is correctly left alone: it references a branch, not a version, so there + # is nothing for Dependabot to move. Tracking that branch is deliberate -- + # it is first-party, in the same organisation, and it means this repository + # picks up harness fixes without a bump here. + directory: "/" + + schedule: + interval: "weekly" + day: "monday" + time: "06:00" + timezone: "Etc/UTC" + + # Dependabot reads this file from the repository's DEFAULT branch, which is + # master. But master is deliberately kept behind dev, and pull requests + # belong on dev. target-branch sends the pull requests to dev and makes + # Dependabot read the workflows it is updating from dev as well. + # + # The consequence to plan for: landing this file on dev arms it, it does not + # fire it. Nothing happens until a release merge carries it to master. + # + # Setting target-branch also opts out of Dependabot *security* updates, + # which only ever run against the default branch. For this ecosystem the + # cost is small -- an action advisory arrives as an ordinary version bump on + # the weekly run -- but it is a real trade and not a detail to rediscover + # later. + target-branch: "dev" + + groups: + # Patch and minor arrive together in one pull request: they are the + # routine traffic, and reviewing them one at a time is how an update queue + # starts being ignored, which is the failure mode this file exists to + # prevent. Majors stay ungrouped, one pull request each, because every + # breaking change met in an action here has been a major: upload-artifact + # v4 stopped allowing an artifact name to be uploaded twice in a run, and + # v6 requires a runner of 2.327.1 or newer. + actions-minor-and-patch: + patterns: + - "*" + update-types: + - "minor" + - "patch" + + # Only three distinct actions are in use today -- actions/checkout, + # actions/upload-artifact and EnricoMi/publish-unit-test-result-action -- so + # the default limit of five would be enough for now. Ten is set to match the + # sibling repositories and to leave room for a wave of majors after a long + # gap, which is exactly the situation this file is being added into. + open-pull-requests-limit: 10 + + # This repository has no "dependencies" label yet; Dependabot creates it on + # the first pull request. + labels: + - "dependencies" + + # Reviewers are not listed. Unlike eclipse-threadx/threadx this repository + # has no .github/CODEOWNERS, so there is no path routing for Dependabot to + # honour. Adding one is worth doing, but it is not this file's job. + # + # Commit subjects are left at Dependabot's own "Bump x from a to b" wording. + # The project asks for a past-tense subject and still gets one: these pull + # requests are squash-merged, and the subject is set at that point. diff --git a/.github/workflows/studio_demo_test.yml b/.github/workflows/studio_demo_test.yml index 1acc41033..ac48a7d75 100644 --- a/.github/workflows/studio_demo_test.yml +++ b/.github/workflows/studio_demo_test.yml @@ -6,19 +6,22 @@ # https://opensource.org/licenses/MIT. # # SPDX-License-Identifier: MIT +# Some portions generated by Claude Code (Opus 5). # This is a basic workflow that is manually triggered name: GUIX Studio Demo Test -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch +# Controls when the action will run. dev is included deliberately: it is the +# integration branch, so a master-only trigger gated no pull request that +# anybody opened. Verified green on a runner before being switched on -- +# 227 of 227 generation tests and 212 of 212 compile tests. on: - workflow_dispatch: + workflow_dispatch: push: - branches: [ master ] + branches: [ master, dev ] pull_request: - branches: [ master ] + branches: [ master, dev ] # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -31,12 +34,21 @@ jobs: pull-requests: write # The type of runner that the job will run on - runs-on: windows-2019 + # Pinned deliberately rather than windows-latest: the image this job + # needs has to be a reviewable commit, not something that changes + # underneath the build. windows-2019 sat here until 2026-08-26, more + # than a year after GitHub retired that image, so every run queued for + # 24 hours and was then cancelled without ever reaching a runner. + runs-on: windows-2022 # Steps represent a sequence of tasks that will be executed as part of the job steps: + # Actions are pinned to a commit SHA, with the version in the trailing + # comment. A tag can be moved; a SHA cannot, so this is what makes "which + # code ran in CI" answerable from the repository. Dependabot moves these + # pins and rewrites the comment with them -- see .github/dependabot.yml. - name: Check out the repository - uses: actions/checkout@v4 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: submodules: true @@ -47,7 +59,7 @@ jobs: run: scripts\test_studio_demo.cmd - name: Publish Test Results - uses: EnricoMi/publish-unit-test-result-action/composite@v2 + uses: EnricoMi/publish-unit-test-result-action/composite@d0a4676d0e0b938bc201470d88276b7c74c712b3 # v2.24.0 if: always() with: check_name: Test Results GUIX Studio Demo @@ -56,7 +68,7 @@ jobs: - name: Upload Test Results if: success() || failure() - uses: actions/upload-artifact@v3.1.3 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: test_reports path: | diff --git a/.github/workflows/studio_demo_test_compile.yml b/.github/workflows/studio_demo_test_compile.yml index 897eb3fcd..a5c9142c9 100644 --- a/.github/workflows/studio_demo_test_compile.yml +++ b/.github/workflows/studio_demo_test_compile.yml @@ -6,19 +6,22 @@ # https://opensource.org/licenses/MIT. # # SPDX-License-Identifier: MIT +# Some portions generated by Claude Code (Opus 5). # This is a basic workflow that is manually triggered name: GUIX Studio Demo Compile Test -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch +# Controls when the action will run. dev is included deliberately: it is the +# integration branch, so a master-only trigger gated no pull request that +# anybody opened. Verified green on a runner before being switched on -- +# 227 of 227 generation tests and 212 of 212 compile tests. on: - workflow_dispatch: + workflow_dispatch: push: - branches: [ master ] + branches: [ master, dev ] pull_request: - branches: [ master ] + branches: [ master, dev ] # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -31,12 +34,21 @@ jobs: pull-requests: write # The type of runner that the job will run on - runs-on: windows-2019 + # Pinned deliberately rather than windows-latest: the image this job + # needs has to be a reviewable commit, not something that changes + # underneath the build. windows-2019 sat here until 2026-08-26, more + # than a year after GitHub retired that image, so every run queued for + # 24 hours and was then cancelled without ever reaching a runner. + runs-on: windows-2022 # Steps represent a sequence of tasks that will be executed as part of the job steps: + # Actions are pinned to a commit SHA, with the version in the trailing + # comment. A tag can be moved; a SHA cannot, so this is what makes "which + # code ran in CI" answerable from the repository. Dependabot moves these + # pins and rewrites the comment with them -- see .github/dependabot.yml. - name: Check out the repository - uses: actions/checkout@v4 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: submodules: true @@ -47,7 +59,7 @@ jobs: run: scripts\test_studio_demo_compile.cmd - name: Publish Test Results - uses: EnricoMi/publish-unit-test-result-action/composite@v2 + uses: EnricoMi/publish-unit-test-result-action/composite@d0a4676d0e0b938bc201470d88276b7c74c712b3 # v2.24.0 if: always() with: check_name: Test Results GUIX Studio Demo Compile @@ -56,7 +68,7 @@ jobs: - name: Upload Test Results if: success() || failure() - uses: actions/upload-artifact@v3.1.3 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: test_reports path: | diff --git a/.github/workflows/studio_msix_package.yml b/.github/workflows/studio_msix_package.yml index 2ff833560..cce0d49da 100644 --- a/.github/workflows/studio_msix_package.yml +++ b/.github/workflows/studio_msix_package.yml @@ -6,6 +6,7 @@ # https://opensource.org/licenses/MIT. # # SPDX-License-Identifier: MIT +# Some portions generated by Claude Code (Opus 5). # This is a basic workflow that is manually triggered @@ -26,12 +27,21 @@ jobs: pull-requests: write # The type of runner that the job will run on - runs-on: windows-2019 + # Pinned deliberately rather than windows-latest: the image this job + # needs has to be a reviewable commit, not something that changes + # underneath the build. windows-2019 sat here until 2026-08-26, more + # than a year after GitHub retired that image, so every run queued for + # 24 hours and was then cancelled without ever reaching a runner. + runs-on: windows-2022 # Steps represent a sequence of tasks that will be executed as part of the job steps: + # Actions are pinned to a commit SHA, with the version in the trailing + # comment. A tag can be moved; a SHA cannot, so this is what makes "which + # code ran in CI" answerable from the repository. Dependabot moves these + # pins and rewrites the comment with them -- see .github/dependabot.yml. - name: Check out the repository - uses: actions/checkout@v4 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: submodules: true @@ -39,9 +49,9 @@ jobs: run: scripts/build_guix_studio_msix_package.cmd - name: Upload GUIX Studio package upload file - uses: actions/upload-artifact@v3.1.3 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: GUIXStudioPackages - path: guix_studio/build/vs_2019/msix_package_project/AppPackages + path: guix_studio/build/vs_2022/msix_package_project/AppPackages \ No newline at end of file diff --git a/.github/workflows/studio_view_test.yml b/.github/workflows/studio_view_test.yml index dac9be92d..cc4b2cb2d 100644 --- a/.github/workflows/studio_view_test.yml +++ b/.github/workflows/studio_view_test.yml @@ -6,6 +6,7 @@ # https://opensource.org/licenses/MIT. # # SPDX-License-Identifier: MIT +# Some portions generated by Claude Code (Opus 5). # This is a basic workflow that is manually triggered @@ -31,12 +32,21 @@ jobs: pull-requests: write # The type of runner that the job will run on - runs-on: windows-2019 + # Pinned deliberately rather than windows-latest: the image this job + # needs has to be a reviewable commit, not something that changes + # underneath the build. windows-2019 sat here until 2026-08-26, more + # than a year after GitHub retired that image, so every run queued for + # 24 hours and was then cancelled without ever reaching a runner. + runs-on: windows-2022 # Steps represent a sequence of tasks that will be executed as part of the job steps: + # Actions are pinned to a commit SHA, with the version in the trailing + # comment. A tag can be moved; a SHA cannot, so this is what makes "which + # code ran in CI" answerable from the repository. Dependabot moves these + # pins and rewrites the comment with them -- see .github/dependabot.yml. - name: Check out the repository - uses: actions/checkout@v4 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: submodules: true @@ -47,7 +57,7 @@ jobs: run: scripts\test_studio_view.cmd - name: Publish Test Results - uses: EnricoMi/publish-unit-test-result-action/composite@v2 + uses: EnricoMi/publish-unit-test-result-action/composite@d0a4676d0e0b938bc201470d88276b7c74c712b3 # v2.24.0 if: always() with: check_name: Test Results GUIX Studio View @@ -56,7 +66,7 @@ jobs: - name: Upload Test Results if: success() || failure() - uses: actions/upload-artifact@v3.1.3 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: test_reports path: | diff --git a/guix_studio/StudioXProject.cpp b/guix_studio/StudioXProject.cpp index 527878a9d..517a99537 100644 --- a/guix_studio/StudioXProject.cpp +++ b/guix_studio/StudioXProject.cpp @@ -9,6 +9,7 @@ * SPDX-License-Identifier: MIT **************************************************************************/ // Some portions generated by Codex (OpenAI GPT-5.5). +// Some portions generated by Claude Code (Opus 5). #include "system_pngs.h" @@ -254,10 +255,10 @@ FONT_RECORD DEFAULT_FONT_TABLE[] = { {NULL, -1, NULL} }; -extern IMAGE_INFO _system_png_radio_on; -extern IMAGE_INFO _system_png_radio_off; -extern IMAGE_INFO _system_png_checkbox_on; -extern IMAGE_INFO _system_png_checkbox_off; +extern STUDIO_IMAGE_INFO _system_png_radio_on; +extern STUDIO_IMAGE_INFO _system_png_radio_off; +extern STUDIO_IMAGE_INFO _system_png_checkbox_on; +extern STUDIO_IMAGE_INFO _system_png_checkbox_off; // FIXME: do we want to use hardcoded path? PIXELMAP_RECORD DEFAULT_PIXELMAP_TABLE[] = { @@ -1521,7 +1522,7 @@ BOOL studiox_project::InitializeOnePixelmap(res_info *info, palette_info *theme_ image_reader *pReader = NULL; CString abspath; - IMAGE_INFO *default_image_info = NULL; + STUDIO_IMAGE_INFO *default_image_info = NULL; int frame_count = 1; int frame_id = -1; diff --git a/guix_studio/resource_gen.cpp b/guix_studio/resource_gen.cpp index 5be93459d..cc24e35ab 100644 --- a/guix_studio/resource_gen.cpp +++ b/guix_studio/resource_gen.cpp @@ -9,6 +9,7 @@ * SPDX-License-Identifier: MIT **************************************************************************/ // Some portions generated by Codex (OpenAI GPT-5.5). +// Some portions generated by Claude Code (Opus 5). @@ -4156,7 +4157,7 @@ GX_PIXELMAP* resource_gen::RotatePixelmap(res_info* info, int theme_id, GX_PIXEL image_reader *pReader = NULL; CString abspath; - IMAGE_INFO* default_image_info = NULL; + STUDIO_IMAGE_INFO* default_image_info = NULL; int frame_count = 1; if (info->is_default && info->pathinfo.pathname.IsEmpty()) diff --git a/guix_studio/resource_view.h b/guix_studio/resource_view.h index f0296d399..8c6dcc452 100644 --- a/guix_studio/resource_view.h +++ b/guix_studio/resource_view.h @@ -8,6 +8,7 @@ * * SPDX-License-Identifier: MIT **************************************************************************/ +// Some portions generated by Claude Code (Opus 5). @@ -16,7 +17,7 @@ #include class resource_view_provider; -struct IMAGE_INFO; +struct STUDIO_IMAGE_INFO; struct COLOR_RECORD { char *name; @@ -34,7 +35,7 @@ struct PIXELMAP_RECORD { char *name; int pixelmap_id; BOOL include_alpha; - IMAGE_INFO *image_info; + STUDIO_IMAGE_INFO *image_info; }; struct font_table { diff --git a/guix_studio/system_pngs.cpp b/guix_studio/system_pngs.cpp index f78df6074..b4fd771cb 100644 --- a/guix_studio/system_pngs.cpp +++ b/guix_studio/system_pngs.cpp @@ -8,6 +8,7 @@ * * SPDX-License-Identifier: MIT **************************************************************************/ +// Some portions generated by Claude Code (Opus 5). #include "system_pngs.h" @@ -112,22 +113,22 @@ static unsigned char SYSTEM_PNG_CHECKBOX_OFF_pixelmap_data[519] = 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 }; -IMAGE_INFO _system_png_radio_on = { +STUDIO_IMAGE_INFO _system_png_radio_on = { SYSTEM_PNG_RADIO_ON_pixelmap_data, sizeof(SYSTEM_PNG_RADIO_ON_pixelmap_data) }; -IMAGE_INFO _system_png_radio_off = { +STUDIO_IMAGE_INFO _system_png_radio_off = { SYSTEM_PNG_RADIO_OFF_pixelmap_data, sizeof(SYSTEM_PNG_RADIO_ON_pixelmap_data) }; -IMAGE_INFO _system_png_checkbox_on = { +STUDIO_IMAGE_INFO _system_png_checkbox_on = { SYSTEM_PNG_CHECKBOX_ON_pixelmap_data, sizeof(SYSTEM_PNG_CHECKBOX_ON_pixelmap_data) }; -IMAGE_INFO _system_png_checkbox_off = { +STUDIO_IMAGE_INFO _system_png_checkbox_off = { SYSTEM_PNG_CHECKBOX_OFF_pixelmap_data, sizeof(SYSTEM_PNG_CHECKBOX_OFF_pixelmap_data) }; \ No newline at end of file diff --git a/guix_studio/system_pngs.h b/guix_studio/system_pngs.h index 910499c09..1b3cff036 100644 --- a/guix_studio/system_pngs.h +++ b/guix_studio/system_pngs.h @@ -8,11 +8,12 @@ * * SPDX-License-Identifier: MIT **************************************************************************/ +// Some portions generated by Claude Code (Opus 5). #ifndef _SYSTEM_PNGS_ #define _SYSTEM_PNGS_ -struct IMAGE_INFO { +struct STUDIO_IMAGE_INFO { unsigned char* data; int data_len; }; diff --git a/scripts/build_guix.cmd b/scripts/build_guix.cmd index 205723baa..647d4ca44 100644 --- a/scripts/build_guix.cmd +++ b/scripts/build_guix.cmd @@ -7,13 +7,26 @@ @rem @rem SPDX-License-Identifier: MIT @rem Some portions generated by Codex (OpenAI GPT-5.5). +@rem Some portions generated by Claude Code (Opus 5). -rem Initialize the developer environment just like a developer box. Note that 'call' keyword that ensures that the script does not exist after -rem calling the other batch file. -call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 +rem Initialize the developer environment just like a developer box. The Visual +rem Studio edition differs between a developer machine and a GitHub runner, so +rem locate the installation with vswhere rather than assuming an edition path. +rem Note the 'call' keyword, which ensures that this script does not exit when +rem the other batch file returns. +set "VSINSTALL=" +set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" +if exist "%VSWHERE%" ( + for /f "usebackq tokens=*" %%i in (`"%VSWHERE%" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do set "VSINSTALL=%%i" +) -rem Set Python path -SET PATH=%PATH%;"C:\Program Files\Python36";"C:\Program Files\Python36\scripts" +if not defined VSINSTALL ( + echo Visual Studio 2022 with MSBuild was not found. + exit /B 1 +) + +call "%VSINSTALL%\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 +if ERRORLEVEL 1 exit /B %ERRORLEVEL% rem Save working directory so that we can restore it back after building everything. This will make developers happy and then rem switch to the folder this script resides in. Don't assume absolute paths because on the build host and on the dev host the locations may be different. diff --git a/scripts/build_guix_studio.cmd b/scripts/build_guix_studio.cmd index 6bebc2c7d..600a05ed3 100644 --- a/scripts/build_guix_studio.cmd +++ b/scripts/build_guix_studio.cmd @@ -6,15 +6,28 @@ @rem https://opensource.org/licenses/MIT. @rem @rem SPDX-License-Identifier: MIT +@rem Some portions generated by Claude Code (Opus 5). @echo off -rem Initialize the developer environment just like a developer box. Note that 'call' keyword that ensures that the script does not exist after -rem calling the other batch file. -call "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 -winsdk=10.0.22621.0 +rem Initialize the developer environment just like a developer box. The Visual +rem Studio edition differs between a developer machine and a GitHub runner, so +rem locate the installation with vswhere rather than assuming an edition path. +rem Note the 'call' keyword, which ensures that this script does not exit when +rem the other batch file returns. +set "VSINSTALL=" +set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" +if exist "%VSWHERE%" ( + for /f "usebackq tokens=*" %%i in (`"%VSWHERE%" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do set "VSINSTALL=%%i" +) -rem Set Python path. Not needed if installed with WinGet. -rem SET PATH=%PATH%;"C:\Program Files\Python36";"C:\Program Files\Python36\scripts" +if not defined VSINSTALL ( + echo Visual Studio 2022 with MSBuild was not found. + exit /B 1 +) + +call "%VSINSTALL%\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 +if ERRORLEVEL 1 exit /B %ERRORLEVEL% rem Save working directory so that we can restore it back after building everything. This will make developers happy and then rem switch to the folder this script resides in. Don't assume absolute paths because on the build host and on the dev host the locations may be different. diff --git a/scripts/test_studio_demo.cmd b/scripts/test_studio_demo.cmd index 3143f485c..4a6bbca64 100644 --- a/scripts/test_studio_demo.cmd +++ b/scripts/test_studio_demo.cmd @@ -7,13 +7,26 @@ @rem @rem SPDX-License-Identifier: MIT @rem Some portions generated by Codex (OpenAI GPT-5.5). +@rem Some portions generated by Claude Code (Opus 5). -rem Initialize the developer environment just like a developer box. Note that 'call' keyword that ensures that the script does not exist after -rem calling the other batch file. -call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 +rem Initialize the developer environment just like a developer box. The Visual +rem Studio edition differs between a developer machine and a GitHub runner, so +rem locate the installation with vswhere rather than assuming an edition path. +rem Note the 'call' keyword, which ensures that this script does not exit when +rem the other batch file returns. +set "VSINSTALL=" +set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" +if exist "%VSWHERE%" ( + for /f "usebackq tokens=*" %%i in (`"%VSWHERE%" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do set "VSINSTALL=%%i" +) -rem Set Python path -SET PATH=%PATH%;"C:\Program Files\Python36";"C:\Program Files\Python36\scripts" +if not defined VSINSTALL ( + echo Visual Studio 2022 with MSBuild was not found. + exit /B 1 +) + +call "%VSINSTALL%\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 +if ERRORLEVEL 1 exit /B %ERRORLEVEL% rem Save working directory so that we can restore it back after building everything. This will make developers happy and then rem switch to the folder this script resides in. Don't assume absolute paths because on the build host and on the dev host the locations may be different. diff --git a/scripts/test_studio_demo_compile.cmd b/scripts/test_studio_demo_compile.cmd index 5a08cf24f..217cff9a1 100644 --- a/scripts/test_studio_demo_compile.cmd +++ b/scripts/test_studio_demo_compile.cmd @@ -7,13 +7,26 @@ @rem @rem SPDX-License-Identifier: MIT @rem Some portions generated by Codex (OpenAI GPT-5.5). +@rem Some portions generated by Claude Code (Opus 5). -rem Initialize the developer environment just like a developer box. Note that 'call' keyword that ensures that the script does not exist after -rem calling the other batch file. -call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 +rem Initialize the developer environment just like a developer box. The Visual +rem Studio edition differs between a developer machine and a GitHub runner, so +rem locate the installation with vswhere rather than assuming an edition path. +rem Note the 'call' keyword, which ensures that this script does not exit when +rem the other batch file returns. +set "VSINSTALL=" +set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" +if exist "%VSWHERE%" ( + for /f "usebackq tokens=*" %%i in (`"%VSWHERE%" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do set "VSINSTALL=%%i" +) -rem Set Python path -SET PATH=%PATH%;"C:\Program Files\Python36";"C:\Program Files\Python36\scripts" +if not defined VSINSTALL ( + echo Visual Studio 2022 with MSBuild was not found. + exit /B 1 +) + +call "%VSINSTALL%\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 +if ERRORLEVEL 1 exit /B %ERRORLEVEL% rem Save working directory so that we can restore it back after building everything. This will make developers happy and then rem switch to the folder this script resides in. Don't assume absolute paths because on the build host and on the dev host the locations may be different. diff --git a/scripts/test_studio_view.cmd b/scripts/test_studio_view.cmd index fa7724a41..2bcda14b6 100644 --- a/scripts/test_studio_view.cmd +++ b/scripts/test_studio_view.cmd @@ -7,13 +7,26 @@ @rem @rem SPDX-License-Identifier: MIT @rem Some portions generated by Codex (OpenAI GPT-5.5). +@rem Some portions generated by Claude Code (Opus 5). -rem Initialize the developer environment just like a developer box. Note that 'call' keyword that ensures that the script does not exist after -rem calling the other batch file. -call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 +rem Initialize the developer environment just like a developer box. The Visual +rem Studio edition differs between a developer machine and a GitHub runner, so +rem locate the installation with vswhere rather than assuming an edition path. +rem Note the 'call' keyword, which ensures that this script does not exit when +rem the other batch file returns. +set "VSINSTALL=" +set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" +if exist "%VSWHERE%" ( + for /f "usebackq tokens=*" %%i in (`"%VSWHERE%" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do set "VSINSTALL=%%i" +) -rem Set Python path -SET PATH=%PATH%;"C:\Program Files\Python36";"C:\Program Files\Python36\scripts" +if not defined VSINSTALL ( + echo Visual Studio 2022 with MSBuild was not found. + exit /B 1 +) + +call "%VSINSTALL%\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 +if ERRORLEVEL 1 exit /B %ERRORLEVEL% rem Save working directory so that we can restore it back after building everything. This will make developers happy and then rem switch to the folder this script resides in. Don't assume absolute paths because on the build host and on the dev host the locations may be different. diff --git a/test/guix_studio_test/test_demo/test_main.py b/test/guix_studio_test/test_demo/test_main.py index 76f5af255..7b2f8ebf7 100644 --- a/test/guix_studio_test/test_demo/test_main.py +++ b/test/guix_studio_test/test_demo/test_main.py @@ -641,7 +641,7 @@ def __main__(): os.chdir(current_path) studio_sln_path = "../../../guix_studio/build/vs_2022/studiox.sln" studio_exe_path = "../../../guix_studio/build/vs_2022/Release/guix_studio.exe" - guix_project_path = "../../../ports/win32/build/vs_2022/guix.vcxproj" + guix_project_path = "../../../ports/win32/build/vs_2019/guix.vcxproj" gxp_projects = [] diff --git a/test/guix_studio_test/test_view/test_main.py b/test/guix_studio_test/test_view/test_main.py index 1146e3558..6cf431b4d 100644 --- a/test/guix_studio_test/test_view/test_main.py +++ b/test/guix_studio_test/test_view/test_main.py @@ -82,7 +82,7 @@ def __main__(): logging.basicConfig(stream=test_utils.test_log_stream, level=logging.DEBUG, format=Format) msbuild_exe_path = "C:/Windows/Microsoft.NET/Framework64/v4.0.30319/MSBuild.exe" - project_sln_path = "../../../guix_studio/build/vs_2019/studiox.sln" + project_sln_path = "../../../guix_studio/build/vs_2022/studiox.sln" parser = argparse.ArgumentParser(description = "Test Studio UI") parser.add_argument('-b', action='store_true', dest='build_studio', help='Build Studio') diff --git a/test/guix_studio_test/test_view/test_string_import_export.py b/test/guix_studio_test/test_view/test_string_import_export.py index 231b8d039..db513bbcf 100644 --- a/test/guix_studio_test/test_view/test_string_import_export.py +++ b/test/guix_studio_test/test_view/test_string_import_export.py @@ -98,7 +98,7 @@ def csv_string_import_export(): print("import string from command line") test_utils.toolbar_save() test_utils.close_project(1) - studio_release = test_utils.DEFAULT_OUTPUT_FILE_PATH + "../../../../guix_studio/build/vs_2019/Release/guix_studio.exe" + studio_release = test_utils.DEFAULT_OUTPUT_FILE_PATH + "../../../../guix_studio/build/vs_2022/Release/guix_studio.exe" project_pathname = test_utils.DEFAULT_OUTPUT_FILE_PATH + "/test_string_import_export.gxp" studio_release = os.path.abspath(studio_release) project_pathname = os.path.abspath(project_pathname) diff --git a/test/guix_studio_test/test_view/test_utils.py b/test/guix_studio_test/test_view/test_utils.py index dc7b5d18f..17e43fb05 100644 --- a/test/guix_studio_test/test_view/test_utils.py +++ b/test/guix_studio_test/test_view/test_utils.py @@ -28,7 +28,7 @@ user32 = ctypes.windll.user32 -studio_exe_path = "../../../guix_studio/build/vs_2019/Release/guix_studio.exe" +studio_exe_path = "../../../guix_studio/build/vs_2022/Release/guix_studio.exe" top_windows = [] WM_CLOSE = 0x0010 reset_map_format = False