question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use implicit RID for `Publish` Properties

See original GitHub issue

Use implicit RID for Publish Properties

Based on https://github.com/dotnet/sdk/issues/23539, we have the opportunities to make additional improvements fit-and-finish improvements. The referenced change enables an implicit RID to be used when a RID is needed, specifically via the CLI like with --self-contained. There several properties where that is equally valuable.

We should extend the same change to:

  • SelfContained
  • PublishAot
  • PublishReadyToRun
  • PublishSingleFile
  • PublishTrimmed

These proposed changes make it obvious that we’re missing PublishSelfContained as an option. It’s odd that this has never come up. It would enable producing self contained apps, but only for the publish verb, just like the other Publish* properties.

We should add:

  • PublishSelfContained

In retrospect, I’ve struggled with the lack of PublishSelfContained, but it never occurred to me that we could have such a straightforward and symmetric solution to solve that.

–use-current-runtime

The new implicit RID feature replaces --use-current-runtime. The following two lines are now equivalent.

dotnet build --self-contained
dotnet build --self-contained --use-current-runtime

We should deprecate (and undocument) --use-current-runtime going foward. It no longer has a purpose.

@baronfel @agocke @nagilson @marcpopMSFT

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

4reactions
richlandercommented, Jun 20, 2022

I was thinking about --use-current-runtime in relationship to the Visual Studio guidance at https://github.com/dotnet/sdk/issues/26031. Sadly, I think we may need to keep --use-current-runtime.

That guidance suggests setting RuntimeSpecific and SelfContained properties to false. That’s fine.

After talking to @bradygaster, I learned that there were some scenarios that would benefit to RuntimeSpecific = true and SelfContained = false. I believe that. However, there is only one way that I know how to do that, like the following:

dotnet publish -c Release --use-current-runtime --self-contained false

That forced set of settings would be necessary to coerce a project into “Brady mode” if it was configured like this:

<PropertyGroup>
   <SelfContained>true</SelfContained>
   <RuntimeIdentifier>linux-x64</RuntimeIdentifier>
</PropertyGroup>

The key point here is whether RuntimeSpecific should overwrite a RID if one is specified.

Here are some choices:

  1. RuntimeSpecific only specifies a RID when RuntimeIdentifier isn’t specified.
  2. RuntimeSpecific always overwrites RuntimeIdentifier.
  3. Specifying RuntimeSpecific and RuntimeIdentifier together is an error.

If we go with the first one, then it seems like we need to keep --use-current-runtime. If we go with the second one, we don’t. The last one seems like it would cause problems w/o a lot of value.

If we go with the first one, the property would basically be RuntimeSpecificCurrentRidHighlander. Bad movie reference (“there can only be one”).

Anyone have a preference for which of these we should go with?

3reactions
baronfelcommented, Jun 20, 2022

We should do this! The RuntimeInference part especially should be pushed down into the RuntimeInference targets and removed from the CLI’s handling - right now the CLI can sometimes implicitly assign the RID via the RuntimeIdentifier property based on user gestures (see #25062 for an example of this) and this mismatch between the CLI and the targets leads to unclear ordering.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Automatic RuntimeIdentifier for publish only - .NET
The RID change was a breaking change, and there was no need for a publish property change to break dotnet build and other...
Read more >
PLIP proposal: Disallow implicit Acquisiton of properties
One of the things about getting rid of acquisition is finding the small use cases where it was handy and then finding new...
Read more >
Task generateMetadataFileForReleasePublication uses ...
This is the error that I see: Reason: Task ':my_sdk:generateMetadataFileForReleasePublication' uses this output of task ':my_sdk: ...
Read more >
Configure an Implicit Grant | Alexa Skills Kit
The Alexa Skills Kit supports implicit grants for account linking ... Note: Sign in to the developer console to build or publish your...
Read more >
OAuth2 Implicit Grant and SPA
The original OAuth2 specification introduces the implicit grant in SPAs as the way JavaScript code can obtain access tokens and call APIs ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found