Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 9, 2026

Plan: Enable Building on Linux

  • Detect Linux platform in build system
  • Skip macOS/Xcode-specific checks on Linux
    • Modify system-dependencies.sh to skip macOS-only checks
    • Update Make.config to handle missing Xcode variables
  • Allow builds directory to work on Linux
    • Update builds/Makefile for Linux compatibility (use CP variable)
    • Fix PWD usage in create-csproj-for-all-packagereferences.sh
    • Fix sed -i syntax for Linux in create-csproj-for-all-packagereferences.sh
    • Fix sed -i syntax in create-makefile-fragment.sh
    • Use bash arrays for proper sed flag handling on both platforms
    • Create cache directory before copying files
  • Allow src directory to build managed code on Linux
    • Platforms now properly included (INCLUDE_* variables not overridden)
    • Build proceeds through .NET download, src directory
    • Skip runtime directory to avoid native compilation on Linux
    • Skip dotnet directory on Linux (workload installation not supported)
    • Skip tests/test-libraries on Linux (requires native compilation)
    • Skip AppleDocReader (macOS-only native tool) on Linux
    • Skip Windows package builds on Linux
    • Skip xmllint XML validation on Linux
    • Skip native registrar builds in mtouch on Linux
    • Fix git blame caret handling in create-make-config.sh
    • Fix dotnet-linker dependencies for generated files
    • Fix ln command flags for Linux compatibility
    • Fix case-sensitivity issues for Linux
      • DotnetGlobals.cs → DotNetGlobals.cs
      • quicklookUI.cs → quicklookui.cs
      • ILLink.Substitutions.ios.xml → ILLink.Substitutions.iOS.xml
      • ILLink.Substitutions.tvos.xml → ILLink.Substitutions.tvOS.xml
  • Test the complete build flow on Linux
    • Verify .NET is downloaded ✅
    • Verify make iterates into builds and src (skips runtime) ✅
    • Build progresses without attempting native compilation ✅
    • Fix build errors on Linux
    • Verify no untracked files left after build on macOS
  • Add CI verification to prevent regression
    • Created GitHub Actions workflow for Linux build verification
    • Simplified workflow based on feedback
    • Use parallel make for improved build speed
  • Resolve merge conflicts
    • Accepted deletion of tools/mmp (removed in main branch)
    • Restored tools/common/ProjectInspector.csproj (should not have been deleted)
  • Clean up accidentally committed files
    • Removed tools/common/bgen.csproj.inputs (build artifact)
  • Code quality improvements
    • Refactored SUBDIRS to use conditional addition instead of filtering
    • Simplified dotnet-linker dependencies (Make.common handles generation)

