Skip to content
This repository was archived by the owner on May 13, 2026. It is now read-only.

chore(run.sh): keep cargo build output out of server.log / schema_service.log - #938

Merged
shiba4life merged 1 commit into
mainfrom
chore/quiet-cargo-build-from-server-log
May 9, 2026
Merged

chore(run.sh): keep cargo build output out of server.log / schema_service.log#938
shiba4life merged 1 commit into
mainfrom
chore/quiet-cargo-build-from-server-log

Conversation

@shiba4life

Copy link
Copy Markdown
Collaborator

Summary

cargo run re-emits compiler progress + warnings on stderr, so the existing nohup cargo run ... > server.log 2>&1 & pattern in run.sh dumped "Compiling/Finished/Running" lines (and any rustc warnings — e.g. the macOS-only dead_code warning on build_attendee_ingestion_records) into the log file the in-app LogSidebar reads. The first ~12 lines of every fresh run.sh server.log were build chatter, not server output, and the UI rendered them as if they were runtime tracing.

Fix: build first (output → stderr, visible in the user's terminal), then exec the freshly built binary directly with stdout/stderr captured to the log file. Same shape applied to the local schema service path so schema_service.log is also clean.

Before

$ head -15 \"\$FOLDDB_HOME/server.log\"
warning: function \`build_attendee_ingestion_records\` is never used
   --> src/server/routes/apple_import.rs:801:4
    |
801 | fn build_attendee_ingestion_records(
    |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: \`#[warn(dead_code)]\` (part of \`#[warn(unused)]\`) on by default

warning: \`fold_db_node\` (lib) generated 1 warning
    Finished \`dev\` profile [unoptimized + debuginfo] target(s) in 0.36s
     Running \`target/debug/folddb_server --port 9102 --schema-service-url 'http://127.0.0.1:9103'\`
FoldDB Server (config file detected)
...

After

$ head -5 \$FOLDDB_HOME/server.log
FoldDB Server (config file detected)
  Data:   /tmp/test-runlog-cleanlogs/data
  Schema: http://127.0.0.1:9103
  UI:     http://localhost:9102
  Logs:   /tmp/test-runlog-cleanlogs/observability.jsonl

$ head -5 \$FOLDDB_HOME/schema_service.log
🚀 Schema service starting with local sled storage
   Database path: /tmp/test-runlog-cleanlogs/schema_registry
✅ Schema service listening on 127.0.0.1:9103

The compiler dead_code warning is left alone — it's tracked separately as a known macOS-local clippy noise. The point of this PR is keeping log files clean regardless of any warnings rustc emits.

Test plan

  • bash -n run.sh passes
  • Cold (clean target) ./run.sh --local --local-schema --empty-db --home /tmp/test-runlog-cleanlogs — both services come up healthy, head -5 on both logs shows server tracing only, no compiler output
  • Warm (cached target) restart — same clean output, both services healthy on auto-slotted ports (9102/9103)
  • curl http://127.0.0.1:9102/api/system/status and curl http://127.0.0.1:9103/v1/health return 200

🤖 Generated with Claude Code

…vice.log

`cargo run` re-emits compiler progress + warnings on stderr, so the
existing `nohup cargo run ... > server.log 2>&1 &` pattern dumped
"Compiling/Finished/Running" lines and any rustc warnings into the
log file the in-app LogSidebar reads. The first ~12 lines of every
fresh run.sh server.log were build chatter, not server output.

Build first (output -> stderr, visible in the user's terminal), then
exec the freshly built binary directly with stdout/stderr captured
to the log file. Same fix applied to the local schema service path
so schema_service.log is also clean.

After:
  $ head -5 server.log
  FoldDB Server (config file detected)
    Data:   /tmp/test-runlog-cleanlogs/data
    Schema: http://127.0.0.1:9103
    UI:     http://localhost:9102
    Logs:   /tmp/test-runlog-cleanlogs/observability.jsonl

  $ head -5 schema_service.log
  🚀 Schema service starting with local sled storage
     Database path: /tmp/test-runlog-cleanlogs/schema_registry
  ✅ Schema service listening on 127.0.0.1:9103

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@shiba4life
shiba4life enabled auto-merge May 9, 2026 01:14
@shiba4life
shiba4life added this pull request to the merge queue May 9, 2026
Merged via the queue into main with commit 752a2e5 May 9, 2026
12 checks passed
@shiba4life
shiba4life deleted the chore/quiet-cargo-build-from-server-log branch May 9, 2026 01:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant