Skip to content

Commit 8ef531d

Browse files
authored
Fix versioninfo and base it on BBB function (#965)
1 parent 40098a7 commit 8ef531d

File tree

4 files changed

+33
-127
lines changed

4 files changed

+33
-127
lines changed

Manifest.toml

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ version = "0.2.0"
2727
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
2828

2929
[[BinaryBuilderBase]]
30-
deps = ["CodecZlib", "Downloads", "JSON", "LibGit2", "Libdl", "Logging", "OutputCollectors", "Pkg", "Random", "SHA", "SimpleBufferStream", "TOML", "Tar", "UUIDs", "p7zip_jll"]
31-
git-tree-sha1 = "65044aca23fe38abecefeb4c5a76f9d850a27580"
30+
deps = ["CodecZlib", "Downloads", "InteractiveUtils", "JSON", "LibGit2", "Libdl", "Logging", "OutputCollectors", "Pkg", "Random", "SHA", "SimpleBufferStream", "TOML", "Tar", "UUIDs", "p7zip_jll"]
31+
git-tree-sha1 = "5df61db5de60080b894f1e1d00460d4490e4f422"
3232
repo-rev = "master"
3333
repo-url = "https://github.com/JuliaPackaging/BinaryBuilderBase.jl.git"
3434
uuid = "7f725544-6523-48cd-82d1-3fa08ff4056e"
@@ -41,9 +41,9 @@ uuid = "944b1d66-785c-5afd-91f1-9de20f533193"
4141
version = "0.7.0"
4242

4343
[[DataAPI]]
44-
git-tree-sha1 = "176e23402d80e7743fc26c19c681bfb11246af32"
44+
git-tree-sha1 = "ad84f52c0b8f05aa20839484dbaf01690b41ff84"
4545
uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
46-
version = "1.3.0"
46+
version = "1.4.0"
4747

4848
[[DataStructures]]
4949
deps = ["InteractiveUtils", "OrderedCollections"]
@@ -70,9 +70,9 @@ uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
7070

7171
[[FileIO]]
7272
deps = ["Pkg"]
73-
git-tree-sha1 = "992b4aeb62f99b69fcf0cb2085094494cc05dfb3"
73+
git-tree-sha1 = "cad2e71389ecb2f4480e0de74faab04af13d7929"
7474
uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
75-
version = "1.4.3"
75+
version = "1.4.4"
7676

7777
[[FileWatching]]
7878
uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"
@@ -85,9 +85,9 @@ version = "0.1.6"
8585

8686
[[GitHub]]
8787
deps = ["Base64", "Dates", "HTTP", "JSON", "MbedTLS", "Sockets"]
88-
git-tree-sha1 = "07e94aa019727a2d05b73b14f1e3b8f130c8dbc8"
88+
git-tree-sha1 = "587c993cedac5707f72ce082f4f33d525e80ac40"
8989
uuid = "bc5e4493-9b4d-5f90-b8aa-2b2bcaad7a26"
90-
version = "5.1.7"
90+
version = "5.1.8"
9191

9292
[[HTTP]]
9393
deps = ["Base64", "Dates", "IniFile", "MbedTLS", "Sockets"]
@@ -123,9 +123,9 @@ uuid = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
123123
version = "0.1.14"
124124

125125
[[JLLWrappers]]
126-
git-tree-sha1 = "7cec881362e5b4e367ff0279dd99a06526d51a55"
126+
git-tree-sha1 = "c70593677bbf2c3ccab4f7500d0f4dacfff7b75c"
127127
uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
128-
version = "1.1.2"
128+
version = "1.1.3"
129129

130130
[[JSON]]
131131
deps = ["Dates", "Mmap", "Parsers", "Unicode"]
@@ -185,15 +185,15 @@ uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
185185

186186
[[MbedTLS]]
187187
deps = ["Dates", "MbedTLS_jll", "Random", "Sockets"]
188-
git-tree-sha1 = "426a6978b03a97ceb7ead77775a1da066343ec6e"
188+
git-tree-sha1 = "1c38e51c3d08ef2278062ebceade0e46cefc96fe"
189189
uuid = "739be429-bea8-5141-9913-cc70e7f3736d"
190-
version = "1.0.2"
190+
version = "1.0.3"
191191

192192
[[MbedTLS_jll]]
193-
deps = ["Libdl", "Pkg"]
194-
git-tree-sha1 = "c0b1286883cac4e2b617539de41111e0776d02e8"
193+
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
194+
git-tree-sha1 = "47e19f64fc939b86dea2b9b5e38c29c787f0d581"
195195
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
196-
version = "2.16.8+0"
196+
version = "2.24.0+1"
197197

198198
[[Mmap]]
199199
uuid = "a63ad114-7e13-5084-954f-fe012c677804"
@@ -203,9 +203,9 @@ uuid = "14a3606d-f60d-562e-9121-12d972cd8159"
203203

204204
[[Mustache]]
205205
deps = ["Printf", "Tables"]
206-
git-tree-sha1 = "26925183ee8926966a8387b437c5a5f33b6201cb"
206+
git-tree-sha1 = "f5d718790ff475b5b8ab9c1599ed105f0f24f253"
207207
uuid = "ffc61752-8dc7-55ee-8c37-f3e9cdd09e70"
208-
version = "1.0.7"
208+
version = "1.0.8"
209209

210210
[[Mux]]
211211
deps = ["AssetRegistry", "Base64", "HTTP", "Hiccup", "Lazy", "Pkg", "Sockets", "WebSockets"]
@@ -220,9 +220,9 @@ uuid = "d8793406-e978-5875-9003-1fc021f44a92"
220220
version = "0.3.6"
221221

222222
[[OrderedCollections]]
223-
git-tree-sha1 = "16c08bf5dba06609fe45e30860092d6fa41fde7b"
223+
git-tree-sha1 = "cf59cfed2e2c12e8a2ff0a4f1e9b2cd8650da6db"
224224
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
225-
version = "1.3.1"
225+
version = "1.3.2"
226226

227227
[[OutputCollectors]]
228228
git-tree-sha1 = "d86c19b7fa8ad6a4dc8ec2c726642cc6291b2941"
@@ -231,9 +231,9 @@ version = "0.1.0"
231231

232232
[[Parsers]]
233233
deps = ["Dates"]
234-
git-tree-sha1 = "6fa4202675c05ba0f8268a6ddf07606350eda3ce"
234+
git-tree-sha1 = "b417be52e8be24e916e34b3d70ec2da7bdf56a68"
235235
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
236-
version = "1.0.11"
236+
version = "1.0.12"
237237

238238
[[Pidfile]]
239239
deps = ["FileWatching", "Test"]
@@ -242,7 +242,7 @@ uuid = "fa939f87-e72e-5be4-a000-7fc836dbe307"
242242
version = "1.2.0"
243243

244244
[[Pkg]]
245-
deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "UUIDs"]
245+
deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs"]
246246
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
247247

