Giter Site home page Giter Site logo

Comments (9)

richlander avatar richlander commented on September 29, 2024 2

We should prepend DOTNET to our ENVs wherever we can. NUGET is sufficient for that, IMO.

We want to:

  • Avoid collisions with our ecosystems.
  • Make it easy for others to self-identify that a given ENV is for a given dev plat when someone inspects the result of set or export.
  • DOTNET ENVs all appear/sort together.

We should also decide if we want DOTNET_SDK_BLAH.

@baronfel

from home.

jeffkl avatar jeffkl commented on September 29, 2024 1

We'll discuss this in today's triage

from home.

jeffkl avatar jeffkl commented on September 29, 2024 1

Two things came from our discussion:

  1. We're fine with respecting GLOBAL_JSON or whatever, just get consensus from the .NET folks on the name (like should it be DOTNET_GLOBAL_JSON or whatever
  2. We'd like the implementation of respecting both GLOBAL_JSON and especially NUGET_CONFIG to log something to indicate that the environment variable is set and its side effect. So at the end of restore, NuGet has a summary:
  NuGet Config files used:
      C:\Users\jeffkl\AppData\Roaming\NuGet\NuGet.Config
      C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config

  Feeds used:
      https://api.nuget.org/v3/index.json
      C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\

If that summary said something like "Used D:\Something\NuGet.config because it was specified in the NUGET_CONFIG environment variable", that would be great. We're very afraid of adding this magic and it not being obvious to users of the side effect. We've personally experienced cases where an environment variable is set and can't for the life of us figure out why something isn't working. Informing the user at the end of restore will greatly help them from scratching their heads when restore is using an unexpected config.

from home.

jeffkl avatar jeffkl commented on September 29, 2024

Respecting GLOBAL_JSON is a no brainer. @nkolev92 what do you think about an environment variable NUGET_CONFIG that simply overrides the path to NuGet.Config, skipping the search for it in parent folders?

from home.

nkolev92 avatar nkolev92 commented on September 29, 2024

I feel like the concerns of the SDK resolver and NuGet in general are slightly different.
The SDK resolver respecting GLOBAL_JSON seems like an easy one I agree, since it doesn't really affect NuGet as a whole.

I've been a fan of having a single way to specify config file, but env vars are not ideal due to lack of transparency.
What are the commands that are missing a restore config file? Would having a resolver specific solution work or are there other scenarios to consider?

from home.

ViktorHofer avatar ViktorHofer commented on September 29, 2024

The nuget sdk resolver reads the global.json and NuGet.config file and doesn't have access to msbuild properties or CLI flags as it is loaded by the SDK.

What are the commands that are missing a restore config file? Would having a resolver specific solution work or are there other scenarios to consider?

Yes, this only affects the nuget sdk resolver. Other components respect the RestoreConfigFile msbuild property.

from home.

nkolev92 avatar nkolev92 commented on September 29, 2024

I think plumbing the fact that an env var is being used in the summary might be more challenging.

Personally, I'm fine if it's in the standard log

from home.

richlander avatar richlander commented on September 29, 2024

FYI ...

rich@mazama:~$ cat global.json 
{
  "sdk": {
    "version": "8.0.100"
  }
}
rich@mazama:~$ export DOTNET_ROOT=/home/rich/dotnet
rich@mazama:~$ dotnet --info
.NET SDK:
 Version:           8.0.102
 Commit:            b7800db369
 Workload version:  8.0.100-manifests.03fa9662

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  23.10
 OS Platform: Linux
 RID:         ubuntu.23.10-x64
 Base Path:   /usr/lib/dotnet/sdk/8.0.102/

.NET workloads installed:
 Workload version: 8.0.100-manifests.03fa9662
There are no installed workloads to display.

Host:
  Version:      8.0.2
  Architecture: x64
  Commit:       1381d5ebd2

.NET SDKs installed:
  8.0.102 [/usr/lib/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.2 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.2 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  DOTNET_ROOT       [/home/rich/dotnet]

global.json file:
  /home/rich/global.json

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

from home.

ViktorHofer avatar ViktorHofer commented on September 29, 2024

Ok, NUGET_CONFIG and DOTNET_GLOBAL_JSON it is then. I will explore what needs to change to indicate that these env var overrides are used.

from home.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.