Skip to content

Commit 2fbd0b1

Browse files
authored
Revert "Put brotli on the FetchContent plan (#107166)"
This reverts commit a7fc1ea.
1 parent 670401f commit 2fbd0b1

File tree

125 files changed

+77
-2929
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+77
-2929
lines changed

eng/DotNetBuild.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989

9090
<!-- Handle system libraries -->
9191
<UseSystemLibs Condition="'$(UseSystemLibs)' != ''">+$(UseSystemLibs)+</UseSystemLibs>
92-
<InnerBuildArgs Condition="$(UseSystemLibs.Contains('+brotli+'))">$(InnerBuildArgs) --cmakeargs -DCLR_CMAKE_USE_SYSTEM_BROTLI=true</InnerBuildArgs>
92+
<InnerBuildArgs Condition="'$(PortableBuild)' != 'true'">$(InnerBuildArgs) --cmakeargs -DCLR_CMAKE_USE_SYSTEM_BROTLI=true</InnerBuildArgs>
9393
<InnerBuildArgs Condition="$(UseSystemLibs.Contains('+libunwind+'))">$(InnerBuildArgs) --cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=true</InnerBuildArgs>
9494
<!-- TODO: llvm-libunwind -->
9595
<!-- TODO: LinuxTracepoints -->

eng/testing/tests.ioslike.targets

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,6 @@
218218

219219
<AppleNativeFilesToBundle Include="$(PublishDir)\**\*.*" Exclude="@(AppleAssembliesToBundle);@(ApplePdbsToBundle);@(AppleXmlsToBundle);@(_SatelliteAssemblies)" />
220220
</ItemGroup>
221-
222-
<ItemGroup Condition="'$(RuntimeFlavor)' == 'coreclr'">
223-
<AppleNativeFilesToBundle Include="$(CoreCLRArtifactsPath)\aotsdk\libbrotlienc.a" />
224-
<AppleNativeFilesToBundle Include="$(CoreCLRArtifactsPath)\aotsdk\libbrotlidec.a" />
225-
<AppleNativeFilesToBundle Include="$(CoreCLRArtifactsPath)\aotsdk\libbrotlicommon.a" />
226-
</ItemGroup>
227221
</Target>
228222

229223
<Target Name="_CopyTestArchive"

src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ The .NET Foundation licenses this file to you under the MIT license.
3030

3131
<PropertyGroup>
3232
<UseSystemZlib Condition="'$(UseSystemZlib)' == '' and !Exists('$(IlcSdkPath)libz.a')">true</UseSystemZlib>
33-
<!-- Use libbrotlicommon.a as the sentinel for the three brotli libs. -->
34-
<UseSystemBrotli Condition="'$(UseSystemBrotli)' == '' and !Exists('$(IlcSdkPath)libbrotlicommon.a')">true</UseSystemBrotli>
3533
<FullRuntimeName>libRuntime.WorkstationGC</FullRuntimeName>
3634
<FullRuntimeName Condition="'$(ServerGarbageCollection)' == 'true' or '$(IlcLinkServerGC)' == 'true'">libRuntime.ServerGC</FullRuntimeName>
3735

@@ -170,14 +168,6 @@ The .NET Foundation licenses this file to you under the MIT license.
170168
<NativeLibrary Condition="'$(UseSystemZlib)' != 'true'" Include="$(IlcSdkPath)libz.a" />
171169
</ItemGroup>
172170

173-
<!-- brotli must be added after System.IO.Compression.Native and brotlicommon must be added last, order matters. -->
174-
<ItemGroup Condition="'$(UseSystemBrotli)' != 'true'">
175-
<NativeLibrary Include="$(IlcSdkPath)libbrotlienc.a" />
176-
<NativeLibrary Include="$(IlcSdkPath)libbrotlidec.a" />
177-
<NativeLibrary Include="$(IlcSdkPath)libbrotlicommon.a" />
178-
</ItemGroup>
179-
180-
181171
<ItemGroup Condition="'$(StaticICULinking)' == 'true' and '$(NativeLib)' != 'Static' and '$(InvariantGlobalization)' != 'true'">
182172
<NativeLibrary Include="$(IntermediateOutputPath)libs/System.Globalization.Native/build/libSystem.Globalization.Native.a" />
183173
<DirectPInvoke Include="libSystem.Globalization.Native" />
@@ -191,6 +181,11 @@ The .NET Foundation licenses this file to you under the MIT license.
191181
<NativeSystemLibrary Include="crypto" />
192182
</ItemGroup>
193183

