From 0209f63210e5b547b5c6b73367bb80ea86c255ec Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 8 Aug 2026 03:52:33 +0900 Subject: feat(composer): bake the dev build warning deadline in at build time Composer defines COMPOSER_DEV_WARNING_TIME from its phar stub when the compiled version is a commit hash rather than a tag, so the value exists only in the build artifact. It was a todo!() in the PHP shim, leaving the warning branch in Application::do_run unreachable. A build script now derives it the way Compiler does, from git describe and the HEAD commit date, and composer::COMPOSER_DEV_WARNING_TIME holds the result as a Rust constant instead of a runtime-defined one. Co-Authored-By: Claude Opus 5 (1M context) --- crates/shirabe/tests/application_test.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'crates/shirabe/tests') diff --git a/crates/shirabe/tests/application_test.rs b/crates/shirabe/tests/application_test.rs index 6ce9166b..794a4352 100644 --- a/crates/shirabe/tests/application_test.rs +++ b/crates/shirabe/tests/application_test.rs @@ -1,10 +1,5 @@ //! ref: composer/tests/Composer/Test/ApplicationTest.php -// These drive the console Application (doRun, command resolution, plugin disabling). -// The tests exercising do_run's script-command registration (a todo!() pending the -// Symfony command-registry model), or a runtime define() of COMPOSER_DEV_WARNING_TIME, -// remain unportable. - #[path = "common/bootstrap.rs"] mod bootstrap; #[path = "common/test_case.rs"] @@ -40,7 +35,7 @@ impl Drop for TearDown { } } -#[ignore = "shirabe_php_shim::define is a todo!() (there is no runtime constant registry), so COMPOSER_DEV_WARNING_TIME cannot be defined and defined() — a fixed matches! that omits it — keeps the warning branch unreachable"] +#[ignore = "the dev warning deadline is a Rust constant baked in by build.rs, so a runtime define() of COMPOSER_DEV_WARNING_TIME cannot make Application take the warning branch"] #[test] fn test_dev_warning() { let _tear_down = TearDown; -- cgit v1.3.1-4-g156e