Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 45 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
timeout-minutes: 5
outputs:
rust: ${{ steps.groups.outputs.rust }}
sharing: ${{ steps.groups.outputs.sharing }}
windows: ${{ steps.groups.outputs.windows }}
windows_native: ${{ steps.groups.outputs.windows_native }}
static: ${{ steps.groups.outputs.static }}
Expand Down Expand Up @@ -103,7 +104,7 @@ jobs:
cargo run --locked -p xtask-check
windows-cli:
needs: changes
if: needs.changes.outputs.windows == 'true' || needs.changes.outputs.windows_native == 'true'
if: needs.changes.outputs.windows == 'true' || needs.changes.outputs.windows_native == 'true' || needs.changes.outputs.sharing == 'true'
runs-on: [self-hosted, windows, x64]
timeout-minutes: 15
env:
Expand All @@ -125,16 +126,19 @@ jobs:
run: '& "$env:GITHUB_WORKSPACE\scripts\ci-windows-target.ps1"'
- name: Verify native Windows CLI boundaries
run: cargo test --locked -p dim-cli --lib
- name: Verify independent shared RPC streams on native Windows pipes
if: needs.changes.outputs.sharing == 'true'
run: cargo test --locked -p dim-terminal-transport --test windows_pipe_flow
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
if: needs.changes.outputs.windows_native == 'true'
if: needs.changes.outputs.windows_native == 'true' || needs.changes.outputs.sharing == 'true'
with:
node-version-file: .node-version
package-manager-cache: false
- name: Provision portable CMake and NASM
# aws-lc-sys builds C sources on Windows x64 and needs NASM and CMake.
# The self-hosted runner has no installer rights, so unpack pinned
# portable archives under RUNNER_TEMP and expose them to this job only.
if: needs.changes.outputs.windows_native == 'true'
if: needs.changes.outputs.windows_native == 'true' || needs.changes.outputs.sharing == 'true'
shell: powershell
env:
CMAKE_VERSION: '3.31.6'
Expand All @@ -147,6 +151,27 @@ jobs:
if: needs.changes.outputs.windows_native == 'true'
shell: powershell
run: node scripts/test-windows-native.mjs
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
if: needs.changes.outputs.sharing == 'true'
with:
go-version-file: runtime/native-sharing/go.mod
cache: false
- name: Verify shared daemon shutdown from the Windows CLI
if: needs.changes.outputs.sharing == 'true'
shell: powershell
run: |
cargo build --locked -p dimcode -p dim-terminal-transport -p dim-app-server --bin dimcode --bin dim-terminal-transport --example sharing-shutdown-fixture
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
$bin = New-Item -ItemType Directory (Join-Path $env:RUNNER_TEMP ([guid]::NewGuid()))
try {
Copy-Item "$env:CARGO_TARGET_DIR/debug/dimcode.exe", "$env:CARGO_TARGET_DIR/debug/dim-terminal-transport.exe" $bin.FullName
node scripts/build-sharing.mjs $bin.FullName
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
$env:DIM_SHARING_TEST_CLI = Join-Path $bin.FullName 'dimcode.exe'
node --test scripts/native-sharing-flow.mjs
} finally {
Remove-Item -Recurse -Force $bin.FullName
}
web:
needs: changes
if: needs.changes.outputs.web == 'true'
Expand Down Expand Up @@ -374,6 +399,23 @@ jobs:
- name: Verify downloaded Node runtime
if: needs.changes.outputs.node == 'true' && github.event_name != 'pull_request'
run: node scripts/run-rust-test.mjs target/test-artifacts.jsonl transport_flow runtime_manager::runtime_switches_from_system_to_downloaded_node --ignored --exact
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
if: needs.changes.outputs.sharing == 'true'
with:
go-version-file: runtime/native-sharing/go.mod
cache: false
- name: Verify native sharing and App Server protocol parity
if: needs.changes.outputs.sharing == 'true'
shell: bash
run: |
set -euo pipefail
(cd runtime/native-sharing && go test -mod=readonly -race ./...)
bin=$(mktemp -d)
trap 'rm -rf "$bin"' EXIT
cp target/debug/{dimcode,dim-terminal-transport} "$bin/"
node scripts/build-sharing.mjs "$bin"
cargo build --locked -p dim-app-server --example sharing-shutdown-fixture
DIM_SHARING_TEST_CLI="$bin/dimcode" node --test scripts/native-sharing-flow.mjs
macos-native:
needs: changes
if: (github.event_name == 'pull_request' && needs.changes.outputs.rust == 'true') || needs.changes.outputs.macos_scripts == 'true'
Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ jobs:
node-version-file: .node-version
architecture: ${{ runner.arch == 'ARM64' && 'arm64' || 'x64' }}
package-manager-cache: false
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
if: hashFiles('runtime/native-sharing/go.mod') != ''
with:
go-version-file: runtime/native-sharing/go.mod
cache-dependency-path: runtime/native-sharing/go.sum
- name: Check native build host and disk space
shell: bash
run: |
Expand Down Expand Up @@ -259,10 +264,16 @@ jobs:
else
cargo build --release --locked --target "$DIM_BUILD_TARGET" -p dimcode
fi
if [[ -f runtime/native-sharing/go.mod ]]; then
cargo build --release --locked --target "$DIM_BUILD_TARGET" -p dim-terminal-transport
fi
"$BIN_DIR/dimcode" --version
'
else
DIM_RELEASE_BUILD=1 cargo build --release --locked --target "$DIM_BUILD_TARGET" -p dimcode
if [[ -f runtime/native-sharing/go.mod ]]; then
cargo build --release --locked --target "$DIM_BUILD_TARGET" -p dim-terminal-transport
fi
fi
echo "DIM_BIN_DIR=$PWD/$bin_dir" >> "$GITHUB_ENV"
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
Expand All @@ -279,7 +290,13 @@ jobs:
set -euo pipefail
if [[ "$RUNNER_OS" == Windows ]]; then export PATH="$(cygpath -u "$WINDIR")/System32:$PATH"; fi
node scripts/stage-plugins.mjs "staging/plugins-$DIM_BUILD_PLATFORM"
node scripts/stage-release.mjs "$DIM_BIN_DIR" "staging/$DIM_BUILD_PLATFORM" "$RELEASE_VERSION" "$SOURCE_SHA" --account --plugins "staging/plugins-$DIM_BUILD_PLATFORM" --rust-notices staging/rust-notices.txt
sharing=()
if [[ -f runtime/native-sharing/go.mod ]]; then
sharing_dir="target/$DIM_BUILD_TARGET/release"
node scripts/build-sharing.mjs "$sharing_dir"
sharing=(--sharing "$sharing_dir")
fi
node scripts/stage-release.mjs "$DIM_BIN_DIR" "staging/$DIM_BUILD_PLATFORM" "$RELEASE_VERSION" "$SOURCE_SHA" --account --plugins "staging/plugins-$DIM_BUILD_PLATFORM" --rust-notices staging/rust-notices.txt "${sharing[@]}"
node scripts/pack-release.mjs "staging/$DIM_BUILD_PLATFORM" "release/$DIM_BUILD_PLATFORM"
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
Expand Down
90 changes: 87 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[workspace]
resolver = "2"
members = ["crates/dim-agent-types", "crates/dim-agent-runtime", "crates/dim-agent-capabilities", "crates/dim-agent-aimux", "crates/dim-agent-attachments", "crates/dim-agent-questions", "crates/dim-agent-scheduler", "crates/dim-event-hub", "crates/dim-app-server", "crates/dim-client", "crates/dim-acp", "crates/dim-cli", "crates/dim-oauth", "crates/dim-session-title", "crates/dim-goal", "crates/dim-report", "crates/dim-codemode", "crates/dim-modality", "crates/dim-image-understanding", "crates/dim-ocr", "crates/dim-modality-aimux", "crates/dimcode", "crates/dim-migration", "xtask", "xtask/check", "tests/extension-a", "tests/extension-b", "tests/integration"]
members = ["crates/dim-agent-types", "crates/dim-agent-runtime", "crates/dim-agent-capabilities", "crates/dim-agent-aimux", "crates/dim-agent-attachments", "crates/dim-agent-questions", "crates/dim-agent-scheduler", "crates/dim-event-hub", "crates/dim-app-server", "crates/dim-client", "crates/dim-terminal-transport", "crates/dim-acp", "crates/dim-cli", "crates/dim-oauth", "crates/dim-session-title", "crates/dim-goal", "crates/dim-report", "crates/dim-codemode", "crates/dim-modality", "crates/dim-image-understanding", "crates/dim-ocr", "crates/dim-modality-aimux", "crates/dimcode", "crates/dim-migration", "xtask", "xtask/check", "tests/extension-a", "tests/extension-b", "tests/integration"]
exclude = ["vendor/grok-build"]

[workspace.package]
Expand Down
5 changes: 5 additions & 0 deletions crates/dim-app-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ webpki-roots = "1"

[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.61.2", features = ["Win32_Foundation", "Win32_Security", "Win32_Security_Authorization", "Win32_System_SystemServices", "Win32_System_Threading"] }
dim-client.workspace = true

[target.'cfg(unix)'.dependencies]
libc = "0.2.189"
Expand Down Expand Up @@ -111,3 +112,7 @@ flate2 = "1.1"

[lints]
workspace = true

[[example]]
name = "sharing-shutdown-fixture"
path = "tests/fixtures/sharing_shutdown.rs"
Loading