From 85fb9b70f4f41ead644b24f98052e6ffd9699e48 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 20 Jul 2026 08:21:48 +0900 Subject: fix(diagnose-command): stop holding a Config borrow across http calls execute() held &config.borrow() across check_http/check_composer_repo/ check_composer_audit, which reach HttpDownloader -> CurlDownloader:: download; that method does self.config.borrow_mut() on the same Config RefCell, panicking with "RefCell already borrowed" once the phpinfo panic that previously masked this was fixed. Switch those three helpers to take the Rc> handle (matching check_version's existing pattern) and borrow only where a field is actually read, so no borrow spans the downstream network call. Un-ignore the now-passing run_diagnose smoke test and test_cmd_fail; test_cmd_success stays ignored, now for two separate reasons: it needs real network access (as the PHP original does), and shirabe_php_shim::OPENSSL_VERSION_NUMBER is a hardcoded stub (0) that always trips check_platform's TLSv1.1/1.2 support check regardless of the real linked OpenSSL, forcing a non-zero exit code. --- crates/shirabe/src/lib.rs | 4 ---- 1 file changed, 4 deletions(-) (limited to 'crates/shirabe/src/lib.rs') diff --git a/crates/shirabe/src/lib.rs b/crates/shirabe/src/lib.rs index 4d17f6c6..4667e7c9 100644 --- a/crates/shirabe/src/lib.rs +++ b/crates/shirabe/src/lib.rs @@ -182,10 +182,6 @@ mod cli_tests { run_config => "config", run_create_project => "create-project", run_depends => "depends", - #[ignore = "DiagnoseCommand::check_http passes &config.borrow() into a call chain that \ - reaches CurlDownloader::download, which then does self.config.borrow_mut() on \ - the same Config RefCell, panicking with 'RefCell already borrowed'; same root \ - cause as tests/command/diagnose_command_test.rs"] run_diagnose => "diagnose", run_dump_autoload => "dump-autoload", run_exec => "exec", -- cgit v1.3.1