From 18667ffc0b329fd14ab5b2529b00531146945f24 Mon Sep 17 00:00:00 2001 From: Martijn Visser Date: Fri, 20 Oct 2023 11:38:54 +0200 Subject: [PATCH] strip problematic cldr artifact before building --- build/create_binaries/Manifest.toml | 68 ++++++++++++++++++++++++++++- build/create_binaries/Project.toml | 3 ++ build/create_binaries/create_app.jl | 2 + build/create_binaries/create_lib.jl | 2 + build/create_binaries/strip_cldr.jl | 24 ++++++++++ core/Manifest.toml | 2 +- core/Project.toml | 2 + 7 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 build/create_binaries/strip_cldr.jl diff --git a/build/create_binaries/Manifest.toml b/build/create_binaries/Manifest.toml index 60801b50c..737ac860a 100644 --- a/build/create_binaries/Manifest.toml +++ b/build/create_binaries/Manifest.toml @@ -2,7 +2,7 @@ julia_version = "1.9.3" manifest_format = "2.0" -project_hash = "c56985ee841fb30b2cb92ecec4da345315a95306" +project_hash = "71b2262fd2a2bd6f9c0ade48d4062e051c3f39eb" [[deps.ArgTools]] uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" @@ -14,6 +14,19 @@ uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" [[deps.Base64]] uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" +[[deps.Compat]] +deps = ["UUIDs"] +git-tree-sha1 = "8a62af3e248a8c4bad6b32cbbe663ae02275e32c" +uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" +version = "4.10.0" + + [deps.Compat.extensions] + CompatLinearAlgebraExt = "LinearAlgebra" + + [deps.Compat.weakdeps] + Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" + LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" + [[deps.Dates]] deps = ["Printf"] uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" @@ -23,6 +36,11 @@ deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" version = "1.6.0" +[[deps.ExprTools]] +git-tree-sha1 = "27415f162e6028e81c72b82ef756bf321213b6ec" +uuid = "e2ba6199-217a-4e67-a87a-7c52f15ade04" +version = "0.1.10" + [[deps.FileWatching]] uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" @@ -31,6 +49,12 @@ git-tree-sha1 = "97285bbd5230dd766e9ef6749b80fc617126d496" uuid = "c27321d9-0574-5035-807b-f59d2c89b15c" version = "1.3.1" +[[deps.InlineStrings]] +deps = ["Parsers"] +git-tree-sha1 = "9cc2baf75c6d09f9da536ddf58eb2f29dedaf461" +uuid = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48" +version = "1.4.0" + [[deps.InteractiveUtils]] deps = ["Markdown"] uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" @@ -73,6 +97,12 @@ deps = ["Artifacts", "Libdl"] uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" version = "2.28.2+0" +[[deps.Mocking]] +deps = ["Compat", "ExprTools"] +git-tree-sha1 = "4cc0c5a83933648b615c36c2b956d94fda70641e" +uuid = "78c3b35d-d492-501b-9361-3d52fe80e533" +version = "0.7.7" + [[deps.MozillaCACerts_jll]] uuid = "14a3606d-f60d-562e-9121-12d972cd8159" version = "2022.10.11" @@ -87,11 +117,29 @@ git-tree-sha1 = "d24f0920777c64c0265e9725eb4a3ec450bc36dd" uuid = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d" version = "2.1.10" +[[deps.Parsers]] +deps = ["Dates", "PrecompileTools", "UUIDs"] +git-tree-sha1 = "716e24b21538abc91f6205fd1d8363f39b442851" +uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" +version = "2.7.2" + [[deps.Pkg]] deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" version = "1.9.2" +[[deps.PrecompileTools]] +deps = ["Preferences"] +git-tree-sha1 = "03b4c25b43cb84cee5c90aa9b5ea0a78fd848d2f" +uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" +version = "1.2.0" + +[[deps.Preferences]] +deps = ["TOML"] +git-tree-sha1 = "00805cd429dcb4870060ff49ef443486c262e38e" +uuid = "21216c6a-2e73-6563-6e65-726566657250" +version = "1.4.1" + [[deps.Printf]] deps = ["Unicode"] uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" @@ -131,11 +179,29 @@ deps = ["Dates"] uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" version = "1.0.3" +[[deps.TZJData]] +deps = ["Artifacts"] +git-tree-sha1 = "d39314cdbaf5b90a047db33858626f8d1cc973e1" +uuid = "dc5dba14-91b3-4cab-a142-028a31da12f7" +version = "1.0.0+2023c" + [[deps.Tar]] deps = ["ArgTools", "SHA"] uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" version = "1.10.0" +[[deps.TimeZones]] +deps = ["Artifacts", "Dates", "Downloads", "InlineStrings", "LazyArtifacts", "Mocking", "Printf", "Scratch", "TZJData", "Unicode", "p7zip_jll"] +git-tree-sha1 = "89e64d61ef3cd9e80f7fc12b7d13db2d75a23c03" +uuid = "f269a46b-ccf7-5d73-abea-4c690281aa53" +version = "1.13.0" + + [deps.TimeZones.extensions] + TimeZonesRecipesBaseExt = "RecipesBase" + + [deps.TimeZones.weakdeps] + RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" + [[deps.UUIDs]] deps = ["Random", "SHA"] uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" diff --git a/build/create_binaries/Project.toml b/build/create_binaries/Project.toml index b6f893ed5..275616313 100644 --- a/build/create_binaries/Project.toml +++ b/build/create_binaries/Project.toml @@ -1,8 +1,11 @@ [deps] +Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" LibGit2 = "76f85450-5226-5b5a-8eaa-529ad045b433" PackageCompiler = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d" TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76" +TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53" [compat] PackageCompiler = "2" +TimeZones = "=1.13.0" julia = "1.9" diff --git a/build/create_binaries/create_app.jl b/build/create_binaries/create_app.jl index 58815815b..ed4c15fc0 100644 --- a/build/create_binaries/create_app.jl +++ b/build/create_binaries/create_app.jl @@ -2,6 +2,8 @@ using PackageCompiler using TOML using LibGit2 +include("strip_cldr.jl") + # change directory to this script's location cd(@__DIR__) diff --git a/build/create_binaries/create_lib.jl b/build/create_binaries/create_lib.jl index df8c5408b..87b421f97 100644 --- a/build/create_binaries/create_lib.jl +++ b/build/create_binaries/create_lib.jl @@ -2,6 +2,8 @@ using PackageCompiler using TOML using LibGit2 +include("strip_cldr.jl") + cd(@__DIR__) project_dir = "../libribasim" diff --git a/build/create_binaries/strip_cldr.jl b/build/create_binaries/strip_cldr.jl new file mode 100644 index 000000000..fbded628c --- /dev/null +++ b/build/create_binaries/strip_cldr.jl @@ -0,0 +1,24 @@ +# The cldr artifact has such long paths that it errors on Windows unless long paths are enabled. +# Also the artifact has many files and is over 300 MB, while we only need a single small file. +# This modifies the artifact to remove everything except the file we need. +# Since the artifact is only used on Windows, only strip do it there. +# This needs exactly TimeZones 1.13.0, which is fixed in the Project.toml. +# https://github.com/JuliaTime/TimeZones.jl/issues/373 + +using Artifacts + +if Sys.iswindows() + # Get the artifact directory and the file path we need to keep + hash = Base.SHA1("40b35727ea0aff9a9f28b7454004b68849caf67b") + @assert artifact_exists(hash) + artifact_dir = artifact_path(hash) + keep_file = + normpath(artifact_dir, "cldr-release-43-1/common/supplemental/windowsZones.xml") + @assert isfile(keep_file) + + # Read the file into memory, empty the artifact dir, and write the file back + keep_file_content = read(keep_file) + rm(artifact_dir; recursive = true) + mkpath(dirname(keep_file)) + write(keep_file, keep_file_content) +end diff --git a/core/Manifest.toml b/core/Manifest.toml index fd14b4ebc..073418681 100644 --- a/core/Manifest.toml +++ b/core/Manifest.toml @@ -2,7 +2,7 @@ julia_version = "1.9.3" manifest_format = "2.0" -project_hash = "5ce3afdbcba98d75c8a7887863cdc1ee1cabf1e7" +project_hash = "c63b237aec6a6bf6314284b2b07a94b93a9f0a36" [[deps.ADTypes]] git-tree-sha1 = "5d2e21d7b0d8c22f67483ef95ebdc39c0e6b6003" diff --git a/core/Project.toml b/core/Project.toml index 684f36f6b..62c01fb3b 100644 --- a/core/Project.toml +++ b/core/Project.toml @@ -33,6 +33,7 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a" Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" TerminalLoggers = "5d786b92-1e48-4d6f-9151-6b4477ca9bed" +TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53" TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f" TranscodingStreams = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" @@ -64,6 +65,7 @@ SciMLBase = "1.60, 2" StructArrays = "0.6.13" Tables = "1" TerminalLoggers = "0.1.7" +TimeZones = "=1.13.0" TimerOutputs = "0.5" TranscodingStreams = "0.9, 0.10" julia = "1.9"