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
9 changes: 0 additions & 9 deletions .github/workflows/generate-ats-diffs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,6 @@ jobs:
ASPIRE_CLI="./dotnet.sh run --no-build --project src/Aspire.Cli/Aspire.Cli.csproj --configuration Release -- --nologo"
FAILURES=0

# Ensure sdk command is available in this workflow.
echo "::group::Enable polyglot support feature"
if ! $ASPIRE_CLI config set features.polyglotSupportEnabled true --global; then
echo "::error::Failed to enable features.polyglotSupportEnabled"
echo "::endgroup::"
exit 1
fi
echo "::endgroup::"

# Dump core Aspire.Hosting capabilities (no integration argument)
echo "::group::Aspire.Hosting (core)"
if ! $ASPIRE_CLI sdk dump --ci -o src/Aspire.Hosting/api/Aspire.Hosting.ats.txt; then
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/polyglot-validation/Dockerfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ COPY setup-local-cli.sh /scripts/setup-local-cli.sh
COPY test-go.sh /scripts/test-go.sh
RUN chmod +x /scripts/setup-local-cli.sh /scripts/test-go.sh

# Entrypoint: Set up Aspire CLI, enable polyglot, run validation
# Entrypoint: Set up Aspire CLI and run validation
# Bundle extraction happens lazily on first command that needs the layout
ENTRYPOINT ["/bin/bash", "-c", "\
set -e && \
/scripts/setup-local-cli.sh && \
aspire config set features:polyglotSupportEnabled true --global && \
aspire config set features:experimentalPolyglot:go true --global && \
echo '' && \
echo '=== Running validation ===' && \
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/polyglot-validation/Dockerfile.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@
COPY test-java.sh /scripts/test-java.sh
RUN chmod +x /scripts/setup-local-cli.sh /scripts/test-java.sh

# Entrypoint: Set up Aspire CLI, enable polyglot, run validation
# Entrypoint: Set up Aspire CLI and run validation
# Bundle extraction happens lazily on first command that needs the layout
ENTRYPOINT ["/bin/bash", "-c", "\
set -e && \
/scripts/setup-local-cli.sh && \
aspire config set features:polyglotSupportEnabled true --global && \
aspire config set features:experimentalPolyglot:java true --global && \
echo '' && \
echo '=== Running validation ===' && \
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/polyglot-validation/Dockerfile.python
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ COPY setup-local-cli.sh /scripts/setup-local-cli.sh
COPY test-python.sh /scripts/test-python.sh
RUN chmod +x /scripts/setup-local-cli.sh /scripts/test-python.sh

# Entrypoint: Set up Aspire CLI, enable polyglot, run validation
# Entrypoint: Set up Aspire CLI and run validation
# Bundle extraction happens lazily on first command that needs the layout
ENTRYPOINT ["/bin/bash", "-c", "\
set -e && \
/scripts/setup-local-cli.sh && \
aspire config set features:polyglotSupportEnabled true --global && \
aspire config set features:experimentalPolyglot:python true --global && \
echo '' && \
echo '=== Running validation ===' && \
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/polyglot-validation/Dockerfile.rust
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ COPY setup-local-cli.sh /scripts/setup-local-cli.sh
COPY test-rust.sh /scripts/test-rust.sh
RUN chmod +x /scripts/setup-local-cli.sh /scripts/test-rust.sh

# Entrypoint: Set up Aspire CLI, enable polyglot, run validation
# Entrypoint: Set up Aspire CLI and run validation
# Bundle extraction happens lazily on first command that needs the layout
ENTRYPOINT ["/bin/bash", "-c", "\
set -e && \
/scripts/setup-local-cli.sh && \
aspire config set features:polyglotSupportEnabled true --global && \
aspire config set features:experimentalPolyglot:rust true --global && \
echo '' && \
echo '=== Running validation ===' && \
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/polyglot-validation/Dockerfile.typescript
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ COPY setup-local-cli.sh /scripts/setup-local-cli.sh
COPY test-typescript.sh /scripts/test-typescript.sh
RUN chmod +x /scripts/setup-local-cli.sh /scripts/test-typescript.sh

# Entrypoint: Set up Aspire CLI, enable polyglot, run validation
# Entrypoint: Set up Aspire CLI and run validation
# Bundle extraction happens lazily on first command that needs the layout
ENTRYPOINT ["/bin/bash", "-c", "\
set -e && \
/scripts/setup-local-cli.sh && \
aspire config set features:polyglotSupportEnabled true --global && \
/scripts/test-typescript.sh \
"]
19 changes: 2 additions & 17 deletions docs/specs/polyglot-apphost.md
Original file line number Diff line number Diff line change
Expand Up @@ -1425,24 +1425,9 @@ This section explains how to develop and test custom language SDKs using a local
./build.cmd # Windows
```

### Enabling Polyglot Support
### Polyglot Support

Polyglot support is behind a feature flag that must be enabled before you can use non-.NET languages. Enable it using the `aspire config` command:

```bash
# Enable polyglot support globally (recommended for SDK development)
aspire config set features:polyglotSupportEnabled true --global

# Or enable it locally for a specific project
aspire config set features:polyglotSupportEnabled true
```

This enables the `--language` option on `aspire init` and `aspire new` commands, and allows the CLI to detect and run non-.NET app hosts.

> **Note:** When running the CLI from source with `dotnet run`, use the full command:
> ```bash
> dotnet run --project /path/to/aspire/src/Aspire.Cli/Aspire.Cli.csproj -- config set features:polyglotSupportEnabled true --global
> ```
Polyglot support is enabled by default. The `--language` option is available on `aspire init` and `aspire new`, and the CLI can detect and run non-.NET AppHosts without additional configuration.

### Setting Up Local Development Mode

Expand Down
26 changes: 5 additions & 21 deletions extension/schemas/aspire-global-settings.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
]
}
],
"description": "Enable or disable experimental Go language support for polyglot Aspire applications (requires polyglotSupportEnabled)",
"description": "Enable or disable experimental Go language support for polyglot Aspire applications",
"default": false
},
"experimentalPolyglot:java": {
Expand All @@ -90,7 +90,7 @@
]
}
],
"description": "Enable or disable experimental Java language support for polyglot Aspire applications (requires polyglotSupportEnabled)",
"description": "Enable or disable experimental Java language support for polyglot Aspire applications",
"default": false
},
"experimentalPolyglot:python": {
Expand All @@ -106,7 +106,7 @@
]
}
],
"description": "Enable or disable experimental Python language support for polyglot Aspire applications (requires polyglotSupportEnabled)",
"description": "Enable or disable experimental Python language support for polyglot Aspire applications",
"default": false
},
"experimentalPolyglot:rust": {
Expand All @@ -122,7 +122,7 @@
]
}
],
"description": "Enable or disable experimental Rust language support for polyglot Aspire applications (requires polyglotSupportEnabled)",
"description": "Enable or disable experimental Rust language support for polyglot Aspire applications",
"default": false
},
"minimumSdkCheckEnabled": {
Expand Down Expand Up @@ -173,22 +173,6 @@
"description": "Enable or disable disk caching for package search results to improve performance",
"default": true
},
"polyglotSupportEnabled": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "string",
"enum": [
"true",
"false"
]
}
],
"description": "Enable or disable support for non-.NET (polyglot) languages and runtimes in Aspire applications",
"default": false
},
"runningInstanceDetectionEnabled": {
"anyOf": [
{
Expand Down Expand Up @@ -290,4 +274,4 @@
}
},
"additionalProperties": false
}
}
26 changes: 5 additions & 21 deletions extension/schemas/aspire-settings.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
]
}
],
"description": "Enable or disable experimental Go language support for polyglot Aspire applications (requires polyglotSupportEnabled)",
"description": "Enable or disable experimental Go language support for polyglot Aspire applications",
"default": false
},
"experimentalPolyglot:java": {
Expand All @@ -94,7 +94,7 @@
]
}
],
"description": "Enable or disable experimental Java language support for polyglot Aspire applications (requires polyglotSupportEnabled)",
"description": "Enable or disable experimental Java language support for polyglot Aspire applications",
"default": false
},
"experimentalPolyglot:python": {
Expand All @@ -110,7 +110,7 @@
]
}
],
"description": "Enable or disable experimental Python language support for polyglot Aspire applications (requires polyglotSupportEnabled)",
"description": "Enable or disable experimental Python language support for polyglot Aspire applications",
"default": false
},
"experimentalPolyglot:rust": {
Expand All @@ -126,7 +126,7 @@
]
}
],
"description": "Enable or disable experimental Rust language support for polyglot Aspire applications (requires polyglotSupportEnabled)",
"description": "Enable or disable experimental Rust language support for polyglot Aspire applications",
"default": false
},
"minimumSdkCheckEnabled": {
Expand Down Expand Up @@ -177,22 +177,6 @@
"description": "Enable or disable disk caching for package search results to improve performance",
"default": true
},
"polyglotSupportEnabled": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "string",
"enum": [
"true",
"false"
]
}
],
"description": "Enable or disable support for non-.NET (polyglot) languages and runtimes in Aspire applications",
"default": false
},
"runningInstanceDetectionEnabled": {
"anyOf": [
{
Expand Down Expand Up @@ -294,4 +278,4 @@
}
},
"additionalProperties": false
}
}
50 changes: 48 additions & 2 deletions localhive.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,58 @@ if (-not $SkipCli) {
Write-Log "Installing Aspire CLI$(if ($NativeAot) { ' (native AOT)' }) to $cliBinDir"
New-Item -ItemType Directory -Path $cliBinDir -Force | Out-Null

# Copy all files from the publish directory (CLI and its dependencies)
Get-ChildItem -LiteralPath $cliPublishDir -File | Copy-Item -Destination $cliBinDir -Force
# Backup existing CLI executable if it's locked (same pattern as aspire update --self)
$targetExePath = Join-Path $cliBinDir $cliExeName
$backupPath = $null
if (Test-Path -LiteralPath $targetExePath) {
$timestamp = [DateTimeOffset]::UtcNow.ToUnixTimeSeconds()
$backupPath = "$targetExePath.old.$timestamp"
try {
Move-Item -LiteralPath $targetExePath -Destination $backupPath -Force -ErrorAction Stop
Write-Log "Backed up existing CLI to $backupPath"
}
catch {
Write-Warn "Could not backup existing CLI (may be in use). Attempting direct overwrite."
$backupPath = $null
}
}

try {
# Copy all files from the publish directory (CLI and its dependencies)
# Use -ErrorAction SilentlyContinue for individual files that may be locked by running processes
$copyErrors = @()
Get-ChildItem -LiteralPath $cliPublishDir -File | ForEach-Object {
try {
Copy-Item $_.FullName -Destination $cliBinDir -Force -ErrorAction Stop
}
catch {
$copyErrors += $_.Exception.Message
}
}
if ($copyErrors.Count -gt 0) {
Write-Warn "$($copyErrors.Count) file(s) could not be overwritten (likely locked by a running process). The CLI executable was updated successfully."
}

# Clean up old backup files
Get-ChildItem -LiteralPath $cliBinDir -Filter "$cliExeName.old.*" -ErrorAction SilentlyContinue |
ForEach-Object { Remove-Item $_.FullName -Force -ErrorAction SilentlyContinue }
}
catch {
# Restore backup if copy failed
if ($backupPath -and (Test-Path -LiteralPath $backupPath)) {
Write-Warn "Copy failed, restoring backup"
Move-Item -LiteralPath $backupPath -Destination $targetExePath -Force
}
throw
}

$installedCliPath = Join-Path $cliBinDir $cliExeName
Write-Log "Aspire CLI installed to: $installedCliPath"

# Set the channel to the local hive so templates and packages resolve from it
& $installedCliPath config set channel $Name -g 2>$null
Write-Log "Set global channel to '$Name'"

# Check if the bin directory is in PATH
$pathSeparator = [System.IO.Path]::PathSeparator
$currentPathArray = $env:PATH.Split($pathSeparator, [StringSplitOptions]::RemoveEmptyEntries)
Expand Down
6 changes: 6 additions & 0 deletions localhive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,12 @@ if [[ $SKIP_CLI -eq 0 ]]; then

log "Aspire CLI installed to: $CLI_BIN_DIR/aspire"

if "$CLI_BIN_DIR/aspire" config set channel "$HIVE_NAME" -g >/dev/null 2>&1; then
log "Set global channel to '$HIVE_NAME'"
else
warn "Failed to set global channel to '$HIVE_NAME'. Run: aspire config set channel '$HIVE_NAME' -g"
fi

# Check if the bin directory is in PATH
if [[ ":$PATH:" != *":$CLI_BIN_DIR:"* ]]; then
warn "The CLI bin directory is not in your PATH."
Expand Down
1 change: 1 addition & 0 deletions playground/TypeScriptAppHost/.modules/.codegen-hash
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
D08D58BB56EA0CE697A0296E9D236A4A529B691066038D651316EAF76B77CFC0
Loading
Loading