aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/installer.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-09 08:40:21 +0900
committernsfisis <nsfisis@gmail.com>2026-08-09 08:40:21 +0900
commitbe514aeff17ab7d8debcc59acddd07f7c7b72bd7 (patch)
tree4e57cb51fe76e34de35aa176ae26e9423270b8d8 /crates/shirabe/src/installer.rs
parent4d974682134f20a816dde717fdbba8e76d9b10b8 (diff)
downloadphp-shirabe-be514aeff17ab7d8debcc59acddd07f7c7b72bd7.tar.gz
php-shirabe-be514aeff17ab7d8debcc59acddd07f7c7b72bd7.tar.zst
php-shirabe-be514aeff17ab7d8debcc59acddd07f7c7b72bd7.zip
refactor(installer): drop the GC control calls
Composer turns the cycle collector off around the dependency solver, but Rust has no GC, so the gc_collect_cycles/gc_disable/gc_enable shims were no-ops. Remove the call sites and the now-callerless shim functions. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/installer.rs')
-rw-r--r--crates/shirabe/src/installer.rs17
1 files changed, 4 insertions, 13 deletions
diff --git a/crates/shirabe/src/installer.rs b/crates/shirabe/src/installer.rs
index 702569aa..22da3fff 100644
--- a/crates/shirabe/src/installer.rs
+++ b/crates/shirabe/src/installer.rs
@@ -36,8 +36,8 @@ use indexmap::IndexMap;
use shirabe_external_packages::seld::json_lint::ParsingException;
use shirabe_php_shim::{
- PhpMixed, RuntimeException, array_map, array_unique, defined, gc_collect_cycles, gc_disable,
- gc_enable, implode, intval, is_dir, is_numeric, strcmp, strpos, strtolower, touch, usort,
+ PhpMixed, RuntimeException, array_map, array_unique, implode, intval, is_dir, is_numeric,
+ strcmp, strpos, strtolower, touch, usort,
};
use shirabe_semver;
@@ -219,12 +219,8 @@ impl Installer {
/// Run installation (or update)
#[tracing::instrument(skip_all)]
pub fn run(&mut self) -> anyhow::Result<i64> {
- // Disable GC to save CPU cycles, as the dependency solver can create hundreds of thousands
- // of PHP objects, the GC can spend quite some time walking the tree of references looking
- // for stuff to collect while there is nothing to collect. This slows things down dramatically
- // and turning it off results in much better performance. Do not try this at home however.
- gc_collect_cycles();
- gc_disable();
+ // Composer disables GC to save CPU cycles, but Shirabe does not as Rust has no GC.
+ // It is possible to disable GC in PHP via RPC, but it might not be effective.
if self.update_allow_list.is_some() && self.update_mirrors {
return Err(RuntimeException::new(
@@ -478,11 +474,6 @@ impl Installer {
);
}
- // re-enable GC except on HHVM which triggers a warning here
- if !defined("HHVM_VERSION") {
- gc_enable();
- }
-
let audit_config = self.get_audit_config()?.clone();
if audit_config.audit {