start implementing dependencies of dependency#6
Merged
Conversation
76beb2e to
b03e977
Compare
Draft
KSXGitHub
pushed a commit
that referenced
this pull request
Apr 30, 2026
`FsReadHead::read_head` mirrors a single `read(2)` syscall, which POSIX permits to return short. The previous shebang reader took the result of that one call as the whole prefix — fine for regular files (which never return short on a fresh open at offset 0), but wrong on pseudo-fs paths (`/proc`, `/sys`, FUSE) where short reads are routine. A short read at offset 0 could truncate the shebang and silently misroute the runtime. Keep the capability dead simple — one syscall, no algorithm hidden in the trait — and add the loop one level up: * Extend `FsReadHead::read_head` with an `offset: u64` parameter so the loop can advance the file position between calls without each fake having to track state. `RealApi::read_head` seeks before its single `read` call when offset > 0. * Add `pub fn read_head_filled<Api: FsReadHead>(path, buf)` in `shim.rs` that loops the trait until `buf` is full or `Ok(0)` (EOF). Stays generic over `Api` so test fakes don't have to grow. * `read_shebang` now calls `read_head_filled` instead of the raw trait method. Five unit tests pin the new utility's behaviour: * long file fills the buffer (real fs, hot path) * short file returns the partial count without erroring (real fs) * fake-driven short reads accumulate, with offsets advancing 0/3/6 * `Ok(0)` from the fake terminates the loop with the partial count * IO error from the fake propagates without retry Each test was broken-and-verified against a deliberately wrong implementation to confirm it actually catches the regression it claims to. Refs #333 (comment)
zkochan
added a commit
to Saturate/pacquet
that referenced
this pull request
May 7, 2026
Match upstream's NDJSON wire format for the build phase so @pnpm/cli.default-reporter parses pacquet's lifecycle output the same way it parses pnpm's. - Add `LogEvent::Lifecycle(LifecycleLog)` with the three upstream message shapes (Script, Stdio, Exit) as a `#[serde(untagged)]` union, mirroring `core/core-loggers/src/lifecycleLogger.ts`. - Add `LogEvent::IgnoredScripts(IgnoredScriptsLog)` carrying `packageNames` (camelCase), mirroring `ignoredScriptsLogger.ts`. - `pacquet-executor` depends on `pacquet-reporter`. `run_postinstall_hooks` / `run_lifecycle_hook` are now generic over `R: Reporter`. The hook switches from `Stdio::inherit()` to `Stdio::piped()` and reads each stream on its own thread, emitting one `Stdio` event per line. A `Script` event fires before spawn, `Exit` fires after wait — same ordering as `runLifecycleHook.ts:102/165`. - `BuildModules::run::<R>` collects sorted (peer-stripped) keys of packages that hit the "not in allowBuilds" branch and returns them as `Vec<String>`. Explicit `false` is silently skipped, matching upstream's switch in `building/during-install/src/index.ts:88-101`. - `InstallFrozenLockfile::run` emits one `pnpm:ignored-scripts` event with the returned list (always, even when empty) — mirrors the unconditional emit at `installing/deps-installer/src/install/index.ts:414`. Tests: - Wire-shape tests for both new variants pin the JSON output. - Recording-fake tests for `run_postinstall_hooks` cover Script→Stdio→Exit ordering and non-zero exit propagation. - Recording-fake tests for `BuildModules::run` cover the ignored-builds return value (sorted, peer-stripped, excludes explicit-deny). - Updated `install_emits_pnpm_event_sequence` to expect the new `IgnoredScripts` event between `Stats` and `ImportingDone`. Addresses items pnpm#6 and pnpm#8 from pnpm#397. Upstream refs at `pnpm/pnpm@80037699fb`: - core/core-loggers/src/lifecycleLogger.ts - core/core-loggers/src/ignoredScriptsLogger.ts - exec/lifecycle/src/runLifecycleHook.ts - building/during-install/src/index.ts - installing/deps-installer/src/install/index.ts
zkochan
added a commit
to Saturate/pacquet
that referenced
this pull request
May 7, 2026
Match upstream's NDJSON wire format for the build phase so @pnpm/cli.default-reporter parses pacquet's lifecycle output the same way it parses pnpm's. - Add `LogEvent::Lifecycle(LifecycleLog)` with the three upstream message shapes (Script, Stdio, Exit) as a `#[serde(untagged)]` union, mirroring `core/core-loggers/src/lifecycleLogger.ts`. - Add `LogEvent::IgnoredScripts(IgnoredScriptsLog)` carrying `packageNames` (camelCase), mirroring `ignoredScriptsLogger.ts`. - `pacquet-executor` depends on `pacquet-reporter`. `run_postinstall_hooks` / `run_lifecycle_hook` are now generic over `R: Reporter`. The hook switches from `Stdio::inherit()` to `Stdio::piped()` and reads each stream on its own thread, emitting one `Stdio` event per line. A `Script` event fires before spawn, `Exit` fires after wait — same ordering as `runLifecycleHook.ts:102/165`. - `BuildModules::run::<R>` collects sorted (peer-stripped) keys of packages that hit the "not in allowBuilds" branch and returns them as `Vec<String>`. Explicit `false` is silently skipped, matching upstream's switch in `building/during-install/src/index.ts:88-101`. - `InstallFrozenLockfile::run` emits one `pnpm:ignored-scripts` event with the returned list (always, even when empty) — mirrors the unconditional emit at `installing/deps-installer/src/install/index.ts:414`. Tests: - Wire-shape tests for both new variants pin the JSON output. - Recording-fake tests for `run_postinstall_hooks` cover Script→Stdio→Exit ordering and non-zero exit propagation. - Recording-fake tests for `BuildModules::run` cover the ignored-builds return value (sorted, peer-stripped, excludes explicit-deny). - Updated `install_emits_pnpm_event_sequence` to expect the new `IgnoredScripts` event between `Stats` and `ImportingDone`. Addresses items pnpm#6 and pnpm#8 from pnpm#397. Upstream refs at `pnpm/pnpm@80037699fb`: - core/core-loggers/src/lifecycleLogger.ts - core/core-loggers/src/ignoredScriptsLogger.ts - exec/lifecycle/src/runLifecycleHook.ts - building/during-install/src/index.ts - installing/deps-installer/src/install/index.ts
zkochan
added a commit
to Saturate/pacquet
that referenced
this pull request
May 7, 2026
Match upstream's NDJSON wire format for the build phase so @pnpm/cli.default-reporter parses pacquet's lifecycle output the same way it parses pnpm's. - Add `LogEvent::Lifecycle(LifecycleLog)` with the three upstream message shapes (Script, Stdio, Exit) as a `#[serde(untagged)]` union, mirroring `core/core-loggers/src/lifecycleLogger.ts`. - Add `LogEvent::IgnoredScripts(IgnoredScriptsLog)` carrying `packageNames` (camelCase), mirroring `ignoredScriptsLogger.ts`. - `pacquet-executor` depends on `pacquet-reporter`. `run_postinstall_hooks` / `run_lifecycle_hook` are now generic over `R: Reporter`. The hook switches from `Stdio::inherit()` to `Stdio::piped()` and reads each stream on its own thread, emitting one `Stdio` event per line. A `Script` event fires before spawn, `Exit` fires after wait — same ordering as `runLifecycleHook.ts:102/165`. - `BuildModules::run::<R>` collects sorted (peer-stripped) keys of packages that hit the "not in allowBuilds" branch and returns them as `Vec<String>`. Explicit `false` is silently skipped, matching upstream's switch in `building/during-install/src/index.ts:88-101`. - `InstallFrozenLockfile::run` emits one `pnpm:ignored-scripts` event with the returned list (always, even when empty) — mirrors the unconditional emit at `installing/deps-installer/src/install/index.ts:414`. Tests: - Wire-shape tests for both new variants pin the JSON output. - Recording-fake tests for `run_postinstall_hooks` cover Script→Stdio→Exit ordering and non-zero exit propagation. - Recording-fake tests for `BuildModules::run` cover the ignored-builds return value (sorted, peer-stripped, excludes explicit-deny). - Updated `install_emits_pnpm_event_sequence` to expect the new `IgnoredScripts` event between `Stats` and `ImportingDone`. Addresses items pnpm#6 and pnpm#8 from pnpm#397. Upstream refs at `pnpm/pnpm@80037699fb`: - core/core-loggers/src/lifecycleLogger.ts - core/core-loggers/src/ignoredScriptsLogger.ts - exec/lifecycle/src/runLifecycleHook.ts - building/during-install/src/index.ts - installing/deps-installer/src/install/index.ts
zkochan
added a commit
to Saturate/pacquet
that referenced
this pull request
May 9, 2026
Match upstream's NDJSON wire format for the build phase so @pnpm/cli.default-reporter parses pacquet's lifecycle output the same way it parses pnpm's. - Add `LogEvent::Lifecycle(LifecycleLog)` with the three upstream message shapes (Script, Stdio, Exit) as a `#[serde(untagged)]` union, mirroring `core/core-loggers/src/lifecycleLogger.ts`. - Add `LogEvent::IgnoredScripts(IgnoredScriptsLog)` carrying `packageNames` (camelCase), mirroring `ignoredScriptsLogger.ts`. - `pacquet-executor` depends on `pacquet-reporter`. `run_postinstall_hooks` / `run_lifecycle_hook` are now generic over `R: Reporter`. The hook switches from `Stdio::inherit()` to `Stdio::piped()` and reads each stream on its own thread, emitting one `Stdio` event per line. A `Script` event fires before spawn, `Exit` fires after wait — same ordering as `runLifecycleHook.ts:102/165`. - `BuildModules::run::<R>` collects sorted (peer-stripped) keys of packages that hit the "not in allowBuilds" branch and returns them as `Vec<String>`. Explicit `false` is silently skipped, matching upstream's switch in `building/during-install/src/index.ts:88-101`. - `InstallFrozenLockfile::run` emits one `pnpm:ignored-scripts` event with the returned list (always, even when empty) — mirrors the unconditional emit at `installing/deps-installer/src/install/index.ts:414`. Tests: - Wire-shape tests for both new variants pin the JSON output. - Recording-fake tests for `run_postinstall_hooks` cover Script→Stdio→Exit ordering and non-zero exit propagation. - Recording-fake tests for `BuildModules::run` cover the ignored-builds return value (sorted, peer-stripped, excludes explicit-deny). - Updated `install_emits_pnpm_event_sequence` to expect the new `IgnoredScripts` event between `Stats` and `ImportingDone`. Addresses items pnpm#6 and pnpm#8 from pnpm#397. Upstream refs at `pnpm/pnpm@80037699fb`: - core/core-loggers/src/lifecycleLogger.ts - core/core-loggers/src/ignoredScriptsLogger.ts - exec/lifecycle/src/runLifecycleHook.ts - building/during-install/src/index.ts - installing/deps-installer/src/install/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pretty much work in progress