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

Fix NuGet fallback folder packages #65507

Merged
merged 1 commit into from
Sep 15, 2022

Conversation

raulsntos
Copy link
Member

@raulsntos raulsntos commented Sep 8, 2022


⚠️ I'm still unable to resolve the Godot.SourceGenerators package using the fallback folder and it seems to be related to using a floating version because using the exact package version works:

<PackageReference Include="Godot.SourceGenerators" Version="$(PackageFloatingVersion_Godot)" />

Here's the full error I get:

Build FAILED.

       "/media/raulsntos/Data/GodotProjects/TestProject/TestProject.sln" (Restore target) (1) ->
       (Restore target) -> 
         /media/raulsntos/Data/GodotProjects/TestProject/TestProject.csproj : error NU1100: Unable to resolve 'Godot.SourceGenerators (>= 4.0.0-0)' for 'net6.0'. [/media/raulsntos/Data/GodotProjects/TestProject/TestProject.sln]

    0 Warning(s)
    1 Error(s)

@raulsntos raulsntos added this to the 4.0 milestone Sep 8, 2022
@raulsntos raulsntos requested a review from a team September 8, 2022 01:32
@neikeq neikeq self-assigned this Sep 8, 2022
@neikeq
Copy link
Contributor

neikeq commented Sep 9, 2022

⚠️ I'm still unable to resolve the Godot.SourceGenerators package using the fallback folder and it seems to be related to using a floating version because using the exact package version works:

But AFAIK this worked for you with the local NuGet source that's needed during development, right? I think we should probably create a local source instead of a fallback folder.

@raulsntos
Copy link
Member Author

But AFAIK this worked for you with the local NuGet source that's needed during development, right?

Yeah, it works with a local source but not when it's a fallback folder. No idea why. This issue is the reason I'm keeping this as a draft.

I think we should probably create a local source instead of a fallback folder.

I don't really know what that implies, other than the difference in precedence. As described in the nuget.config documentation a source would be used after the fallback folder and in the order they are specified (but file sources before http sources). Since our local source would be a file source it would still be used before the nuget.org source which is an http source so I guess nothing would change.

@neikeq
Copy link
Contributor

neikeq commented Sep 9, 2022

I meant that if it doesn't work with a fallback folder, but it does with a local source, then this class should be creating a local source instead and adding that to the config file.

@raulsntos
Copy link
Member Author

The Godot.SourceGenerators is referenced using a floating version to avoid having to update Godot.NET.Sdk for every update of the source generators (see #55597 (comment)), but since we'll be removing the fallback folder in the future we could undo it and use the specific version number as a temporary solution for the few alphas/betas until we publish the packages to nuget.org.

- Creates a `Godot.Offline.Config` file to configurate NuGet with
Godot's fallback folder. This is easier because now we can assume we can
override the entire file since user config will likely be in the default
`NuGet.Config` file or an additional `*.config` file.
- Ensure the NuGet fallback folder is created at the same time it is
added to the NuGet configuration so future builds don't fail.
- Add `GodotSharp` and `GodotSharpEditor` packages to the fallback folder.
- Add `.nupkg.metadata` file to packages in fallback folder.
- Refer to `Godot.SourceGenerators` using the specific non-floating version
since floating versions don't seem to work with fallbackPackageFolders.
@raulsntos raulsntos force-pushed the dotnet/nuget-fallback branch from f058633 to 02bd072 Compare September 15, 2022 07:30
@raulsntos raulsntos marked this pull request as ready for review September 15, 2022 07:30
@akien-mga akien-mga merged commit 4ba934b into godotengine:master Sep 15, 2022
@akien-mga
Copy link
Member

Thanks!

@raulsntos raulsntos deleted the dotnet/nuget-fallback branch September 15, 2022 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Launching godot 4.0 (master) with mono breaks later godot+mono build attempts
3 participants