Conversation
When Visual Studio's license or trial has expired, devenv.exe /build exits non-zero even though the toolchain is otherwise present (filesystem/registry checks pass, but the IDE itself is unusable). This causes the 17 test/MSVS/*-exec.py tests to fail with a confusing build error instead of being skipped. Implement a license probe in TestSConsMSVS: - New msvs_build_usable(version) method: builds an isolated minimal dummy project via devenv/msdev to test if the toolchain is actually usable (not just present on the filesystem). - Result is cached per version at tempfile.gettempdir()/scons/msvs_license_probe_cache.json so the expensive probe build runs at most once per version per test run. - New skip_if_msvs_license_invalid(version) method: calls the probe and skips the test if it fails, with a clear message. - Each of the 17 *-exec.py test files adds one line call to this method right after the msvs_versions() presence check, before any test-specific setup. The probe generates the correct project file format (.dsp for legacy msdev, .vcproj/.vcxproj for devenv) based on version, reusing SCons's own MSVSProject builder so the probe is as realistic as possible while being isolated from the test's own real project. Fixes: tests on machines with expired Visual Studio licenses now report 'NO RESULT' (skip) instead of 'FAILED', allowing CI runs to continue even when the license is the only blocker. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
The MSVS license/expired-trial detection feature probes whether devenv/msdev
can actually build, adding overhead (extra project generation + devenv
invocation per test) in every environment. This overhead is only necessary on
AppVeyor's Windows builders where the license expiry problem is known to occur.
Add opt-in control via SCONS_MSVS_CHECK_LICENSE environment variable:
- Default: disabled (check is skipped, no overhead anywhere except AppVeyor)
- Set to "1": enables the check (runs probe, caches result per version)
- Set to anything else ("0", empty, etc.): disabled
The check is short-circuited at the top of msvs_build_usable() —
when disabled, returns True immediately and skips the entire probe
(no cache read/write, no temporary project, no extra devenv build).
Enable the check in .appveyor.yml's environment block alongside the
existing SCONS_CACHE_MSVC_CONFIG flag, so AppVeyor CI runs benefit from
the license detection while all other environments (local dev, GitHub
Actions, other CI providers) pay zero overhead by default.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Document all environment variables recognized by the test framework: - FIXTURE_DIRS: directory search path for test fixtures - PRESERVE: preserve test working directory after run - PRESERVE_PASS/PRESERVE_FAIL/PRESERVE_NORESULT: preserve on specific outcomes - SCONS_MSVS_CHECK_LICENSE: control whether VS license validity is probed This centralizes environment variable documentation in one reference section at the end of test-framework.rst, making it easy for developers to discover available options. Includes the newly-added SCONS_MSVS_CHECK_LICENSE flag. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Document the new MSVS license/expired-trial detection feature: - Added to CHANGES.txt under William Deegan's contributions for the current release - Added to RELEASE.txt under the DEVELOPMENT section - Explains the problem (expired VS license causes test failures) - Describes the solution (opt-in probing via SCONS_MSVS_CHECK_LICENSE env var) - Notes the default-off behavior to avoid overhead on unaffected environments Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
The probe SConstruct was missing the 'msvc' tool needed to compile foo.c and the 'msvs' tool needed to generate the project file. This caused the probe to crash on AppVeyor when the C++ build tools weren't available in the environment, even though VS was detected as installed. Changes: - Add 'msvc' and 'msvs' tools to the probe Environment - Wrap the SCons project generation step with status=None to capture exit code without asserting, so missing tools are treated as "not usable" rather than test failures This allows the probe to gracefully handle environments where VS is installed but the build tools aren't set up, falling back to skipping the test rather than crashing. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add detection for expired/invalid Visual Studio licenses in MSVS end-to-end tests, allowing tests to be skipped cleanly instead of failing with confusing build errors.
The 17
test/MSVS/*-exec.pytests build real Visual Studio projects usingdevenv/msdev. When the VS license/trial has expired, these invocations fail even though the toolchain is otherwise detected as present. This change probes for usable license validity before running these tests, skipping them with a clear message if the license is unavailable.Key features:
devenv/msdevto test actual usability (not just filesystem presence).dspfor legacy msdev,.vcproj/.vcxprojfor devenv) based on MSVS versionSCONS_MSVS_CHECK_LICENSEenvironment variable (default: disabled) allows enabling only where needed.appveyor.ymlsetsSCONS_MSVS_CHECK_LICENSE=1for Windows builders where license expiry is known to occurImplementation:
test/MSVS/*-exec.pytests: Added one-line call to license check after version presence check.appveyor.yml: AddedSCONS_MSVS_CHECK_LICENSE: "1"to enable check on AppVeyortesting/framework/test-framework.rst: Added Environment Variables reference section documenting all test framework env varsCHANGES.txtandRELEASE.txt: Documented the feature for the next releaseContributor Checklist:
🤖 Generated with Claude Code