-
Notifications
You must be signed in to change notification settings - Fork 540
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
GenerateBindings
and AddBindingsToCompile
are not run for a project build happening under _ResolveAssemblies
causing incremental builds to break
#9007
Comments
@Youssef1313 this all happens within Visual Studio I assume? Do you get the same issue from the command line? |
My testing was from command-line actually. But I assume it's an issue in VS as well. |
Now that I think this over I'm not even sure we have a unit test to cover that as integrating single projects like maui into our repo testing framework has proved very problematic since maui is always being updated and changing. @jonathanpeppers do you have any thoughts on this one? |
I'm not very much following on "why". To me, not running it will simply cause |
Generally, the Android inner build only runs See this for some details: I've not had a chance to look into this one to see what might be going wrong here. I've been focusing on MAUI, unfortunately. |
Well, as part of the build happening under |
Ok, so maybe we need There is a Looking at: I guess we could try |
To me it's quite scary to rely on private properties of MSBuild, but it could work (and, well, I sometimes rely on MSBuild internals myself 😄). |
@Youssef1313 can you test if that works around your problem for now? <_GlobalPropertiesToRemoveFromProjectReferences>$(_GlobalPropertiesToRemoveFromProjectReferences);_ComputeFilesToPublishForRuntimeIdentifiers</_GlobalPropertiesToRemoveFromProjectReferences This is used in a few places: |
Sure. I'll test it and let you know. |
@jonathanpeppers Thanks. I tested it and it works. However, is it something that can be done on your side instead of consumers having to deal with it? |
Do you have an idea of what project/solution structure would cause this to break? I think next step would be for us to write a test to reproduce the problem. |
@jonathanpeppers Unfortunately, I have no minimal repro. But maybe the binlog in the issue could help crafting a repro? |
Android framework version
net8.0-android
Affected platform version
34.0.95
Description
pr2.zip
In this binlog, there are two builds of
Uno.UI.BindingHelper.Android.netcoremobile.csproj
with IDs 351 and 88.The build for 351 is fine and correct (it's resulting from
ResolveProjectReferences
onSamplesApp.netcoremobile.csproj
)The build for 88 is very problematic, it's resulting from
_ResolveAssemblies
which setshttps://github.com/xamarin/xamarin-android/blob/b521487d0226db265baaa83f0f53e2e75497c420/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets#L91
Now that this build is happening with
_ComputeFilesToPublishForRuntimeIdentifiers
being true, the Microsoft.Android.Sdk.BuildOrder.targets isn't imported. Then,CompileDependsOn
is missing theGenerateBindings
andAddBindingsToCompile
targets. This causes_GenerateCompileDependencyCache
to not include some files, breaking things VERY badly.In the above binlog,
_GenerateCompileDependencyCache
of build 351 is run first, then that of build 88 which overwrittenUno.UI.BindingHelper.Android.netcoremobile.csproj.CoreCompileInputs.cache
causingUno.UI.BindingHelper.Android.netcoremobile
to be rebuilt unnecessarily, which then causes almost everything to be rebuilt.Steps to Reproduce
Binlog shows it all I think. If more info is needed, let me know.
Did you find any workaround?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: