-
Couldn't load subscription status.
- Fork 6
Fix disc full enumeration by checking that $(MonoAndroidAssetsPrefix) is not empty string #46
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have a .binlog of when this problem occurred? My memory is the latest workload wasn't installed, maybe we can error on that as well?
Attached. This time it took long time to crash mac. Compressed binlog:
Anything would help. Otherwise digging what is going on is quite time consuming. |
|
MBP 17" Note: I did not kill it. (It was spinning from 20:48 until 10:45)
|
| <AndroidResource Include="$(MonoAndroidResourcePrefix)\font\*.ttf" /> | ||
| <AndroidResource Include="$(MonoAndroidResourcePrefix)\font\*.otf" /> | ||
| <AndroidResource Include="$(MonoAndroidResourcePrefix)\font\*.ttc" /> | ||
| <AndroidResource Include="$(MonoAndroidResourcePrefix)\raw\*" Exclude="$(MonoAndroidResourcePrefix)\raw\.*" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make the same checks for $(MonoAndroidResourcePrefix)?
If there are several lines, we can put them in an <ItemGroup> block with a single Condition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make the same checks for
$(MonoAndroidResourcePrefix)?
Sure we can. I could not find other prop in the chat.
If there are several lines, we can put them in an
<ItemGroup>block with a singleCondition.
Changed. Both MonoAndroidResourcePrefix and MonoAndroidAssetPrefix checks are now in separate ItemGroup
Co-authored-by: Jonathan Peppers <jonathan.peppers@gmail.com>
…ecks in ItemGroup
| <ItemGroup Condition=" ('$(TargetPlatformIdentifier)' == 'android' or $(TargetFramework.StartsWith ('MonoAndroid', StringComparison.OrdinalIgnoreCase))) and '$(EnableDefaultXamarinLegacySdkItems)' == 'true' | ||
| and ('$(MonoAndroidAssetsPrefix)' != '' and '$(MonoAndroidResourcePrefix)' != '') "> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make an <ItemGroup> block for $(MonoAndroidAssetsPrefix) and one for $(MonoAndroidResourcePrefix)?
There is probably a case where one could be blank and not the other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually what if we just set $(MonoAndroidAssetsPrefix)?
We would need to add a block here:
https://github.com/xamarin/Xamarin.Legacy.Sdk/blob/main/src/Xamarin.Legacy.Sdk/Sdk/Sdk.targets
Something like:
<PropertyGroup Condition=" '$(TargetPlatformIdentifier)' == 'android' or $(TargetFramework.StartsWith ('MonoAndroid', StringComparison.OrdinalIgnoreCase)) ">
<MonoAndroidAssetsPrefix Condition=" '$(MonoAndroidAssetsPrefix)' == '' ">Assets</MonoAndroidAssetsPrefix>
<MonoAndroidResourcePrefix Condition=" '$(MonoAndroidResourcePrefix)' == '' ">Resources</MonoAndroidResourcePrefix>
</PropertyGroup>Context: dotnet/android#7837 Context: #46 I ended up making this change in xamarin-android to avoid a potential issue in all .NET projects, so bringing it here as well. In cases where the `android` workload is not installed, Xamarin.Legacy.Sdk can accidentally wildcard your entire disk: MSBUILD : warning MSB5029: The value “\**\.*\**” of the “Exclude” attribute in element <ItemGroup> in file “/Users/moljac/.nuget/packages/xamarin.legacy.sdk/0.2.0-alpha2/Sdk/AutoImport.Android.props (26,61)” is a wildcard that results in enumerating all files on the drive, which was likely not intended. Check that referenced properties are always defined. Add checks that `$(MonoAndroidAssetsPrefix)` and `$(MonoAndroidResourcePrefix)` are not blank.
Context: dotnet/android#7837 Context: #46 I ended up making this change in xamarin-android to avoid a potential issue in all .NET projects, so bringing it here as well. In cases where the `android` workload is not installed, Xamarin.Legacy.Sdk can accidentally wildcard your entire disk: MSBUILD : warning MSB5029: The value “\**\.*\**” of the “Exclude” attribute in element <ItemGroup> in file “/Users/moljac/.nuget/packages/xamarin.legacy.sdk/0.2.0-alpha2/Sdk/AutoImport.Android.props (26,61)” is a wildcard that results in enumerating all files on the drive, which was likely not intended. Check that referenced properties are always defined. Add checks that `$(MonoAndroidAssetsPrefix)` and `$(MonoAndroidResourcePrefix)` are not blank.
During AndroidX and GooglePlaySerivces/Firebase/MLKit builds experienced following warning (which was crashing one of Mac boxes with running out of application memory):
This PR fixes this warning by adding check for $(MonoAndroidAssetsPrefix) not being empty string.