Skip to content

Commit a1e489c

Browse files
authored
Add --skip-build flag to allow deploying prebuilt tarballs (#1275)
1 parent d972ad8 commit a1e489c

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

docs/src/building.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,3 +470,11 @@ options). If `--deploy=local` is passed, the JLL package will still be built in
470470
the `~/.julia/dev/` directory, but it will not be uploaded anywhere. This is
471471
useful for local testing and validation that the built artifacts are working
472472
with your package.
473+
474+
## Deploying local builds without recreating the tarballs
475+
Sometimes all tarballs have already been created successfully locally but not
476+
deployed to GitHub. This can happen, e.g., if it is tricky to figure out the
477+
correct build script for all platforms, or if each platform build takes a long
478+
time. In this case, it is possible to skip the build process and just deploy
479+
the JLL package by providing the `--skip-build` flag to the `build_tarballs.jl`
480+
script. Read the help (`--help`) for more information.

src/AutoBuild.jl

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ const BUILD_HELP = (
103103
so using `--register` without `--deploy` or the
104104
more specific `--deploy-jll` is an error.
105105
106+
--skip-build Skips building the platform binaries. This option
107+
is useful if, e.g., you have already built all
108+
platform binaries and now only wish to deploy the
109+
JLL package to GitHub. Note that this will error if
110+
not all tarballs for the listed platforms are
111+
present.
112+
106113
--meta-json Output a JSON representation of the given build
107114
instead of actually building. Note that this can
108115
(and often does) output multiple JSON objects for
@@ -251,6 +258,9 @@ function build_tarballs(ARGS, src_name, src_version, sources, script,
251258
error("Cannot register with a local deployment!")
252259
end
253260

261+
# This sets whether building should be skipped
262+
skip_build = check_flag!(ARGS, "--skip-build")
263+
254264
if deploy_bin || deploy_jll
255265
code_dir = joinpath(Pkg.devdir(), "$(src_name)_jll")
256266

@@ -342,6 +352,12 @@ function build_tarballs(ARGS, src_name, src_version, sources, script,
342352
end
343353

344354
build_output_meta = Dict()
355+
elseif skip_build
356+
# If they do not want to build, there is nothing we can do here
357+
build_output_meta = Dict()
358+
if verbose
359+
@info("Skipping the build process for the tarballs as requested...")
360+
end
345361
else
346362
# Build the given platforms using the given sources
347363
build_output_meta = autobuild(
@@ -368,8 +384,18 @@ function build_tarballs(ARGS, src_name, src_version, sources, script,
368384

369385
# The location the binaries will be available from
370386
bin_path = "https://github.com/$(deploy_jll_repo)/releases/download/$(tag)"
371-
build_jll_package(src_name, build_version, sources, code_dir, build_output_meta,
372-
dependencies, bin_path; verbose, julia_compat, extra_kwargs...)
387+
388+
if !skip_build
389+
# Build JLL package based on output of autobuild
390+
build_jll_package(src_name, build_version, sources, code_dir, build_output_meta,
391+
dependencies, bin_path; verbose, julia_compat, extra_kwargs...)
392+
else
393+
# Rebuild output meta data from the information we have here
394+
rebuild_jll_package(src_name, build_version, sources, platforms, products, dependencies,
395+
joinpath(pwd(), "products"), bin_path;
396+
code_dir, verbose, from_scratch=false,
397+
julia_compat, extra_kwargs...)
398+
end
373399
if deploy_jll_repo != "local"
374400
push_jll_package(src_name, build_version; code_dir=code_dir, deploy_repo=deploy_jll_repo)
375401
end

0 commit comments

Comments
 (0)