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

Proposal: cleaning up publish UX #15726

Closed
agocke opened this issue Feb 8, 2021 · 6 comments
Closed

Proposal: cleaning up publish UX #15726

agocke opened this issue Feb 8, 2021 · 6 comments
Assignees
Labels
Area-NetSDK untriaged Request triage from a team member
Milestone

Comments

@agocke
Copy link
Member

agocke commented Feb 8, 2021

In using and helping others use dotnet publish I've found a few behaviors confusing and thought of a few minor changes that could help improve the experience. I'll list some thoughts below: I think many of them are independently useful and we can pick and choose what is most effective.

First, I think there's a fair bit of confusion about what the purpose of build is (or should be) and the purpose of publish. An informal survey suggests that most users think of build as a development command -- something which produces a runnable local asset, but not something that would be deployed to another environment. Publish is the command which produces deployable (copyable) assets.

If we lean into this distinction, I think there are a number of UX simplifications that we can make:

build should not use the "runtime identifier" option

If building is meant to create local assets, there is only one runtime identifier which matters: the runtime identifier of the currently executing dotnet command. The focus of build should be to produce a local asset as quickly and easily as possible. It should be able to assume that the current dotnet runtime identifier is sufficient for running the asset, and even share as many runtime components as possible with the dotnet installation.

build should not have a "self-contained" option

Like runtime identifer, this is meaningless because we already know we have a dotnet installation -- the one being used to build the application. Self-contained is important only in copying to other environments, where a dotnet installation may not be present.

one publish directory

Right now when you build/publish a standard app you end up with a layout something like:

  1. bin/Debug/net5.0/* for build files when no RID is set
  2. bin/Debug/net5.0/RID/* for build files when a RID is set
  3. bin/Debug/net5.0/RID/publish/* for publish files (also creates the above during implicit build)

If we accept the above, (1) and (2) look pretty strange. If build is not affected by RID, only (1) should exist. In addition, (3) seems to have a redundant publish subdirectory.

If we get rid of the current behavior, we can have a universal build directory, (1), and (2) can become the new publish directory. We should never need the redundant subdirectory (3).

Overall this would result in a simpler experience for users:

  • builds are always local and always go in the same subdirectory
  • publishes are for deployment to a different environment. The target RID is the publish directory, and we can use a moniker like portable for RID-independent publishes
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Request triage from a team member label Feb 8, 2021
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@agocke
Copy link
Member Author

agocke commented Feb 8, 2021

@richlander @samsp-msft @KathleenDollard I'd appreciate any feedback you have on this!

@benaadams
Copy link
Member

Can the "publish" type option default to Release mode also; rather than Debug as currently? #10357

@richlander
Copy link
Member

I like the general idea of this proposal. I don't think "no RID for build" works, at least not for mobile and wasm.

@agocke
Copy link
Member Author

agocke commented Mar 24, 2021

In the case of mobile/wasm, isn't the TF itself a RID?

@baronfel baronfel assigned baronfel and unassigned KathleenDollard Mar 16, 2022
@baronfel baronfel added this to the Discussion milestone Aug 1, 2023
@baronfel
Copy link
Member

baronfel commented Aug 1, 2023

Since this was logged we've done a few aspects of this discussion:

  • publish defaults to Release
  • Artifacts output path flattens output directory structures and separates publish outputs from build outputs entirely
  • SelfContained can impact publish only through PublishSelfContained

and we're collectively investigating build making RID-specific (but not self-contained) assets in one of the other explorations. Since the majority of these are covered in other sub-discussions, I'm going to close this old request.

@baronfel baronfel closed this as completed Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-NetSDK untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

6 participants