Repository navigation
feat(execution): plan run configurations of a remote workspace on the host (Refs 1lck/Lithe-IDEA#2231) - #161
Merged
Merged
Conversation
… host (Refs 1lck/Lithe-IDEA#2231) - runConfig.* is routed to the workspace host like workspace.*, git.* and build.*: configuration documents, scripts, interpreters and working directories are read and checked through lithe_workspace::fs. - A host that cannot be reached fails the request instead of reporting a file or folder as missing. - Process kinds, interpreters and inline script suffixes follow the host (Linux or macOS) through run_platform(), so a Windows client never plans a batch or PowerShell run on a remote host. - runConfig.createLaunchPlan returns host paths for executable.path, arguments and inlineScript.path, so the client starts the process on the host without translating the plan. - Test fixtures that build local files keep std::fs.
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.
关联 Issue
1lck/Lithe-IDEA#2231(远程开发完整设计)R1 远程运行:远程工作区里的运行配置要在主机上解析、检查和启动。本 PR 是 Core 部分:让
runConfig.*走工作区主机,并让启动计划直接给出主机路径。桌面端在主机上启动进程、运行标签页标记和输出路径映射另开 PR。类型
改动说明
路由(
crates/core/src/runtime/dispatcher.rs)has_remote_workspace_adapter加上runConfig.。带remoteWorkspace的runConfig.*请求和workspace.*、git.*、build.*一样,在工作区主机的文件上执行。以前这些请求读的是本机占位目录,结果总是“没有配置”或“文件不存在”。运行配置读主机文件(
crates/execution/src/configuration*.rs、generated_layer.rs)std::fs改为lithe_workspace::fs。本地工作区的行为不变,远程工作区会转到主机去读。is_transport_failure转成CoreError),不会当成“文件不存在”或“项目根目录不存在”。否则断线时编辑器会把已有的脚本标成缺失。std::fs,并加了注释说明。进程按主机平台规划(
configuration.rs的run_platform(),用在form.rs、resolve.rs、validation.rs、launch.rs)Platform::Unix判断可用的进程类型、解释器和内联脚本后缀。Windows 客户端打开远程工作区时,不会规划出 batch 或 PowerShell 运行。Platform::HOST。validation.rs里配置路径格式的检查不受影响,仍是 Core 自己的规则。启动计划给主机路径(
launch.rs)runConfig.createLaunchPlan在远程工作区里把executable.path、arguments里的每一项和inlineScript.path映射回主机路径(lithe_workspace::remote_path,不在占位目录下的值不变)。客户端拿到计划后可以直接在主机上启动,不用自己翻译路径。inlineScriptBase由客户端给一个主机上的临时目录(桌面端用fs.tempDirectory),内容由客户端写到主机,进程结束后再删掉。为什么改到
executioncrate远程改动本来只放在
remote和workspace两个 crate。execution这里是必要的接线,和buildcrate 走lithe_workspace::fs的做法一样:只换了文件访问入口、平台来源和计划里路径的方向,没有加任何远程专属逻辑。Windows 客户端上远端路径按本机规则处理的问题单独记在 1lck/Lithe-IDEA#2264,本 PR 不处理。契约文档
contracts/rust-core-api.md:runConfig.createLaunchPlan一节后面加一段,说明远程工作区里runConfig.*读主机文件、按主机平台规划、计划给主机路径、inlineScriptBase必须是主机临时目录、主机连不上时请求失败。验证
cargo fmt --all -- --checkcargo clippy -p lithe-execution -p lithe-core --all-targets --all-features -- -D warnings:无警告cargo test -p lithe-execution:34 个通过cargo test -p lithe-core:全部通过;新增remote_run_configurations_resolve_and_plan_against_the_host,经过分发器在主机目录上验证:availability;/bin/bash,参数是-e和主机脚本路径,工作目录是web;.sh;workingDirectory: notFound,改成存在的文件夹后保存成功;node shared/plugins/scripts/verify-docs.mjs:通过