184+
<ItemGroup Condition="'$(UseSystemBrotli)' != 'false' and Exists('$(IlcSdkPath)nonportable.txt')">
185+
<NativeSystemLibrary Include="brotlienc" />
186+
<NativeSystemLibrary Include="brotlidec" />
187+
</ItemGroup>
188+
194189
<ItemGroup Condition="'$(StaticOpenSslLinking)' == 'true' and '$(NativeLib)' != 'Static'">
195190
<NativeLibrary Include="$(IntermediateOutputPath)libs/System.Security.Cryptography.Native/build/libSystem.Security.Cryptography.Native.OpenSsl.a" />
196191
<DirectPInvoke Include="libSystem.Security.Cryptography.Native.OpenSsl" />
@@ -215,7 +210,6 @@ The .NET Foundation licenses this file to you under the MIT license.
215210
<NativeSystemLibrary Include="swiftCore" Condition="'$(_IsApplePlatform)' == 'true'" />
216211
<NativeSystemLibrary Include="swiftFoundation" Condition="'$(_IsApplePlatform)' == 'true'" />
217212
<NativeSystemLibrary Include="z" Condition="'$(UseSystemZlib)' == 'true'" />
218-
<NativeSystemLibrary Include="brotlienc;brotlidec;brotlicommon" Condition="'$(UseSystemBrotli)' == 'true'" />
219213
<NativeSystemLibrary Include="rt" Condition="'$(_IsApplePlatform)' != 'true' and '$(_linuxLibcFlavor)' != 'bionic'" />
220214
<NativeSystemLibrary Include="log" Condition="'$(_linuxLibcFlavor)' == 'bionic'" />
221215
<NativeSystemLibrary Include="icucore" Condition="'$(_IsApplePlatform)' == 'true'" />

src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Windows.targets

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ The .NET Foundation licenses this file to you under the MIT license.
4747
<NativeLibrary Condition="'$(IlcMultiModule)' == 'true'" Include="$(SharedLibrary)" />
4848
<NativeLibrary Include="$(IlcSdkPath)$(StandaloneGCSupportName)$(LibrarySuffix)" />
4949
<NativeLibrary Include="$(IlcSdkPath)zlibstatic$(LibFileExt)" />
50-
<NativeLibrary Include="$(IlcSdkPath)brotlicommon$(LibFileExt)" />
51-
<NativeLibrary Include="$(IlcSdkPath)brotlienc$(LibFileExt)" />
52-
<NativeLibrary Include="$(IlcSdkPath)brotlidec$(LibFileExt)" />
5350
</ItemGroup>
5451

5552
<ItemGroup>

src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -279,13 +279,6 @@
279279
<!-- zlib-specific files -->
280280
<PlatformManifestFileEntry Include="libz.a" IsNative="true" />
281281
<PlatformManifestFileEntry Include="zlibstatic.lib" IsNative="true" />
282-
<!-- brotli-specific files -->
283-
<PlatformManifestFileEntry Include="libbrotlienc.a" IsNative="true" />
284-
<PlatformManifestFileEntry Include="libbrotlidec.a" IsNative="true" />
285-
<PlatformManifestFileEntry Include="libbrotlicommon.a" IsNative="true" />
286-
<PlatformManifestFileEntry Include="brotlienc.lib" IsNative="true" />
287-
<PlatformManifestFileEntry Include="brotlidec.lib" IsNative="true" />
288-
<PlatformManifestFileEntry Include="brotlicommon.lib" IsNative="true" />
289282
</ItemGroup>
290283

291284
<ItemGroup>

src/mono/msbuild/android/build/AndroidBuild.targets

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,15 +203,14 @@
203203
<ProfiledAOTProfilePaths Include="$(MibcFilePath)" />
204204
</ItemGroup>
205205

206-
<!--
207-
In order for the runtime to work when static linking, we must supply
206+
<!--
207+
In order for the runtime to work when static linking, we must supply
208208
a list of direct pinvokes otherwise the runtime will crash
209209
-->
210210
<ItemGroup Condition="'$(_IsLibraryMode)' == 'true'">
211211
<DirectPInvokes Include="libSystem.Native" />
212212
<DirectPInvokes Include="libSystem.IO.Compression.Native" />
213213
<DirectPInvokes Include="libSystem.Security.Cryptography.Native.Android" />
214-
<DirectPInvokes Include="libbrotlienc;libbrotlidec" />
215214
</ItemGroup>
216215

217216
<PropertyGroup>

src/mono/msbuild/apple/build/AppleBuild.targets

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@
1010
</PropertyGroup>
1111

1212
<UsingTask Condition="'$(AppleGenerateAppBundle)' == 'true'"
13-
TaskName="AppleAppBuilderTask"
13+
TaskName="AppleAppBuilderTask"
1414
AssemblyFile="$(AppleAppBuilderTasksAssemblyPath)" />
1515
<UsingTask Condition="'$(RunAOTCompilation)' == 'true'"
1616
TaskName="ILStrip"
1717
AssemblyFile="$(MonoTargetsTasksAssemblyPath)" />
18-
<UsingTask TaskName="MonoTargetsTasks.MarshalingPInvokeScanner"
18+
<UsingTask TaskName="MonoTargetsTasks.MarshalingPInvokeScanner"
1919
AssemblyFile="$(MonoTargetsTasksAssemblyPath)" />
2020

2121
<Import Condition="Exists('$(ILCompilerTargetsPath)') and '$(UseNativeAOTRuntime)' == 'true'"
2222
Project="$(ILCompilerTargetsPath)" />
2323
<Import Condition="Exists('$(ILLinkTargetsPath)') and '$(UseNativeAOTRuntime)' == 'true'"
2424
Project="$(ILLinkTargetsPath)" />
2525

26-
<Target Name="_CleanPublish"
26+
<Target Name="_CleanPublish"
2727
BeforeTargets="Build">
2828
<RemoveDir Directories="$(PublishDir)" />
2929
</Target>
@@ -196,7 +196,7 @@
196196
<_IsNative>false</_IsNative>
197197
</_AssembliesToBundleInternal>
198198

199-
<_AotInputAssemblies Include="@(_AssembliesToBundleInternal)"
199+
<_AotInputAssemblies Include="@(_AssembliesToBundleInternal)"
200200
Condition="'%(_AssembliesToBundleInternal._InternalForceInterpret)' != 'true'">
201201
<AotArguments>$(AotArguments)</AotArguments>
202202
<ProcessArguments>$(ProcessArguments)</ProcessArguments>
@@ -205,7 +205,7 @@
205205
<_AOT_InternalForceInterpretAssemblies Include="@(_AssembliesToBundleInternal->WithMetadataValue('_InternalForceInterpret', 'true'))" />
206206
<_AssembliesToBundleInternal Remove="@(_AssembliesToBundleInternal)" />
207207
</ItemGroup>
208-
208+
209209
<MakeDir Directories="$(_MobileIntermediateOutputPath)" />
210210

211211
<PropertyGroup Condition="'$(iOSLikeDedup)' == 'true'">
@@ -228,16 +228,15 @@
228228
<_ExcludeFromAppDir Include="$(_iOSLikeDedupAssembly)" />
229229
</ItemGroup>
230230

231-
<!--
232-
In order for the runtime to work when static linking, we must supply
231+
<!--
232+
In order for the runtime to work when static linking, we must supply
233233
a list of direct pinvokes otherwise the runtime will crash
234234
-->
235235
<ItemGroup Condition="'$(_IsLibraryMode)' == 'true'">
236236
<DirectPInvokes Include="libSystem.Native" />
237237
<DirectPInvokes Include="libSystem.IO.Compression.Native" />
238238
<DirectPInvokes Include="libSystem.Net.Security.Native" />
239239
<DirectPInvokes Include="libSystem.Security.Cryptography.Native.Apple" />
240-
<DirectPInvokes Include="libbrotlienc;libbrotlidec" />
241240
</ItemGroup>
242241

243242
<PropertyGroup>
@@ -275,7 +274,7 @@
275274
<Target Name="_AppleNativeAotCompile"
276275
DependsOnTargets="SetupProperties;ComputeIlcCompileInputs;IlcCompile;$(_IlcLibraryBuildDependsOn)" />
277276

278-
<Target Name="_AppleGenerateAppBundle"
277+
<Target Name="_AppleGenerateAppBundle"
279278
Condition="'$(AppleGenerateAppBundle)' == 'true'"
280279
DependsOnTargets="_AppleGenerateRuntimeConfig">
281280
<!-- Run App bundler, it uses AOT libs (if needed), link all native bits, compile simple UI (written in ObjC)
@@ -337,7 +336,7 @@
337336
</Target>
338337

339338
<Target Name="_AfterAppleBuild">
340-
339+
341340
</Target>
342341

343342
<Target Name="_AppleGenerateRuntimeConfig"
@@ -356,4 +355,4 @@
356355
RuntimeConfigReservedProperties="@(_RuntimeConfigReservedProperties)">
357356
</RuntimeConfigParserTask>
358357
</Target>
359-
</Project>
358+
</Project>

src/native/corehost/apphost/static/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,6 @@ if(CLR_CMAKE_TARGET_WIN32)
153153
delayimp.lib
154154
)
155155

156-
# additional requirements for System.IO.Compression.Native
157-
include(${CLR_SRC_NATIVE_DIR}/libs/System.IO.Compression.Native/extra_libs.cmake)
158-
append_extra_compression_libs(NATIVE_LIBS)
159-
160156
set(RUNTIMEINFO_LIB runtimeinfo)
161157

162158
else()
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
1.1.0
22
https://github.com/google/brotli/releases/tag/v1.1.0
33

4-
Deleted tests, python, docs folders
5-
Apply https://github.com/google/brotli/commit/85d88cbfc2b742e0742286ec277b73bdbf7be433.patch
4+
Copy the c/dec, c/enc, c/common, and c/include folders into the root and remove all other files.
5+
6+
Apply https://github.com/google/brotli/commit/85d88cbfc2b742e0742286ec277b73bdbf7be433.patch

src/native/external/brotli.cmake

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,39 @@
11
# IMPORTANT: do not use add_compile_options(), add_definitions() or similar functions here since it will leak to the including projects
22

3-
include(FetchContent)
3+
include_directories(BEFORE "${CMAKE_CURRENT_LIST_DIR}/brotli/include")
44

5-
FetchContent_Declare(
6-
brotli
7-
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/brotli
5+
set (BROTLI_SOURCES_BASE
6+
common/constants.c
7+
common/context.c
8+
common/dictionary.c
9+
common/platform.c
10+
common/shared_dictionary.c
11+
common/transform.c
12+
dec/bit_reader.c
13+
dec/decode.c
14+
dec/huffman.c
15+
dec/state.c
16+
enc/backward_references.c
17+
enc/backward_references_hq.c
18+
enc/bit_cost.c
19+
enc/block_splitter.c
20+
enc/brotli_bit_stream.c
21+
enc/cluster.c
22+
enc/command.c
23+
enc/compound_dictionary.c
24+
enc/compress_fragment.c
25+
enc/compress_fragment_two_pass.c
26+
enc/dictionary_hash.c
27+
enc/encode.c
28+
enc/encoder_dict.c
29+
enc/entropy_encode.c
30+
enc/fast_log.c
31+
enc/histogram.c
32+
enc/literal_cost.c
33+
enc/memory.c
34+
enc/metablock.c
35+
enc/static_dict.c
36+
enc/utf8_util.c
837
)
938

10-
set(BROTLI_DISABLE_TESTS ON)
11-
set(__CURRENT_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
12-
set(BUILD_SHARED_LIBS OFF)
13-
FetchContent_MakeAvailable(brotli)
14-
set(BUILD_SHARED_LIBS ${__CURRENT_BUILD_SHARED_LIBS})
15-
16-
target_compile_options(brotlicommon PRIVATE $<$<COMPILE_LANG_AND_ID:C,MSVC>:/guard:cf>)
17-
target_compile_options(brotlienc PRIVATE $<$<COMPILE_LANG_AND_ID:C,MSVC>:/guard:cf>)
18-
target_compile_options(brotlidec PRIVATE $<$<COMPILE_LANG_AND_ID:C,MSVC>:/guard:cf>)
19-
target_compile_options(brotlienc PRIVATE $<$<COMPILE_LANG_AND_ID:C,Clang,AppleClang,GNU>:-Wno-implicit-fallthrough>)
20-
target_compile_options(brotlidec PRIVATE $<$<COMPILE_LANG_AND_ID:C,Clang,AppleClang,GNU>:-Wno-implicit-fallthrough>)
21-
22-
# Even though we aren't building brotli as shared libraries, we still need to be able to export the symbols
23-
# from the brotli libraries so that they can be used by System.IO.Compression.
24-
# Since we link all of the static libraries into a single shared library, we need to define BROTLICOMMON_SHARED_COMPILATION
25-
# for all targets so brotlienc and brotlidec don't expect to link against a separate brotlicommon shared library.
26-
target_compile_definitions(brotlienc PRIVATE BROTLI_SHARED_COMPILATION BROTLIENC_SHARED_COMPILATION BROTLICOMMON_SHARED_COMPILATION)
27-
target_compile_definitions(brotlidec PRIVATE BROTLI_SHARED_COMPILATION BROTLIDEC_SHARED_COMPILATION BROTLICOMMON_SHARED_COMPILATION)
28-
target_compile_definitions(brotlicommon PRIVATE BROTLI_SHARED_COMPILATION BROTLICOMMON_SHARED_COMPILATION)
29-
30-
# Don't build the brotli command line tool unless explicitly requested
31-
# (which we never do)
32-
set_target_properties(brotli PROPERTIES EXCLUDE_FROM_ALL ON)
39+
addprefix(BROTLI_SOURCES "${CMAKE_CURRENT_LIST_DIR}/brotli" "${BROTLI_SOURCES_BASE}")

0 commit comments

Comments
 (0)