248248
[[PkgLicenses]]
@@ -319,9 +319,9 @@ version = "1.0.0"
319319

320320
[[Tables]]
321321
deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "TableTraits", "Test"]
322-
git-tree-sha1 = "24a584cf65e2cfabdadc21694fb69d2e74c82b44"
322+
git-tree-sha1 = "5131a624173d532299d1c7eb05341c18112b21b8"
323323
uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
324-
version = "1.1.0"
324+
version = "1.2.1"
325325

326326
[[Tar]]
327327
deps = ["ArgTools", "SHA"]
@@ -375,9 +375,9 @@ version = "4.3.2+5"
375375

376376
[[Zlib_jll]]
377377
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
378-
git-tree-sha1 = "320228915c8debb12cb434c59057290f0834dbf6"
378+
git-tree-sha1 = "32085929ad61a5ed99abea288ec7242be392bb8b"
379379
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
380-
version = "1.2.11+18"
380+
version = "1.2.12+0"
381381

382382
[[ghr_jll]]
383383
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
@@ -387,6 +387,6 @@ version = "0.13.0+1"
387387

388388
[[p7zip_jll]]
389389
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
390-
git-tree-sha1 = "ee65cfa19bea645698a0224bfa216f2b1c8b559f"
390+
git-tree-sha1 = "4b909fd780b3711197e3faa806dd631bdc5af510"
391391
uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0"
392-
version = "16.2.0+3"
392+
version = "16.2.1+0"

Project.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
1010
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
1111
GitHub = "bc5e4493-9b4d-5f90-b8aa-2b2bcaad7a26"
1212
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
13-
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
1413
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
1514
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
1615
LibGit2 = "76f85450-5226-5b5a-8eaa-529ad045b433"

azure-pipelines.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ jobs:
2222
fetchDepth: 99999
2323
clean: true
2424
- bash: |
25-
$(JULIA) -e 'using InteractiveUtils; versioninfo()'
25+
set -e
26+
$(JULIA) -e 'using BinaryBuilder; BinaryBuilder.versioninfo()'
2627
$(JULIA) -e 'using Pkg; Pkg.status()'
2728
name: SystemInfo
2829

