[tools] There's no need to set the DOTNET variable before creating makefile fragments for csproj anymore.#24890
[tools] There's no need to set the DOTNET variable before creating makefile fragments for csproj anymore.#24890rolfbjarne wants to merge 2 commits intomainfrom
Conversation
…kefile fragments for csproj anymore. There's no need, because just running 'dotnet' runs our local .NET now.
There was a problem hiding this comment.
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.incfragment targets. - Update
tools/common/create-makefile-fragment.shto usedotnet buildinstead of aDOTNETenv 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" |
There was a problem hiding this comment.
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.
| 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 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ [CI Build #504a339] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #504a339] Build passed (Detect API changes) ✅Pipeline on Agent |
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
✅ [CI Build #504a339] Build passed (Build macOS tests) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🚀 [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 macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
There's no need, because just running 'dotnet' runs our local .NET now.