From 96511fc20383ec26d211412f1e5b94d83ebaf4a2 Mon Sep 17 00:00:00 2001 From: Martijn Visser Date: Thu, 26 Oct 2023 11:53:57 +0200 Subject: [PATCH] Revert "Use a TimeZones.jl fork for now (#698)" This reverts commit c3607c8e41d0684d60d98c2466b589fde2cdeeea. --- build/create_binaries/Manifest.toml | 12 +++++------- build/create_binaries/Project.toml | 2 +- build/create_binaries/create_app.jl | 2 ++ build/create_binaries/create_lib.jl | 2 ++ build/create_binaries/strip_cldr.jl | 24 ++++++++++++++++++++++++ build/libribasim/Manifest.toml | 2 +- build/ribasim_cli/Manifest.toml | 2 +- core/Manifest.toml | 8 +++----- core/Project.toml | 2 +- 9 files changed, 40 insertions(+), 16 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 730c727bb..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 = "d99377ff8fe51b02cfd3a3aaf109a7ed1b45b3d2" +project_hash = "71b2262fd2a2bd6f9c0ade48d4062e051c3f39eb" [[deps.ArgTools]] uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" @@ -113,9 +113,9 @@ version = "1.2.0" [[deps.PackageCompiler]] deps = ["Artifacts", "Glob", "LazyArtifacts", "Libdl", "Pkg", "Printf", "RelocatableFolders", "TOML", "UUIDs"] -git-tree-sha1 = "2838fa7697780395ef328861b7716925ac7dd48a" +git-tree-sha1 = "d24f0920777c64c0265e9725eb4a3ec450bc36dd" uuid = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d" -version = "2.1.11" +version = "2.1.10" [[deps.Parsers]] deps = ["Dates", "PrecompileTools", "UUIDs"] @@ -191,10 +191,8 @@ uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" version = "1.10.0" [[deps.TimeZones]] -deps = ["Artifacts", "Dates", "Downloads", "InlineStrings", "Mocking", "Printf", "Scratch", "TZJData", "Unicode", "p7zip_jll"] -git-tree-sha1 = "6f2a9362603a79a916c54a10fc7c9a4ff2ca0848" -repo-rev = "cldr" -repo-url = "https://github.com/visr/TimeZones.jl" +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" diff --git a/build/create_binaries/Project.toml b/build/create_binaries/Project.toml index c3500a282..275616313 100644 --- a/build/create_binaries/Project.toml +++ b/build/create_binaries/Project.toml @@ -7,5 +7,5 @@ TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53" [compat] PackageCompiler = "2" -TimeZones = "1.13" +TimeZones = "=1.13.0" julia = "1.9" diff --git a/build/create_binaries/create_app.jl b/build/create_binaries/create_app.jl index 1e8f57450..72e6a7262 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 54d05794e..0b8364099 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/build/libribasim/Manifest.toml b/build/libribasim/Manifest.toml index 95db712d6..5db3c6ffd 100644 --- a/build/libribasim/Manifest.toml +++ b/build/libribasim/Manifest.toml @@ -979,7 +979,7 @@ uuid = "ae029012-a4dd-5104-9daa-d747884805df" version = "1.3.0" [[deps.Ribasim]] -deps = ["Arrow", "BasicModelInterface", "CodecLz4", "CodecZstd", "ComponentArrays", "Configurations", "DBInterface", "DataInterpolations", "DataStructures", "Dates", "Dictionaries", "DiffEqCallbacks", "FiniteDiff", "ForwardDiff", "Graphs", "HiGHS", "IterTools", "JuMP", "Legolas", "Logging", "LoggingExtras", "OrdinaryDiffEq", "PreallocationTools", "SQLite", "SciMLBase", "SparseArrays", "StructArrays", "Tables", "TerminalLoggers", "TimeZones", "TimerOutputs", "TranscodingStreams"] +deps = ["Arrow", "BasicModelInterface", "CodecLz4", "CodecZstd", "ComponentArrays", "Configurations", "DBInterface", "DataInterpolations", "DataStructures", "Dates", "Dictionaries", "DiffEqCallbacks", "FiniteDiff", "ForwardDiff", "Graphs", "HiGHS", "IterTools", "JuMP", "Legolas", "Logging", "LoggingExtras", "OrdinaryDiffEq", "PreallocationTools", "SQLite", "SciMLBase", "SparseArrays", "StructArrays", "Tables", "TerminalLoggers", "TimerOutputs", "TranscodingStreams"] path = "../../core" uuid = "aac5e3d9-0b8f-4d4f-8241-b1a7a9632635" version = "0.3.0" diff --git a/build/ribasim_cli/Manifest.toml b/build/ribasim_cli/Manifest.toml index 873b83b61..5885340d8 100644 --- a/build/ribasim_cli/Manifest.toml +++ b/build/ribasim_cli/Manifest.toml @@ -979,7 +979,7 @@ uuid = "ae029012-a4dd-5104-9daa-d747884805df" version = "1.3.0" [[deps.Ribasim]] -deps = ["Arrow", "BasicModelInterface", "CodecLz4", "CodecZstd", "ComponentArrays", "Configurations", "DBInterface", "DataInterpolations", "DataStructures", "Dates", "Dictionaries", "DiffEqCallbacks", "FiniteDiff", "ForwardDiff", "Graphs", "HiGHS", "IterTools", "JuMP", "Legolas", "Logging", "LoggingExtras", "OrdinaryDiffEq", "PreallocationTools", "SQLite", "SciMLBase", "SparseArrays", "StructArrays", "Tables", "TerminalLoggers", "TimeZones", "TimerOutputs", "TranscodingStreams"] +deps = ["Arrow", "BasicModelInterface", "CodecLz4", "CodecZstd", "ComponentArrays", "Configurations", "DBInterface", "DataInterpolations", "DataStructures", "Dates", "Dictionaries", "DiffEqCallbacks", "FiniteDiff", "ForwardDiff", "Graphs", "HiGHS", "IterTools", "JuMP", "Legolas", "Logging", "LoggingExtras", "OrdinaryDiffEq", "PreallocationTools", "SQLite", "SciMLBase", "SparseArrays", "StructArrays", "Tables", "TerminalLoggers", "TimerOutputs", "TranscodingStreams"] path = "../../core" uuid = "aac5e3d9-0b8f-4d4f-8241-b1a7a9632635" version = "0.3.0" diff --git a/core/Manifest.toml b/core/Manifest.toml index 046b5db8c..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 = "734d92f362e5faf41ff9058fcbfa26406306498c" +project_hash = "c63b237aec6a6bf6314284b2b07a94b93a9f0a36" [[deps.ADTypes]] git-tree-sha1 = "5d2e21d7b0d8c22f67483ef95ebdc39c0e6b6003" @@ -1257,10 +1257,8 @@ uuid = "8290d209-cae3-49c0-8002-c8c24d57dab5" version = "0.5.2" [[deps.TimeZones]] -deps = ["Artifacts", "Dates", "Downloads", "InlineStrings", "Mocking", "Printf", "Scratch", "TZJData", "Unicode", "p7zip_jll"] -git-tree-sha1 = "6f2a9362603a79a916c54a10fc7c9a4ff2ca0848" -repo-rev = "cldr" -repo-url = "https://github.com/visr/TimeZones.jl" +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" weakdeps = ["RecipesBase"] diff --git a/core/Project.toml b/core/Project.toml index 532bd21a1..62c01fb3b 100644 --- a/core/Project.toml +++ b/core/Project.toml @@ -65,7 +65,7 @@ SciMLBase = "1.60, 2" StructArrays = "0.6.13" Tables = "1" TerminalLoggers = "0.1.7" -TimeZones = "1.13" +TimeZones = "=1.13.0" TimerOutputs = "0.5" TranscodingStreams = "0.9, 0.10" julia = "1.9"