src/BinaryBuilder.jl

Lines changed: 3 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ using Libdl, LibGit2, Random, JSON
33
using BinaryBuilderBase
44
using ObjectFile
55
using GitHub
6-
import InteractiveUtils
76
using Pkg, Base.BinaryPlatforms, Pkg.Artifacts
87
using ghr_jll
98

@@ -54,102 +53,9 @@ function __init__()
5453
end
5554
end
5655

57-
function get_bb_version()
58-
# Get BinaryBuilder.jl's version and git sha
59-
version = Pkg.TOML.parsefile(joinpath(@__DIR__, "..", "Project.toml"))["version"]
60-
try
61-
# get the gitsha if we can
62-
repo = LibGit2.GitRepo(dirname(@__DIR__))
63-
gitsha = string(LibGit2.GitHash(LibGit2.GitCommit(repo, "HEAD")))
64-
return VersionNumber("$(version)-git-$(gitsha[1:10])")
65-
catch
66-
try
67-
# Settle for the treehash otherwise
68-
env = Pkg.Types.Context().env
69-
bb_uuid = Pkg.Types.UUID("12aac903-9f7c-5d81-afc2-d9565ea332ae")
70-
treehash = bytes2hex(env.manifest[bb_uuid].tree_hash.bytes)
71-
return VersionNumber("$(version)-tree-$(treehash[1:10])")
72-
catch
73-
# Something went so wrong, we can't get any of that.
74-
return VersionNumber(version)
75-
end
76-
end
77-
end
78-
79-
"""
80-
versioninfo()
81-
82-
Helper function to print out some debugging information
83-
"""
84-
function versioninfo()
85-
@info("Julia versioninfo(): ")
86-
InteractiveUtils.versioninfo()
87-
88-
@info("BinaryBuilder.jl version: $(get_bb_version())")
89-
90-
@static if Sys.isunix()
91-
@info("Kernel version: $(readchomp(`uname -r`))")
92-
end
93-
94-
# Dump if some important directories are encrypted:
95-
@static if Sys.islinux()
96-
print_enc(n, path) = begin
97-
is_encrypted, mountpoint = is_ecryptfs(path)
98-
if is_encrypted
99-
@info("$n is encrypted on mountpoint $mountpoint")
100-
else
101-
@info("$n is NOT encrypted on mountpoint $mountpoint")
102-
end
103-
end
104-
105-
print_enc("pkg dir", dirname(@__FILE__))
106-
print_enc("storage dir", storage_dir())
107-
end
108-
109-
# Dump any relevant environment variables:
110-
@info("Relevant environment variables:")
111-
env_var_suffixes = [
112-
"AUTOMATIC_APPLE",
113-
"USE_SQUASHFS",
114-
"STORAGE_DIR",
115-
"RUNNER",
116-
"ALLOW_ECRYPTFS",
117-
"USE_CCACHE",
118-
]
119-
for e in env_var_suffixes
120-
envvar = "BINARYBUILDER_$(e)"
121-
if haskey(ENV, envvar)
122-
@info(" $(envvar): \"$(ENV[envvar])\"")
123-
end
124-
end
125-
126-
# Print out the preferred runner stuff here:
127-
@info("Preferred runner: $(preferred_runner())")
128-
129-
# Try to run 'echo julia' in Linux x86_64 environment
130-
@info("Trying to run `echo hello julia` within a Linux x86_64 environment...")
131-
132-
runner = preferred_runner()(
133-
pwd();
134-
cwd="/workspace/",
135-
platform=Platform("x86_64", "linux"),
136-
verbose=true
137-
)
138-
run_interactive(runner, `/bin/bash -c "echo hello julia"`)
139-
140-
# If we use ccache, dump the ccache stats
141-
if BinaryBuilderBase.use_ccache
142-
@info("ccache stats:")
143-
runner = preferred_runner()(
144-
pwd();
145-
cwd="/workspace/",
146-
platform=Platform("x86_64", "linux"),
147-
)
148-
run_interactive(runner, `/usr/bin/ccache -s`)
149-
end
150-
return nothing
151-
end
152-
56+
get_bb_version() =
57+
BinaryBuilderBase.get_bbb_version(@__DIR__, "12aac903-9f7c-5d81-afc2-d9565ea332ae")
58+
versioninfo() = BinaryBuilderBase.versioninfo(; name=@__MODULE__, version=get_bb_version())
15359

15460
# Precompilation ahoy!
15561
# include("../deps/SnoopCompile/precompile/precompile_BinaryBuilder.jl")

0 commit comments

Comments
 (0)