Skip to content

DO NOT MERGE: Add strace filesystem tracing workflow#2

Closed
OvesN wants to merge 2 commits into
mainfrom
feat/strace-filesystem-tracing
Closed

DO NOT MERGE: Add strace filesystem tracing workflow#2
OvesN wants to merge 2 commits into
mainfrom
feat/strace-filesystem-tracing

Conversation

@OvesN
Copy link
Copy Markdown
Owner

@OvesN OvesN commented Jun 1, 2026

DO NOT MERGE - opened only to trigger the Strace Filesystem Tracing workflow on the head commit so the artifact can be downloaded and verified.

Adds a workflow_dispatch + pull_request GitHub Actions workflow that runs the MSBuild build under strace on Linux and uploads a filtered filesystem trace as an artifact (msbuild-strace-trace: gzipped log + summary). Used to attribute file operations (delete/rewrite/truncate) to specific PIDs.

Defaults: trace artifacts/bin/Microsoft.Build.Framework/Debug/net10.0, Debug config, scoped to src/Framework/Microsoft.Build.Framework.csproj to keep runtime down. All overridable via workflow_dispatch inputs after merging.

OvesN and others added 2 commits June 1, 2026 15:13
Adds a Linux-only, workflow_dispatch GitHub Actions workflow that runs
the MSBuild build under strace and uploads a filtered trace artifact so
operators can answer "which process deleted/rewrote my file?".

Design notes:
- strace -P is exact-path, not recursive, and misses relative-path
  syscalls after chdir, so we capture the full trace and post-filter
  with grep -F against both absolute and repo-relative path forms.
- -e trace=%file only covers path-arg syscalls; we additionally trace
  write/writev/pwrite64/close/ftruncate/copy_file_range and use -yy so
  fd-arg syscalls carry their backing path for grep to attribute.
- Restore runs untraced (network/disk I/O outside the trace folder) to
  cut runtime roughly in half without losing signal.
- Includes a strace smoke test that verifies the capture-then-grep
  approach records subtree events before the real build runs.
- PID extraction uses sed -nE (mawk on Ubuntu does not support gawk's
  3-arg match(..., arr) form).
- Top-N reductions use awk 'NR<=N' rather than '| head -N' to avoid
  SIGPIPE on upstream sort under the default -e -o pipefail shell.
- Build is scoped via --projects by default (Framework only) and
  --nodeReuse false for deterministic process boundaries; users can
  override both inputs at dispatch time.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds a pull_request trigger so the workflow runs (and produces its
artifact) on PRs without first merging to main. On pull_request events
`inputs.*` is null, so env vars now use `|| 'default'` to fall back to
the same defaults shown in the workflow_dispatch UI.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@OvesN
Copy link
Copy Markdown
Owner Author

OvesN commented Jun 1, 2026

Reopening against upstream dotnet/msbuild instead.

@OvesN OvesN closed this Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant