fix(setup): copy lib/ into opencode runtime root#2198
Open
netkurt wants to merge 1 commit into
Open
Conversation
The \create_opencode_runtime_root\ function (used by \./setup --host opencode\) links/copies bin/, browse/, design/, ETHOS.md, and several other files into the opencode install root, but does not include lib/. As a result, any \.ts\ script in bin/ that imports from \../lib/...\ (e.g. gstack-gbrain-detect, gstack-decision-*, gstack-redact, gstack-telemetry-log, gstack-memory-ingest, etc.) fails on opencode hosts with errors like: error: Cannot find module '../lib/gbrain-local-status' from '...gstack-gbrain-detect.ts' This patch mirrors the existing bin/ block to also link/copy lib/, and adds lib/ to the mkdir list so the directory is created on a clean install. Tested on Windows + Git Bash by extracting the function and running it on a synthetic install root: lib/ is created and contains gbrain-local-status.ts plus the other 15 lib/*.ts files. The existing bin/ and ETHOS.md paths still work.
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
Contributor
|
@16francej — recommend closing this PR as superseded by #2262. It fixes the missing-library defect only for OpenCode, while #2262 applies the shared runtime-library requirement across all selective host roots with broader tests. Credit #2198 for the OpenCode reproduction, and avoid landing this partial overlap before #2262 is corrected and tested. |
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.
The
create_opencode_runtime_rootfunction (used by./setup --host opencode) links/copiesbin/,browse/,design/,ETHOS.md, and several other files into the opencode install root, but does not includelib/. As a result, any.tsscript inbin/that imports from../lib/...(e.g.gstack-gbrain-detect,gstack-decision-*,gstack-redact,gstack-telemetry-log,gstack-memory-ingest, etc.) fails on opencode hosts with errors like:This patch mirrors the existing
bin/block to also link/copylib/, and addslib/to themkdirlist so the directory is created on a clean install.Reproduction
Before the patch, on a fresh
./setup --host opencodeinstall:After the patch, the same command runs and returns the detection JSON.
Diff
Test
Smoke test (Windows + Git Bash): extract the function with
sed,evalit, call it against a synthetic install root.lib/is created withgbrain-local-status.tsand the other 15lib/*.tsfiles.bin/andETHOS.mdpaths still work. Test script atC:\Users\Kurt\AppData\Local\Temp\opencode\oc-test\test.sh(not part of the PR).Tested on gstack v1.58.5.0 (the local
.last-setup-versionreported bygstack-gbrain-detectmatches upstreammain).