From 0eb1a31f9277826a893a7a45181b870c61794dfc Mon Sep 17 00:00:00 2001 From: Morten Piibeleht Date: Thu, 30 Jul 2020 18:06:41 +1200 Subject: [PATCH 1/4] Allow specifying the dev directory --- src/AutoBuild.jl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/AutoBuild.jl b/src/AutoBuild.jl index c3e85b34f..0ffe8c596 100644 --- a/src/AutoBuild.jl +++ b/src/AutoBuild.jl @@ -143,7 +143,12 @@ function build_tarballs(ARGS, src_name, src_version, sources, script, end if deploy_bin || deploy_jll - code_dir = joinpath(Pkg.devdir(), "$(src_name)_jll") + devdir, devdir_path = extract_flag!(ARGS, "--devdir", Pkg.devdir()) + if devdir + # if set by user, it's probably a relative path we need to resolve + devdir_path = abspath(joinpath(pwd(), devdir_path)) + end + code_dir = joinpath(devdir_path, "$(src_name)_jll") # Shove them into `kwargs` so that we are conditionally passing them along kwargs = (; kwargs..., code_dir = code_dir) From 336f7f0532c975513747d32b914eace701087d5e Mon Sep 17 00:00:00 2001 From: Morten Piibeleht Date: Wed, 18 Nov 2020 19:00:23 +1300 Subject: [PATCH 2/4] Replace --devdir with --output* flags --- src/AutoBuild.jl | 49 +++++++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/src/AutoBuild.jl b/src/AutoBuild.jl index 6e071131c..1c79a8670 100644 --- a/src/AutoBuild.jl +++ b/src/AutoBuild.jl @@ -140,6 +140,22 @@ function build_tarballs(ARGS, src_name, src_version, sources, script, # Are we skipping building and just outputting JSON? meta_json, meta_json_file = extract_flag!(ARGS, "--meta-json") + # Output settings. If provided by the user, we need to resolve the relative paths. + output, output_path = extract_flag!(ARGS, "--output", pwd()) + if output + output_path = abspath(joinpath(pwd(), output_path)) + end + output_bin, output_bin_path = extract_flag!(ARGS, "--output-bin", joinpath(output_path, "products")) + if output_bin + output_bin_path = abspath(joinpath(pwd(), output_bin_path)) + end + output_jll, output_jll_path = extract_flag!(ARGS, "--output-jll", joinpath(output_path, "$(src_name)_jll")) + if output_jll + output_jll_path = abspath(joinpath(pwd(), output_jll_path)) + end + # Shove the _jll path into `kwargs` so that we are passing it along + kwargs = (; kwargs..., code_dir = output_jll_path) + # This sets whether we are going to deploy our binaries/wrapper code to GitHub releases deploy, deploy_repo = extract_flag!(ARGS, "--deploy", "JuliaBinaryWrappers/$(src_name)_jll.jl") deploy_bin, deploy_bin_repo = extract_flag!(ARGS, "--deploy-bin", "JuliaBinaryWrappers/$(src_name)_jll.jl") @@ -170,18 +186,6 @@ function build_tarballs(ARGS, src_name, src_version, sources, script, error("Cannot register with a local deployment!") end - if deploy_bin || deploy_jll - devdir, devdir_path = extract_flag!(ARGS, "--devdir", Pkg.devdir()) - if devdir - # if set by user, it's probably a relative path we need to resolve - devdir_path = abspath(joinpath(pwd(), devdir_path)) - end - code_dir = joinpath(devdir_path, "$(src_name)_jll") - - # Shove them into `kwargs` so that we are conditionally passing them along - kwargs = (; kwargs..., code_dir = code_dir) - end - # If --meta-json was passed, error out if any confusing options were passed meta_json_stream = nothing if meta_json @@ -223,7 +227,7 @@ function build_tarballs(ARGS, src_name, src_version, sources, script, # We need to make sure that the JLL repo at least exists, so that we can deploy binaries to it # even if we're not planning to register things to it today. if deploy_jll_repo != "local" - init_jll_package(src_name, code_dir, deploy_jll_repo) + init_jll_package(src_name, output_jll_path, deploy_jll_repo) end end @@ -273,6 +277,7 @@ function build_tarballs(ARGS, src_name, src_version, sources, script, pwd(), args...; + products_dir = output_bin_path, # Flags verbose=verbose, @@ -292,10 +297,10 @@ function build_tarballs(ARGS, src_name, src_version, sources, script, # The location the binaries will be available from bin_path = "https://github.com/$(deploy_jll_repo)/releases/download/$(tag)" - build_jll_package(src_name, build_version, sources, code_dir, build_output_meta, + build_jll_package(src_name, build_version, sources, output_jll_path, build_output_meta, dependencies, bin_path; verbose=verbose, extra_kwargs...) if deploy_jll_repo != "local" - push_jll_package(src_name, build_version; code_dir=code_dir, deploy_repo=deploy_jll_repo) + push_jll_package(src_name, build_version; code_dir=output_jll_path, deploy_repo=deploy_jll_repo) end if register if verbose @@ -303,7 +308,7 @@ function build_tarballs(ARGS, src_name, src_version, sources, script, end register_jll(src_name, build_version, dependencies, julia_compat; - deploy_repo=deploy_jll_repo, code_dir=code_dir) + deploy_repo=deploy_jll_repo, code_dir=output_jll_path) end end @@ -312,7 +317,7 @@ function build_tarballs(ARGS, src_name, src_version, sources, script, if verbose @info("Deploying binaries to release $(tag) on $(deploy_bin_repo) via `ghr`...") end - upload_to_github_releases(deploy_bin_repo, tag, joinpath(pwd(), "products"); verbose=verbose) + upload_to_github_releases(deploy_bin_repo, tag, output_bin_path; verbose=verbose) end return build_output_meta @@ -585,6 +590,8 @@ here are the relevant actors, broken down in brief: * `code_dir`: sets where autogenerated JLL packages will be put. +* `products_dir`: sets the directory where generated tarballs get put. + * `require_license` enables a special audit pass that requires licenses to be installed by all packages. """ @@ -602,6 +609,7 @@ function autobuild(dir::AbstractString, ignore_audit_errors::Bool = true, autofix::Bool = true, code_dir::Union{String,Nothing} = nothing, + products_dir::String = joinpath(dir, "products"), require_license::Bool = true, kwargs...) @nospecialize @@ -638,9 +646,8 @@ function autobuild(dir::AbstractString, # We must prepare our sources. Download them, hash them, etc... source_files = download_source.(sources; verbose=verbose) - # Our build products will go into ./products - out_path = joinpath(dir, "products") - try mkpath(out_path) catch; end + # Our build products will go into products_dir (usually ./products) + try mkpath(products_dir) catch; end for platform in sort(collect(platforms), by = triplet) # We build in a platform-specific directory @@ -806,7 +813,7 @@ function autobuild(dir::AbstractString, # Once we're built up, go ahead and package this dest_prefix out tarball_path, tarball_hash, git_hash = package( dest_prefix, - joinpath(out_path, src_name), + joinpath(products_dir, src_name), src_version; platform=platform, verbose=verbose, From ef80f1e753bdb9fb21cf7e2892c37e74701a9073 Mon Sep 17 00:00:00 2001 From: Morten Piibeleht Date: Wed, 18 Nov 2020 19:27:29 +1300 Subject: [PATCH 3/4] Make sure we pass --output to autobuild() --- src/AutoBuild.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AutoBuild.jl b/src/AutoBuild.jl index 1c79a8670..0dd6be70c 100644 --- a/src/AutoBuild.jl +++ b/src/AutoBuild.jl @@ -274,7 +274,7 @@ function build_tarballs(ARGS, src_name, src_version, sources, script, # Build the given platforms using the given sources build_output_meta = autobuild( # Controls output product placement, mount directory placement, etc... - pwd(), + output_path, args...; products_dir = output_bin_path, From 620d9dbf41dd04611c9ac1d1e5ddbea92f90e82f Mon Sep 17 00:00:00 2001 From: Morten Piibeleht Date: Wed, 18 Nov 2020 19:27:57 +1300 Subject: [PATCH 4/4] Restore old default behavior where _jlls get written into ~/.julia/dev --- src/AutoBuild.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/AutoBuild.jl b/src/AutoBuild.jl index 0dd6be70c..07ae39ae1 100644 --- a/src/AutoBuild.jl +++ b/src/AutoBuild.jl @@ -149,7 +149,8 @@ function build_tarballs(ARGS, src_name, src_version, sources, script, if output_bin output_bin_path = abspath(joinpath(pwd(), output_bin_path)) end - output_jll, output_jll_path = extract_flag!(ARGS, "--output-jll", joinpath(output_path, "$(src_name)_jll")) + # TODO: change the default of output_jll_path to joinpath(output_path, "$(src_name)_jll") + output_jll, output_jll_path = extract_flag!(ARGS, "--output-jll", joinpath(Pkg.devdir(), "$(src_name)_jll")) if output_jll output_jll_path = abspath(joinpath(pwd(), output_jll_path)) end