stride3d / stride3d/stride

Allow overriding nuget config used by Stride

Open
#1,533 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C#
Stars
7.8k
Forks
1.2k
Avg merge
2d 17h
Merged PRs (30d)
49

Description

Is your feature request related to a problem? Please describe.
Some users may have a custom NuGet.Config file in the global directory (%APPDATA%\Nuget) that prevents them from downloading Stride.

Describe the solution you'd like
Allow overriding the store settings location.

Describe alternatives you've considered
Temporarily changing the config file while working with Stride.

Additional context
There's 2 places where the NugetStore class is initialized:

https://github.com/stride3d/stride/blob/7e836297cb5930c01e6dfa0183e7f3cc64748fb6/sources/launcher/Stride.Launcher/Launcher.cs#L69

https://github.com/stride3d/stride/blob/7e836297cb5930c01e6dfa0183e7f3cc64748fb6/sources/assets/Stride.Core.Assets/PackageStore.cs#L39

First one determines sources of packages in the Launcher, second one is used for loading projects by the editor and running the asset pipeline.

I'm suggesting using an environment variable StrideNugetPath in the NugetStore class to initialize the settings
https://github.com/stride3d/stride/blob/7e836297cb5930c01e6dfa0183e7f3cc64748fb6/sources/assets/Stride.Core.Packages/NugetStore.cs#L63

const string StrideNugetPathOverrideVariableName = "StrideNugetPath";
// null is returned if variable is not set, preserving existing behavior
var nugetConfigPathOverride = Environment.GetEnvironmentVariable(StrideNugetPathOverrideVariableName);
settings = NuGet.Configuration.Settings.LoadDefaultSettings(nugetConfigPathOverride);

Note that the path is used for recursive search of config files, so if we set it to C:\Users\me it will check for:
C:\Users\me\NuGet.config, C:\Users\NuGet.config, C:\NuGet.config

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in sources/assets/Stride.Core.Packages/NugetStore.cs at the settings initialization, then inspect the NugetStore call sites in sources/launcher/Stride.Launcher/Launcher.cs and sources/assets/Stride.Core.Assets/PackageStore.cs. Verify the configured override controls recursive NuGet.Config lookup in both launcher and editor/asset-pipeline usage, while an unset variable preserves existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.