Skip to content

[tools] There's no need to set the DOTNET variable before creating makefile fragments for csproj anymore.#24890

Draft
rolfbjarne wants to merge 2 commits intomainfrom
dev/rolf/makefile-gen-no-dotnet
Draft

[tools] There's no need to set the DOTNET variable before creating makefile fragments for csproj anymore.#24890
rolfbjarne wants to merge 2 commits intomainfrom
dev/rolf/makefile-gen-no-dotnet

Conversation

@rolfbjarne
Copy link
Member

There's no need, because just running 'dotnet' runs our local .NET now.

…kefile fragments for csproj anymore.

There's no need, because just running 'dotnet' runs our local .NET now.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the make-based build tooling that generates *.csproj.inc dependency fragments, removing explicit DOTNET exports from several Makefiles and changing the fragment generator script to invoke dotnet build directly.

Changes:

  • Remove export DOTNET:=$(DOTNET) from multiple *.csproj.inc fragment targets.
  • Update tools/common/create-makefile-fragment.sh to use dotnet build instead of a DOTNET env var.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tools/sharpie/Makefile Stops exporting DOTNET when generating Sharpie.Bind.csproj.inc.
tools/mtouch/Makefile Stops exporting DOTNET when generating mtouch.csproj.inc.
tools/common/create-makefile-fragment.sh Switches fragment generation to run dotnet build directly.
tests/Makefile Stops exporting DOTNET when generating xharness.csproj.inc.
src/Makefile.generator Stops exporting DOTNET when generating bgen.csproj.inc.

You can also share your feedback on Copilot code review. Take the survey.

fi

BUILD_EXECUTABLE="$DOTNET build"
BUILD_EXECUTABLE="dotnet build"
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

create-makefile-fragment.sh now hard-codes dotnet build, which makes the script depend on whatever dotnet happens to resolve to in PATH. If the repo’s expected dotnet ($(DOTNET_DIR)/dotnet) hasn’t been installed yet, this can either fail (dotnet not found) or silently use a system dotnet with a different SDK/MSBuild version, which can change project evaluation and make the generated *.csproj.inc fragments non-deterministic. Consider using the repo’s configured dotnet explicitly (or honoring a DOTNET env var when provided) and, if it’s not available, either emit a clear error instructing to run make -C builds dotnet or keep the previous behavior of skipping fragment generation so non-dotnet make targets can still run.

Suggested change
BUILD_EXECUTABLE="dotnet build"
if test -n "$DOTNET"; then
BUILD_EXECUTABLE="$DOTNET build"
elif test -n "$DOTNET_DIR"; then
if test -x "$DOTNET_DIR/dotnet"; then
BUILD_EXECUTABLE="$DOTNET_DIR/dotnet build"
else
echo "The configured dotnet ('$DOTNET_DIR/dotnet') was not found. Please run 'make -C builds dotnet' to install it."
exit 1
fi
else
BUILD_EXECUTABLE="dotnet build"
fi

Copilot uses AI. Check for mistakes.
@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.

2 similar comments
@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
Copy link
Collaborator

✅ [CI Build #504a339] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 504a33978035965bcb3a9d9eab06b0226c8680c6 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [PR Build #504a339] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 504a33978035965bcb3a9d9eab06b0226c8680c6 [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: 504a33978035965bcb3a9d9eab06b0226c8680c6 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #504a339] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 504a33978035965bcb3a9d9eab06b0226c8680c6 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🚀 [CI Build #504a339] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 156 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 6 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 11 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 12 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (tvOS): All 11 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Ventura (13): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: 504a33978035965bcb3a9d9eab06b0226c8680c6 [PR build]

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.

3 participants