Changes Made:

  1. system-dependencies.sh: Added Linux detection and skip all macOS-specific dependency checks
  2. Make.config: Added Linux detection, set placeholder Xcode values, XCODE_VERSION/XCODE_URL now unconditional
  3. builds/Makefile: Use $(CP) variable instead of hardcoded cp -c, create cache directory before use
  4. builds/create-csproj-for-all-packagereferences.sh: Fix PWD usage; use bash array for SED_INPLACE_FLAGS with proper array expansion
  5. Makefile: Use conditional addition pattern - only add runtime/dotnet on non-Linux platforms
  6. .github/workflows/linux-build.yml: Simplified workflow that runs on all PRs, uses set -ex, just verifies make succeeds, uses parallel make (-j) for speed
  7. src/Makefile.generator: Fixed case-sensitivity issue - DotnetGlobals.csDotNetGlobals.cs
  8. tools/common/create-makefile-fragment.sh: Use bash array for SED_INPLACE_FLAGS with proper array expansion
  9. src/quicklookUI.cs → src/quicklookui.cs: Fixed case-sensitivity - framework files must be all lowercase
  10. src/ILLink.Substitutions.ios.xml → src/ILLink.Substitutions.iOS.xml: Fixed case to match platform name
  11. src/ILLink.Substitutions.tvos.xml → src/ILLink.Substitutions.tvOS.xml: Fixed case to match platform name
  12. src/Makefile: Skip AppleDocReader documentation generation on Linux (macOS-only native tool); just copy XML files instead
  13. msbuild/Makefile: Skip Windows package builds on Linux (not needed); skip xmllint XML validation (tool not available on Linux)
  14. tools/mtouch/Makefile: Skip native registrar builds on Linux (require Xcode/iOS SDK)
  15. create-make-config.sh: Strip leading caret (^) from git blame output before using in git log command
  16. tools/dotnet-linker/Makefile: Include Make.common; removed explicit dependencies (Make.common handles generation automatically)
  17. dotnet/Makefile: Fix ln command flags - use -Fs instead of -Fhs (GNU ln doesn't support -h flag)
  18. tests/Makefile: Use conditional addition pattern - only add test-libraries on non-Linux platforms
  19. Removed: tools/mmp (entire directory removed in main branch - conflict resolved by accepting deletion)

Result: Successfully builds on Linux through .NET download and into builds/src/msbuild/tools/tests directories. Builds cleanly on macOS without leaving untracked files. Skips runtime, dotnet, and test-libraries directories that require native compilation or macOS platform. Uses cleaner conditional addition pattern for SUBDIRS. Fixed multiple case-sensitivity, sed syntax (using bash arrays), ln command flags, and git command issues. Simplified CI workflow with parallel make ensures fast builds and prevents regressions.

Original prompt

This section details on the original issue you should resolve

<issue_title>Make the repository build successfully on Linux</issue_title>
<issue_description>In order to make it easier for Copilot to help us in this repository, it would be good to be able to partially build this repository on Linux.

Building any native code (C/C++/Objective-C) would not be possible (because there's no Xcode on Linux), but downloading .NET itself + building managed code should be possible.

Goal: successfully run make from the root directory, and it will iterate into the builds directory (to download .NET), and then iterate into the src directory (to build managed code).</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 9, 2026 15:35
Co-authored-by: rolfbjarne <249268+rolfbjarne@users.noreply.github.com>
Co-authored-by: rolfbjarne <249268+rolfbjarne@users.noreply.github.com>
Copilot AI changed the title [WIP] Make the repository build successfully on Linux Enable partial Linux builds for Copilot support Jan 9, 2026
Copilot AI requested a review from rolfbjarne January 9, 2026 15:42
Copy link
Member

@rolfbjarne rolfbjarne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot the network problems have been fixed, please try again

…holder' instead of 'dummy', keep INCLUDE_* variables

Co-authored-by: rolfbjarne <249268+rolfbjarne@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 12, 2026

@copilot the network problems have been fixed, please try again

Tested successfully! The build now progresses much further:

  • ✅ .NET SDK downloaded
  • ✅ Package downloads work (network issues resolved)
  • ✅ Build iterates through builds → runtime → src
  • ✅ All platforms properly included (iOS, tvOS, MacCatalyst, macOS)
  • Build proceeds until native compilation is attempted in runtime directory (expected failure on Linux)

The repository now builds successfully on Linux up to the point where Xcode/native tools are required.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne
Copy link
Member

@copilot Skip the runtime directory in the top-level Makefile when building on Linux. In fact, skip any directory that requires native compilation by skipping it in the parent directory's Makefile.

Co-authored-by: rolfbjarne <249268+rolfbjarne@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 13, 2026

@copilot Skip the runtime directory in the top-level Makefile when building on Linux. In fact, skip any directory that requires native compilation by skipping it in the parent directory's Makefile.

Done in commit c5ff867. The runtime directory is now skipped on Linux via the top-level Makefile. The build now flows: builds → src, without attempting native compilation. Other directories (tools, msbuild) already have conditional logic based on platform variables, so they handle themselves appropriately.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne
Copy link
Member

@copilot Add a CI job/stage to verify that this doesn't regress.

Co-authored-by: rolfbjarne <249268+rolfbjarne@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 13, 2026

@copilot Add a CI job/stage to verify that this doesn't regress.

Added in commit e807828. Created a GitHub Actions workflow (.github/workflows/linux-build.yml) that:

  • Runs on every PR and push to main/release branches when relevant files change
  • Verifies the Linux build works (system dependencies, .NET download, managed code build)
  • Ensures the runtime directory is correctly skipped
  • Validates that .NET SDK is successfully downloaded to builds/downloads/dotnet

The workflow will fail if any of these Linux build capabilities regress.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

Co-authored-by: rolfbjarne <249268+rolfbjarne@users.noreply.github.com>
@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [PR Build #8b76d8e] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 8b76d8e6d8820e28ea862e6d06759a55c05c3bc3 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #8b76d8e] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 8b76d8e6d8820e28ea862e6d06759a55c05c3bc3 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 8b76d8e6d8820e28ea862e6d06759a55c05c3bc3 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #8b76d8e] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 8b76d8e6d8820e28ea862e6d06759a55c05c3bc3 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #8b76d8e] Tests on macOS X64 - Mac Sonoma (14) passed 💻

All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent
Hash: 8b76d8e6d8820e28ea862e6d06759a55c05c3bc3 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #8b76d8e] Tests on macOS M1 - Mac Monterey (12) passed 💻

All tests on macOS M1 - Mac Monterey (12) passed.

Pipeline on Agent
Hash: 8b76d8e6d8820e28ea862e6d06759a55c05c3bc3 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #8b76d8e] Tests on macOS arm64 - Mac Sequoia (15) passed 💻

All tests on macOS arm64 - Mac Sequoia (15) passed.

Pipeline on Agent
Hash: 8b76d8e6d8820e28ea862e6d06759a55c05c3bc3 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #8b76d8e] Tests on macOS M1 - Mac Ventura (13) passed 💻

All tests on macOS M1 - Mac Ventura (13) passed.

Pipeline on Agent
Hash: 8b76d8e6d8820e28ea862e6d06759a55c05c3bc3 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #8b76d8e] Tests on macOS arm64 - Mac Tahoe (26) passed 💻

All tests on macOS arm64 - Mac Tahoe (26) passed.

Pipeline on Agent
Hash: 8b76d8e6d8820e28ea862e6d06759a55c05c3bc3 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🚀 [CI Build #8b76d8e] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 117 tests passed 🎉

Tests counts

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 9 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 11 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 9 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 9 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: 8b76d8e6d8820e28ea862e6d06759a55c05c3bc3 [PR build]

@rolfbjarne rolfbjarne marked this pull request as ready for review January 30, 2026 12:09
@rolfbjarne rolfbjarne enabled auto-merge (squash) January 31, 2026 01:09
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.

Make the repository build successfully on Linux

3 participants