Skip to content

[foldable] Package reference instead of project reference #6514

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

Merged
merged 11 commits into from
Aug 11, 2022

Conversation

conceptdev
Copy link
Contributor

Reverts #5891 and converts Foldable to a package, following instructions in #5894

Description of Change

  1. Update Controls.Foldable.csproj to make NuGet
  2. Restore commented-out foldable code in the Maui.Controls.Sample project
  3. Update Maui.Controls.Sample.csproj to use a PackageReference
  4. Remove Foldable.csproj reference from Samples.slnf

Issues Fixed

#5894 where a GENERATEPROJECTPRIFILE : error : PRI175: 0x80073b0f - Processing Resources failed with error: Duplicate Entry' was being generated in the CI builds, assumed to be because the Foldable project was being referenced and bringing in all its dependencies as duplicates...

reverts dotnet#5891 and converts Foldable to a package
@PureWeen PureWeen requested a review from mattleibow April 26, 2022 21:01
Copy link
Member

@mattleibow mattleibow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

@mattleibow

This comment was marked as outdated.

@azure-pipelines

This comment was marked as outdated.

Copy link
Member

@rmarinho rmarinho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

         D:\a\_work\1\s\src\Controls\samples\Controls.Sample\Maui.Controls.Sample.csproj : error NU1604: Project dependency Microsoft.Maui.Controls.Foldable does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results. [D:\a\_work\1\s\Microsoft.Maui.Samples.slnf]
         D:\a\_work\1\s\src\Controls\samples\Controls.Sample\Maui.Controls.Sample.csproj : error NU1101: Unable to find package Microsoft.Maui.Controls.Foldable. No packages exist with this id in source(s): D:\a\_work\1\s\bin\dotnet\library-packs, darc-pub-dotnet-runtime-a21b9a2, dotnet-eng, dotnet-public, dotnet6, dotnet7, skiasharp [D:\a\_work\1\s\Microsoft.Maui.Samples.slnf]
         D:\a\_work\1\s\src\Controls\samples\Controls.Sample.SingleProject\Maui.Controls.Sample.SingleProject.csproj : error NU1604: Project dependency Microsoft.Maui.Controls.Foldable does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results. [D:\a\_work\1\s\Microsoft.Maui.Samples.slnf]
         D:\a\_work\1\s\src\Controls\samples\Controls.Sample.SingleProject\Maui.Controls.Sample.SingleProject.csproj : error NU1101: Unable to find package Microsoft.Maui.Controls.Foldable. No packages exist with this id in source(s): D:\a\_work\1\s\bin\dotnet\library-packs, darc-pub-dotnet-runtime-a21b9a2, dotnet-eng, dotnet-public, dotnet6, dotnet7, skiasharp [D:\a\_work\1\s\Microsoft.Maui.Samples.slnf]
@conceptdev
Copy link
Contributor Author

Latest commits build a NuGet package in the /artifacts/ folder (thanks to Microsoft.Maui.Packages.slnf), but I'm not sure the sample will be able to load it...

image

@PureWeen

This comment was marked as outdated.

@azure-pipelines

This comment was marked as outdated.

@conceptdev
Copy link
Contributor Author

conceptdev commented Apr 28, 2022

Current error D:\a\_work\1\s\src\Controls\samples\Controls.Sample\Maui.Controls.Sample.csproj : error NU1101: Unable to find package Microsoft.Maui.Controls.Foldable. No packages exist with this id in source(s): D:\a\_work\1\s\bin\dotnet\library-packs, darc-pub-dotnet-runtime-a21b9a2, dotnet-eng, dotnet-public, dotnet6, dotnet7, skiasharp [D:\a\_work\1\s\Microsoft.Maui.Samples.slnf]

There IS there is a Microsoft.Maui.Controls.Foldable.nupkg NuGet, but it's in
D:\a\_work\1\s\artifacts\nuget
and the Samples project is looking in
D:\a\_work\1\s\bin\dotnet\library-packs

Need to figure out how to add another NuGet source for the sample project OR get the Foldable NuGet into the library-packs directory...

UPDATE: confirmed that manually dropping the nupkg into bin\dotnet\library-packs enables the samples build to succeed.

@Eilon Eilon added legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor area-infrastructure CI, Maestro / Coherency, upstream dependencies/versions labels Apr 28, 2022
@PureWeen

This comment was marked as outdated.

@azure-pipelines

This comment was marked as outdated.

@azure-pipelines

This comment was marked as outdated.

2 similar comments
@azure-pipelines

This comment was marked as outdated.

@azure-pipelines

This comment was marked as outdated.

@conceptdev
Copy link
Contributor Author

conceptdev commented Apr 29, 2022

It feels like what's happening on the server must be different to what's happening locally. Will probably roll-back these YAML changes that are trying to copy the nupkg around and revisit assumptions about what files are where 😬

The build logs show the Download Packages step successfully grabs the Foldable NuGet:

Downloaded nuget/Microsoft.Maui.Controls.Foldable.6.0.300-rc.3.7406.nupkg to D:\a\_work\1\s\artifacts\nuget\Microsoft.Maui.Controls.Foldable.6.0.300-rc.3.7406.nupkg

But the Build .NET 6 samples step isn't finding it

error NU1101: Unable to find package Microsoft.Maui.Controls.Foldable. No packages exist with this id in source(s): D:\a\_work\1\s\bin\dotnet\library-packs, darc-pub-dotnet-runtime-a21b9a2, dotnet-eng, dotnet-public, dotnet6, dotnet7, skiasharp [D:\a\_work\1\s\Microsoft.Maui.Samples.slnf]

even though the added PowerShell command seems like it should be copying it across

Move-Item -Path artifacts\nuget\*.nupkg -Destination artifacts -Force
Copy-Item -Path artifacts\*.nupkg -Destination "bin\dotnet\library-packs" -Filter *Foldable* -Force
@mattleibow
Copy link
Member

Is it in the artifact? Can you confirm in the artifact on devops or in the copy logs?

Maybe add a dir artifacts/* to a step after the download

@conceptdev
Copy link
Contributor Author

The Foldable NuGet is definitely in the nuget artifact at the end!

image

@mattleibow
Copy link
Member

mattleibow commented Apr 29, 2022

I don't see the artifacts folder in here:

error NU1101: Unable to find package Microsoft.Maui.Controls.Foldable. No packages exist with this id in source(s): D:\a_work\1\s\bin\dotnet\library-packs, darc-pub-dotnet-runtime-a21b9a2, dotnet-eng, dotnet-public, dotnet6, dotnet7, skiasharp [D:\a_work\1\s\Microsoft.Maui.Samples.slnf]

I got a feeling we need an extra step in the samples to copy nuget-only packages into a folder and then add that to the samples nuget.config. This can probably be done by copying the repo's nuget.config to a temporary location and then adding the path to the new artifacts folder and then setting the RestoreConfigFile property to the path of the nuget.config: https://github.com/dotnet/maui/blob/main/eng/cake/dotnet.cake#L71

I am also thinking to prevent accidental issues, we should also make a new folder in the temp and copy the 2 foldable files in there and make the nuget.config point to that. By doing that we can make sure we get a build fail if suddenly a package is used instead of the workloads.

@conceptdev
Copy link
Contributor Author

@mattleibow yeah, that's why I was trying to copy the Foldable NuGet into bin\dotnet\library-packs, because it's already in the sources search list for the Samples project 😬

Still not sure why it wasn't working on the server, but either way it was a little hacky and your explanation/suggestion sounds more robust.

@Redth Redth added this to the 6.0.300 milestone May 5, 2022
@Redth Redth added this to the 6.0.300-servicing milestone May 5, 2022
@mattleibow mattleibow added the do-not-merge Don't merge this PR label Jul 19, 2022
@mattleibow
Copy link
Member

After such a long time, we eventually got a bunch of things to make all this work much better.

@mattleibow mattleibow self-assigned this Jul 19, 2022
<IsPackable>false</IsPackable>
<IsPackable>true</IsPackable>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING! This will produce a nupkg that will be published to nuget.org

@rmarinho
Copy link
Member

@conceptdev is this ready to be merged?

@conceptdev
Copy link
Contributor Author

I have not had a chance to test the NuGet. Will try to get it done today and approve if it works, thanks.

@mattleibow mattleibow modified the milestones: 6.0-servicing, .NET 7 Aug 3, 2022
@rmarinho
Copy link
Member

rmarinho commented Aug 5, 2022

@conceptdev did you had a chance to try it ? thanks

@conceptdev
Copy link
Contributor Author

@rmarinho I started testing this today, but needed to rebuild my VS2022 config, workloads, etc as nothing initially worked. Will finish off tomorrow and let you know how it goes.

@conceptdev
Copy link
Contributor Author

UPDATE: I was able to test the code in this branch and it still seems to work 💯 i.e. it detects the hinge when present and snaps the panes to it.

RE: Matt's warning above about generating a NuGet - I'm assuming it will be a "preview" NuGet? What release date would we be aiming for with this package? I recall when working with Shane that there might still be some edge cases we need to test/verify.

@mattleibow
Copy link
Member

Right now, it will have the same branding and version as maui itself.

So in this merge world, it probably will be released as RC 1.

@conceptdev
Copy link
Contributor Author

@mattleibow thanks for the clarification! In that case, I wonder if the PMs should chime in as this sounds like a bit of a messaging decision as well as a technical one?

FWIW here's some screenshot of the sample on dual and single screens

image

image

@mattleibow mattleibow merged commit a8ac748 into dotnet:main Aug 11, 2022
@mattleibow mattleibow modified the milestones: .NET 7, 7.0-rc1 Aug 11, 2022
@mattleibow mattleibow removed do-not-merge Don't merge this PR area-infrastructure CI, Maestro / Coherency, upstream dependencies/versions labels Aug 11, 2022
PureWeen pushed a commit that referenced this pull request Aug 11, 2022
Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
fixed-in-7.0.0-rc.1.6683 legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor
7 participants