From ddec34a19c8e96996bfff94e16b9525876b84162 Mon Sep 17 00:00:00 2001 From: Stefan Karpinski Date: Mon, 27 Apr 2020 15:30:03 -0400 Subject: [PATCH 1/3] update dependencies --- Manifest.toml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/Manifest.toml b/Manifest.toml index 1a6f155..50b2cf0 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -3,12 +3,6 @@ [[Base64]] uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" -[[BinaryProvider]] -deps = ["Libdl", "SHA"] -git-tree-sha1 = "5b08ed6036d9d3f0ee6369410b830f8873d4024c" -uuid = "b99e7846-7c00-51b0-8f62-c81ae34c0232" -version = "0.5.8" - [[Dates]] deps = ["Printf"] uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" @@ -19,9 +13,9 @@ uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" [[HTTP]] deps = ["Base64", "Dates", "IniFile", "MbedTLS", "Sockets"] -git-tree-sha1 = "5c49dab19938b119fe204fd7d7e8e174f4e9c68b" +git-tree-sha1 = "fe31f4ff144392ad8176f5c7c03cca6ba320271c" uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" -version = "0.8.8" +version = "0.8.14" [[IniFile]] deps = ["Test"] @@ -34,6 +28,7 @@ deps = ["Markdown"] uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" [[LibGit2]] +deps = ["Printf"] uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" [[Libdl]] @@ -47,10 +42,16 @@ deps = ["Base64"] uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" [[MbedTLS]] -deps = ["BinaryProvider", "Dates", "Libdl", "Random", "Sockets"] -git-tree-sha1 = "85f5947b53c8cfd53ccfa3f4abae31faa22c2181" +deps = ["Dates", "MbedTLS_jll", "Random", "Sockets"] +git-tree-sha1 = "426a6978b03a97ceb7ead77775a1da066343ec6e" uuid = "739be429-bea8-5141-9913-cc70e7f3736d" -version = "0.7.0" +version = "1.0.2" + +[[MbedTLS_jll]] +deps = ["Libdl", "Pkg"] +git-tree-sha1 = "c83f5a1d038f034ad0549f9ee4d5fac3fb429e33" +uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" +version = "2.16.0+2" [[Pkg]] deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"] From fd2dbfaf2a1f831795afc7b92fcdd3acb8cc1ac9 Mon Sep 17 00:00:00 2001 From: Stefan Karpinski Date: Mon, 27 Apr 2020 15:31:28 -0400 Subject: [PATCH 2/3] don't Pkg.update() which updates all dependencies --- bin/gen_static.jl | 3 --- 1 file changed, 3 deletions(-) diff --git a/bin/gen_static.jl b/bin/gen_static.jl index a6dcda9..b059dbe 100755 --- a/bin/gen_static.jl +++ b/bin/gen_static.jl @@ -11,9 +11,6 @@ import Pkg.TOML import Pkg.Artifacts: download_artifact, artifact_path import LibGit2 -# TODO: ensure all registries are git clones -Pkg.update() - mkpath(clones_dir) mkpath(static_dir) From 77f2105980f5e0981095d8bb564a8b8bc3b9693e Mon Sep 17 00:00:00 2001 From: Stefan Karpinski Date: Mon, 27 Apr 2020 15:45:43 -0400 Subject: [PATCH 3/3] use Tar.jl to create and extract tarballs --- Manifest.toml | 5 +++++ Project.toml | 1 + bin/gen_static.jl | 38 +++++++------------------------------- 3 files changed, 13 insertions(+), 31 deletions(-) diff --git a/Manifest.toml b/Manifest.toml index 50b2cf0..4ddb984 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -78,6 +78,11 @@ uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" [[Sockets]] uuid = "6462fe0b-24de-5631-8697-dd941f90decc" +[[Tar]] +git-tree-sha1 = "eaee2dba5f1f91c17e8a80d13303b1f236fea2f3" +uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" +version = "1.3.0" + [[Test]] deps = ["Distributed", "InteractiveUtils", "Logging", "Random"] uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/Project.toml b/Project.toml index f2a2927..3772cc2 100644 --- a/Project.toml +++ b/Project.toml @@ -8,6 +8,7 @@ HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" LibGit2 = "76f85450-5226-5b5a-8eaa-529ad045b433" Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" +Tar = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" [compat] HTTP = "0.8" diff --git a/bin/gen_static.jl b/bin/gen_static.jl index b059dbe..3da044d 100755 --- a/bin/gen_static.jl +++ b/bin/gen_static.jl @@ -10,23 +10,11 @@ import Pkg import Pkg.TOML import Pkg.Artifacts: download_artifact, artifact_path import LibGit2 +import Tar mkpath(clones_dir) mkpath(static_dir) -const tar_opts = ``` - --format=posix - --numeric-owner - --owner=0 - --group=0 - --mode=go-w,+X - --mtime=1970-01-01 - --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime,delete=mtime - --no-recursion -``` -# reproducible tarball options based on -# http://h2.jaguarpaw.co.uk/posts/reproducible-tar/ - const compress = `gzip -9` const decompress = `gzcat` @@ -40,25 +28,11 @@ function make_tarball( tarball::AbstractString, tree_path::AbstractString, ) - paths = String[] - for (root, dirs, files) in walkdir(tree_path) - path = root != tree_path ? relpath(root, tree_path) : "" - for file in [dirs; files] - push!(paths, joinpath(path, file)) - end - end - sort!(paths) - mktemp() do paths_file, io - for path in paths - print(io, "$path\0") - end - close(io) - open(tarball, write=true) do io - tar_cmd = `gtar $tar_opts -cf - -C $tree_path --null -T $paths_file` - run(pipeline(tar_cmd, compress, io)) + open(tarball, write=true) do io + open(pipeline(compress, io), write=true) do io + Tar.create(tree_path, io) end end - return end function create_git_tarball( @@ -91,7 +65,9 @@ function verify_tarball_hash( ) local hash mktempdir() do tmp_dir - run(pipeline(`$decompress $tarball`, `tar -C $tmp_dir -x`)) + open(pipeline(tarball, decompress)) do io + Tar.extract(io, tmp_dir) + end hash = bytes2hex(Pkg.GitTools.tree_hash(tmp_dir)) chmod(tmp_dir, 0o777, recursive=true) end