diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-08 03:52:33 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-08 10:38:35 +0900 |
| commit | 0209f63210e5b547b5c6b73367bb80ea86c255ec (patch) | |
| tree | 6ce0f50f343fc51da0db413278093d63d0a9fe70 /crates/shirabe/src/console/application.rs | |
| parent | b4f16a379e919eefc2cb37bcddee589c0f26eaad (diff) | |
| download | php-shirabe-0209f63210e5b547b5c6b73367bb80ea86c255ec.tar.gz php-shirabe-0209f63210e5b547b5c6b73367bb80ea86c255ec.tar.zst php-shirabe-0209f63210e5b547b5c6b73367bb80ea86c255ec.zip | |
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) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/console/application.rs')
| -rw-r--r-- | crates/shirabe/src/console/application.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/shirabe/src/console/application.rs b/crates/shirabe/src/console/application.rs index 36151563..96f80d9b 100644 --- a/crates/shirabe/src/console/application.rs +++ b/crates/shirabe/src/console/application.rs @@ -2301,10 +2301,10 @@ impl ApplicationHandle { io.write_error("<warning>Composer is operating slower than normal because you have Xdebug enabled. See https://getcomposer.org/xdebug</warning>"); } - if defined("COMPOSER_DEV_WARNING_TIME") + if let Some(dev_warning_time) = composer::COMPOSER_DEV_WARNING_TIME && command_name.as_deref() != Some("self-update") && command_name.as_deref() != Some("selfupdate") - && time() > shirabe_php_shim::composer_dev_warning_time() + && time() > dev_warning_time { io.write_error(&format!( "<warning>Warning: This development build of Composer is over 60 days old. It is recommended to update it by running \"{} self-update\" to get the latest version.</warning>", |
