Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dotnet-local scripts to make using in tree dotnet easier. #16461

Merged
merged 3 commits into from Aug 4, 2023

Conversation

jonpryor
Copy link
Member

Using dotnet may require setting %PATH% to prefer bin\dotnet\dotnet over any other dotnet in %PATH%.

Usage:

# Unix
path/to/maui/dotnet-local.sh build App.sln

rem Windows
path\to\maui\dotnet-local.cmd build App.sln

If MAUI hasn't been built yet, an error message stating that build.sh or build.ps1 should be executed is printed.

Copy link
Member

@jonathanpeppers jonathanpeppers left a comment

Choose a reason for hiding this comment

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

Overall these scripts are going to be useful in .NET 8, they dropped support for $DOTNET_HOST_PATH and $DOTNET_ROOT.

So, if you tried to run ./bin/dotnet/dotnet build someproject.sproj, the <Csc/> task might pick up a different dotnet and the build will fail.

dotnet-local.cmd Outdated
SET PATH=%DOTNET_ROOT%;%PATH%
call "%ROOT%\bin\dotnet\dotnet.exe" %*
) ELSE (
echo "You need to run 'build.ps1' first."
Copy link
Member

Choose a reason for hiding this comment

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

/cc @PureWeen I'm not sure we use those build.ps1/sh scripts or are they are vestigial? I think we could just say, "you need to build MAUI first" and link to:

https://github.com/dotnet/maui/blob/main/.github/DEVELOPMENT.md

Copy link
Member Author

Choose a reason for hiding this comment

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

On the one hand, sure, but on the other hand… I find that .github/DEVELOPMENT.md page to be inscrutable. How should I build dotnet/maui if I don't use build.sh/build.ps1?

And if build.sh/build.ps1 shouldn't be used, shouldn't we just delete them?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I don't know why they exist if DEVELOPMENT.md doesn't mention them?

Copy link
Member

Choose a reason for hiding this comment

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

We were using build.sh and build.ps1 before dotnet had a cake tool and before anyone that didn't work here could even hope to build MAUI.

We could probably just delete them at this point

dotnet-local.sh Outdated Show resolved Hide resolved
@Eilon Eilon added the area/infrastructure 🏗️ CI, Maestro / Coherency label Aug 2, 2023
@jonpryor
Copy link
Member Author

jonpryor commented Aug 2, 2023

@jonathanpeppers wrote:

Overall these scripts are going to be useful in .NET 8, they dropped support for $DOTNET_HOST_PATH and $DOTNET_ROOT.

One issue with this comment is that I don't see anything "contributor-facing" within dotnet/maui which uses DOTNET_HOST_PATH or DOTNET_ROOT (unless eng/package.ps1 is supposed to be "contributor-facing"?).

What I do know is that if $PATH doesn't have the used dotnet first, "weird things" happen. Unfortunately, I don't recall what those "weird things" were, at least in terms of error messages or behavior, just that "the Csc task might use the system dotnet install, which doesn't work as expected with the local install", which isn't particularly actionable.

@jonpryor
Copy link
Member Author

jonpryor commented Aug 2, 2023

@PureWeen , @jonathanpeppers: error message has been updated.

Copy link
Member

@jonathanpeppers jonathanpeppers left a comment

Choose a reason for hiding this comment

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

The scripts themselves look good now. ./bin/dotnet/dotnet will not be useable without them on the net8.0 branch currently.

@PureWeen
Copy link
Member

PureWeen commented Aug 4, 2023

/rebase

Using `dotnet` may require setting `%PATH%` to prefer
`bin\dotnet\dotnet` over any other `dotnet` in `%PATH%`.

Usage:

	# Unix
	path/to/maui/dotnet-local.sh build App.sln

	rem Windows
	path\to\maui\dotnet-local.cmd build App.sln

If MAUI hasn't been built yet, an error message stating that
`build.sh` or `build.ps1` should be executed is printed.
@PureWeen PureWeen enabled auto-merge (squash) August 4, 2023 21:34
@PureWeen PureWeen merged commit c92d44c into main Aug 4, 2023
39 checks passed
@PureWeen PureWeen deleted the dev/jonp/dotnet-local-sh branch August 4, 2023 23:10
@github-actions github-actions bot locked and limited conversation to collaborators Dec 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/infrastructure 🏗️ CI, Maestro / Coherency
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants