Clean stdio output and enable ReadyToRun publish
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>();
|
||||
|
||||
Reference in New Issue
Block a user