Skip to content

OpenHarmony: build with -flp:logfile plus a second writer on the same file hangs #1

Open

Description

@springmin

Summary

On OpenHarmony arm64, dotnet build "-flp:logfile=X" hangs when the invoking shell also appends to X (>> X). With the file logger as the only writer the same build finishes.

Repro (OpenHarmony only)

: > dual.log
dotnet build --no-restore -noconlog "-flp:logfile=$PWD/dual.log;verbosity=minimal" >> dual.log 2>&1   # hangs
: > single.log
dotnet build --no-restore -noconlog "-flp:logfile=$PWD/single.log;verbosity=minimal"                  # completes

Reproduced with the real 1.27MB MAUI project (ohos-workload/test/maui-platform-verify); a 10-line console project does not reproduce it.

Control (does not reproduce)

Impact

The clean-machine gate must give the file logger a dedicated file; any user redirecting a build into the same file the logger writes will hang with no output.

Workaround

Never share the log file: -flp:logfile=$LOG with stdout sent to /dev/null (single writer).

Activity

  1. springmin commented on Nov 19, 2026

    @springmin
    OwnerAuthor

    Related OpenHarmony port symptoms (same host, same validation)

    Collected while bringing up the self-hosted clean-machine gate on OpenHarmony arm64 (ohos-clean-machine.yml):

    1. csc SIGSEGV on a large project
      error MSB6006: "csc" exited with code 139 while compiling the 1.27MB Program.cs of ohos-workload/test/maui-platform-verify. Intermittent: the same command succeeded four times in a row (see baseline), then failed repeatedly in one run.
    2. dotnet can hang during process shutdown
      Builds finish their work (assembly present, summary written) but the process never exits; SIGTERM is not delivered, only SIGKILL works. The gate therefore judges success by artifacts and kills stalled process groups.
    3. dotnet muxer falls back to app-mode when global.json pins a different SDK
      With global.json pinning 12.0.100-alpha and an 11.0.100 SDK installed, every SDK command fails with The application X does not exist ... Please run ./build instead of a clear SDK-resolution error. Workaround in the gate: write a minimal global.json.

    Baseline where the gate is green

    • clean-machine (install + 826 + JIT + AOT): run 44479197802
      • [suite] checks=826 total=829 floor=809 assert=True
      • JIT OpenHarmony: signed, AOT EXIT=0 with IL2026/IL3050/IL3051 = 0
    • device-round: run 44483866572 (success)

    Why it matters

    All three are masked in the gate by workarounds (single-writer log file, artifact-based success, minimal global.json). They will bite anyone running dotnet build on this port without those workarounds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions