Skip to content

Commit

Permalink
[net8.0] Merge main into net8.0. (xamarin#18436)
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfbjarne authored Jun 13, 2023
2 parents a6f378e + 5d6a92e commit b0fba63
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 8 deletions.
1 change: 1 addition & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Usage: configure [options]
EOL
}

cd "$(dirname "${BASH_SOURCE[0]}")"
CONFIGURED_FILE=configure.inc

rm -f $CONFIGURED_FILE
Expand Down
3 changes: 3 additions & 0 deletions dotnet/targets/Xamarin.Shared.Sdk.props
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@

<!-- Setting _RequiresILLinkPack to true so that the ILLink pack is always restored. -->
<_RequiresILLinkPack Condition="'$(_RequiresILLinkPack)' == ''">true</_RequiresILLinkPack>

<!-- Explicitly export symbols using clang command-line option "-exported_symbols_list export_list" -->
<_ExportSymbolsExplicitly Condition="'$(_ExportSymbolsExplicitly)' == ''">true</_ExportSymbolsExplicitly>
</PropertyGroup>

<!-- Set the default RuntimeIdentifier if not already specified. -->
Expand Down
20 changes: 16 additions & 4 deletions dotnet/targets/Xamarin.Shared.Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -1208,6 +1208,10 @@
</PropertyGroup>

<Target Name="_ComputeLinkNativeExecutableInputs" Condition="'$(IsMacEnabled)' == 'true'">
<PropertyGroup>
<_ExportedSymbolsFile Condition="'$(_ExportedSymbolsFile)' == '' and '$(_MtouchSymbolsList)' == ''">/dev/null</_ExportedSymbolsFile> <!-- nothing to export -->
<_ExportedSymbolsFile Condition="'$(_ExportedSymbolsFile)' == ''">$(_MtouchSymbolsList)</_ExportedSymbolsFile>
</PropertyGroup>
<ItemGroup>
<_XamarinMainLibraries Include="$(_XamarinNativeLibraryDirectory)/$(_LibXamarinName)" />
<!-- Link with the libraries shipped with the mono runtime pack -->
Expand All @@ -1224,6 +1228,9 @@
<_MainLinkerFlags Include="-liconv" />
<_MainLinkerFlags Include="-lcompression" />

<_MainLinkerFlags Condition="'$(_ExportSymbolsExplicitly)' == 'true'" Include="-exported_symbols_list" />
<_MainLinkerFlags Condition="'$(_ExportSymbolsExplicitly)' == 'true'" Include="$(_ExportedSymbolsFile)" />

<!-- Here we must add all the files that should make us (re-)link the executable -->
<_LinkNativeExecutableInputs Include="@(_NativeExecutableObjectFiles)" />
<_LinkNativeExecutableInputs Include="@(_XamarinMainLibraries)" />
Expand Down Expand Up @@ -1310,13 +1317,21 @@
<_NativeReferences Include="@(_FileNativeReference)" Condition="'%(_FileNativeReference.LinkToExecutable)' != 'false'" />
</ItemGroup>

<!-- remove the `-u` prefix from `_ReferencesLinkerFlags` so we can give the output file to `strip` -->
<WriteLinesToFile SessionId="$(BuildSessionId)" File="$(_MtouchSymbolsList)" Lines="@(_ReferencesLinkerFlags->'%(Identity)'->Substring (2))" Overwrite="true" />

<ItemGroup>
<_AllLinkerFlags Include="@(_AssemblyLinkerFlags);@(_MainLinkerFlags);@(_CustomLinkFlags)" />
<_AllLinkerFlags Condition="'$(_ExportSymbolsExplicitly)' != 'true'" Include="@(_ReferencesLinkerFlags)" />
</ItemGroup>

<LinkNativeCode
SessionId="$(BuildSessionId)"
DylibRPath="$(_DylibRPath)"
EntitlementsInExecutable="$(_CompiledEntitlements)"
FrameworkRPath="$(_EmbeddedFrameworksRPath)"
Frameworks="@(_NativeExecutableFrameworks);@(_BindingLibraryFrameworks)"
LinkerFlags="@(_AssemblyLinkerFlags);@(_ReferencesLinkerFlags);@(_MainLinkerFlags);@(_CustomLinkFlags)"
LinkerFlags="@(_AllLinkerFlags)"
LinkWithLibraries="@(_XamarinMainLibraries);@(_BindingLibraryLinkWith);@(_MainLinkWith)"
MinimumOSVersion="$(_MinimumOSVersion)"
NativeReferences="@(_NativeReferences)"
Expand All @@ -1329,9 +1344,6 @@
TargetFrameworkMoniker="$(_ComputedTargetFrameworkMoniker)"
/>

<!-- remove the `-u` prefix from `_ReferencesLinkerFlags` so we can give the output file to `strip` -->
<WriteLinesToFile SessionId="$(BuildSessionId)" File="$(_MtouchSymbolsList)" Lines="@(_ReferencesLinkerFlags->'%(Identity)'->Substring (2))" Overwrite="true" />

<ItemGroup>
<!-- Copy the executable from the intermediate directory to the .app -->
<ResolvedFileToPublish Include="$(_IntermediateNativeLibraryDir)$(_NativeExecutableName)">
Expand Down
4 changes: 2 additions & 2 deletions msbuild/Xamarin.MacDev.Tasks/Decompress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public static bool TryDecompress (TaskLoggingHelper log, string zip, string reso

static bool TryDecompressUsingUnzip (TaskLoggingHelper log, string zip, string resource, string decompressionDir)
{
var archive = ZipFile.OpenRead (zip);
using var archive = ZipFile.OpenRead (zip);
resource = resource.Replace ('\\', zipDirectorySeparator);
var entry = archive.GetEntry (resource);
if (entry is null) {
Expand Down Expand Up @@ -165,7 +165,7 @@ static bool TryDecompressUsingSystemIOCompression (TaskLoggingHelper log, string
resource = resource.Replace ('\\', zipDirectorySeparator);
var resourceAsDir = resource + zipDirectorySeparator;

var archive = ZipFile.OpenRead (zip);
using var archive = ZipFile.OpenRead (zip);
foreach (var entry in archive.Entries) {
var entryPath = entry.FullName;
if (entryPath.Length == 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public override bool Execute ()
Log.LogWarning (MSBStrings.W7100, bindingOutputPath);
}
}
packagedFiles.Add (manifestPath);
}

PackagedFiles = packagedFiles.Select (v => new TaskItem (v)).ToArray ();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ static bool TryGetSidecarManifest (TaskLoggingHelper log, string resources, [Not
static bool TryGetInfoPlist (TaskLoggingHelper log, string resourcePath, string xcframework, [NotNullWhen (true)] out PDictionary? plist)
{
var manifestPath = Path.Combine (xcframework, "Info.plist");
var stream = CompressionHelper.TryGetPotentiallyCompressedFile (log, resourcePath, manifestPath);
using var stream = CompressionHelper.TryGetPotentiallyCompressedFile (log, resourcePath, manifestPath);
if (stream is null) {
plist = null;
return false;
Expand Down
2 changes: 1 addition & 1 deletion tools/common/Make.common
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
$(Q) if ! diff $@ $@.tmp >/dev/null; then $(CP) $@.tmp $@; git diff "$@"; echo "The file $(TOP)/tools/common/SdkVersions.cs has been automatically re-generated; please commit the changes."; exit 1; fi
$(Q) touch $@

../common/ProductConstants.cs: ../common/ProductConstants.in.cs Makefile $(TOP)/Make.config
../common/ProductConstants.cs: ../common/ProductConstants.in.cs Makefile $(TOP)/Make.config $(TOP)/.git/index
$(Q_GEN) sed \
-e "s/@IOS_VERSION@/$(IOS_PACKAGE_VERSION_MAJOR).$(IOS_PACKAGE_VERSION_MINOR).$(IOS_PACKAGE_VERSION_REV)/g" \
-e "s/@TVOS_VERSION@/$(IOS_PACKAGE_VERSION_MAJOR).$(IOS_PACKAGE_VERSION_MINOR).$(IOS_PACKAGE_VERSION_REV)/g" \
Expand Down

0 comments on commit b0fba63

Please sign in to comment.