Builds Linux binaries (x64 and ARM64) for XerahS using the packaging script. Handles Linux packaging, log monitoring, and Avalonia XAML precompilation issues. Use build-common for shared build timeout, lock, and dependency guardrails.
Builds Linux binaries (x64 and ARM64) for XerahS using the packaging script. Handles Linux packaging, log monitoring, and Avalonia XAML precompilation issues. Use build-common for shared build timeout, lock, and dependency guardrails.
You are an expert Linux build automation specialist for .NET/Avalonia projects.
Follow these instructions exactly and in order to build Linux binaries for XerahS.
Build Linux packages (deb/rpm) for both x64 and ARM64 architectures.
Handle file locking issues that occur when a previous build is still running.
Avoid Avalonia XAML precompilation failures caused by namespace mismatches in converters.
Validate that the build artifacts exist and are recent.
build/linux/package-linux.sh
dist/
- XerahS-{version}-linux-x64.deb
- XerahS-{version}-linux-arm64.deb
- XerahS-{version}-linux-x64.rpm (if rpmbuild is available)
- XerahS-{version}-linux-arm64.rpm (if rpmbuild is available)
Shared Build Guardrails
Before Linux packaging work, follow build-common for shared timeout, lock recovery, no-concurrent-build, -m:1, TFM, and SkiaSharp rules. This Linux skill owns package-linux usage, log monitoring, Linux artifact validation, and Linux-specific XAML precompilation diagnostics.
Build Process
Phase 0: Update ShareX.ImageEditor Submodule
Always pull the latest ShareX.ImageEditor submodule before building to ensure the embedded image editor is up-to-date.
This is most useful if you see The process cannot access the file '...ShareX.ImageEditor.pdb' because it is being used by another process (Avalonia AVLN9999 error).
Phase 2: Run the Build Script
IMPORTANT: Always redirect output to a log file. The build takes 5-15 minutes and command_status produces no output during that time — the tool will appear to hang. Do NOT use WaitDurationSeconds > 30 with this command.
Do NOT use WaitDurationSeconds=120 in command_status — the command produces buffered output only after completion, so polling the log file is the only reliable way to track progress.
Phase 3: Handle Common Failures
🔴 Failure: No precompiled XAML found for XerahS.UI.App
Symptom (at runtime, not build time):
Avalonia.Markup.Xaml.XamlLoadException: No precompiled XAML found for XerahS.UI.App,
make sure to specify x:Class and include your XAML file as AvaloniaResource
Root Cause: A C# converter class referenced in an .axaml file uses the wrong namespace.
Avalonia's XAML compiler silently fails to compile the referencing AXAML, which cascades to break the entire app's precompiled XAML.
How to diagnose:
Check any recently added/modified converters under ShareX.ImageEditor/src/ShareX.ImageEditor/UI/Adapters/Converters/
Verify their C# namespace matches the AXAML xmlns:converters import:
-p:EnableWindowsTargeting=true: Required when cross-compiling on Linux due to shared project references
Plugins publish with --no-self-contained to share the runtime with the main app
Sequential Builds Are Mandatory
NEVER run two builds at the same time.ShareX.ImageEditor targets multiple TFMs and MSBuild parallelism causes them to race on the same ShareX.ImageEditor.dll output path.
Architectures: package-linux.sh iterates linux-x64 then linux-arm64 sequentially — never invoke it twice concurrently.
Internal parallelism: If CS2012 / file lock errors appear on ShareX.ImageEditor, pre-build it separately with /m:1 to force single-threaded compilation: