From 3c39377b0c419dd4cc792aef926032b15c12b69f Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 25 Jul 2026 23:25:25 +0900 Subject: fix(package-discovery): pass IO so platform requirement warnings surface findBestVersionForPackage is the only findBestCandidate() caller that PHP hands $this->getIO() to; the port passed None, so VersionSelector silently skipped every "Cannot use as it requires which is missing from your platform" warning. require/update/create-project therefore dropped a candidate without telling the user why. Un-ignores require_command_test::test_require, whose first data-provider case asserts exactly that warning. Co-Authored-By: Claude Opus 5 (1M context) --- crates/shirabe/src/command/package_discovery_trait.rs | 2 +- crates/shirabe/tests/command/require_command_test.rs | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) (limited to 'crates') diff --git a/crates/shirabe/src/command/package_discovery_trait.rs b/crates/shirabe/src/command/package_discovery_trait.rs index 52d0682c..8e34fed0 100644 --- a/crates/shirabe/src/command/package_discovery_trait.rs +++ b/crates/shirabe/src/command/package_discovery_trait.rs @@ -484,7 +484,7 @@ pub trait PackageDiscoveryTrait: BaseCommand { preferred_stability, Some(platform_requirement_filter.clone()), 0, - None, + Some(io.clone()), ShowWarnings::Always, )?; diff --git a/crates/shirabe/tests/command/require_command_test.rs b/crates/shirabe/tests/command/require_command_test.rs index bf742ea1..2ab3989b 100644 --- a/crates/shirabe/tests/command/require_command_test.rs +++ b/crates/shirabe/tests/command/require_command_test.rs @@ -266,11 +266,6 @@ Using version 1.1.0 for required/pkg", #[test] #[serial] -#[ignore = "the pre-operations-exec listener bug is fixed; now fails on the first data-provider \ - case ('warn once for missing ext but a lower package matches') because the \ - \"Cannot use required/pkg's latest version 1.2.0 as it requires ext-foobar \ - ^1 which is missing from your platform.\" message is never emitted — a \ - distinct, unimplemented require_command warning path unrelated to event dispatching"] fn test_require() { for (label, composer_json, command, expected) in provide_require() { let _tear_down = init_temp_composer(Some(&composer_json), None, None, true); -- cgit v1.3.1