Clean stdio output and enable ReadyToRun publish

This commit is contained in:
Vibe Myass
2026-05-24 20:48:11 +00:00
parent a8f7e8f483
commit d3b39c590a
3 changed files with 9 additions and 4 deletions

View File

@@ -25,6 +25,12 @@ Publish one runtime:
The script writes binaries under `artifacts/publish/<rid>/`.
ReadyToRun is enabled by default to improve startup:
```bash
PUBLISH_READY_TO_RUN=false ./scripts/publish.sh linux-x64
```
Trimming is disabled by default because the MCP SDK discovers tools through reflection. To experiment with trimming after validating tool discovery in the published binary:
```bash

View File

@@ -5,6 +5,7 @@ ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
PROJECT="$ROOT_DIR/src/McpSsh.Server/McpSsh.Server.csproj"
CONFIGURATION="${CONFIGURATION:-Release}"
PUBLISH_TRIMMED="${PUBLISH_TRIMMED:-false}"
PUBLISH_READY_TO_RUN="${PUBLISH_READY_TO_RUN:-true}"
if [[ $# -gt 0 ]]; then
RIDS=("$@")
@@ -21,5 +22,6 @@ for rid in "${RIDS[@]}"; do
-o "$output" \
-p:PublishSingleFile=true \
-p:PublishTrimmed="$PUBLISH_TRIMMED" \
-p:PublishReadyToRun="$PUBLISH_READY_TO_RUN" \
-p:EnableCompressionInSingleFile=true
done

View File

@@ -9,10 +9,7 @@ using Microsoft.Extensions.Logging;
var builder = Host.CreateApplicationBuilder(args);
builder.Logging.AddConsole(options =>
{
options.LogToStandardErrorThreshold = LogLevel.Trace;
});
builder.Logging.ClearProviders();
builder.Services.AddSingleton<ISystemClock, SystemClock>();
builder.Services.AddSingleton<IFileSystem, LocalFileSystem>();