Repository navigation
Give the native import probe an owned package copy again - #2949
Merged
Merged
Conversation
7a51a47 replaced the probe's private package copy with a symlink to the shared native store. Node resolves modules by realpath, so the probed ws entry's parentURL became the store path while the probe compared it with the lexical link path: the fence still refused bufferutil, the comparison filtered the refusal out, and native-scripts failed with seen == [] on every merge since #2873. The planted bufferutil also landed inside the shared store's node_modules for the length of the run. Copy the prepared package into the temporary root again so every ancestor of the probed entry is owned. TemporaryDirectory reaps the sealed copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
The ownership guard compared spelled paths, so a package symlinked under the temporary root passed it while the probe planted and removed bufferutil inside the shared store. Compare resolved paths instead. Every stack/*.py is a native build input (native_build_inputs.py:35), so the probe edit moves the inputs pin; regenerate it with prepare-pi-native --update-pins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
native-scripts has failed on every merge to main since #2873 (15:42 on 10-23; #2883 at 15:40 passed). The failure is
stack/test-native-import-rpc.py:124,seen == [].Cause. 7a51a47 (merged in #2873) replaced the probe's private package copy with a symlink into the shared native store (
stack/test-native-import-rpc.py:344). Node resolves modules by their realpath. So the parentURL of the probedws/lib/buffer-util.jsbecame the store path, while the probe compares it with the lexical link path (requiringModulefromargv[4], line 85). The fence still refusedbufferutil, but the comparison filtered the refusal out.The symlink also broke ownership.
ancestor.mkdirat line 56 plantedbufferutilinside the shared store'snode_modulesfor the length of the run. Theis_relative_to(root)guard at line 54 checks only the lexical path, so it passed anyway.Fix. Copy the prepared package into the temporary root again, so every ancestor of the probed entry is owned.
TemporaryDirectoryreaps the sealed copy. Before 7a51a47, the copy was removed byremove_native_tree. That commit deleted the function fromnative_package.py, so it no longer exists on main, and this PR does not bring it back.qualifychecks only layout and seal, so it accepts the copy.The ownership guard at line 54 now compares real paths (
package.resolve().is_relative_to(root.resolve())). A package symlinked under root therefore fails the guard before the probe can plant or removebufferutilin a shared tree (IDEN-7: the guard checked the spelled path, but the fact it needs is where the package really lives).The test is a native build input (
native_build_inputs.py:35inventories everystack/*.py), so the manifest's inputs pin is regenerated withstack/bin/prepare-pi-native --update-pins.Proof (local, Node 26.4.0, the workflow's command under the Core runtime):
AssertionError: {'factory': 'function', ..., 'seen': []}, rc 1. This is the same assertion as hosted run 40032749628, so the failure does not depend on the environment."seen": [{"code": "ERR_NATIVE_IMPORT_BOUNDARY", "parent": "file:///tmp/native-import-rpc-.../ws/lib/buffer-util.js"}]. No/tmp/native-import-rpc-*dir is left behind.Assumed:
/tmp.🤖 Generated with Claude Code