diff --git a/previews/PR1310/reference/index.html b/previews/PR1310/reference/index.html index 58e9e4303..222ef5315 100644 --- a/previews/PR1310/reference/index.html +++ b/previews/PR1310/reference/index.html @@ -4,7 +4,7 @@ dont_dlopen=false, dlopen_flags=Symbol[])

Declares a LibraryProduct that points to a library located within the prefix. libname specifies the basename of the library, varname is the name of the variable in the JLL package that can be used to call into the library. By default, the library is searched in the libdir, but you can add other directories within the prefix to the dir_paths argument. You can specify the flags to pass to dlopen as a vector of Symbols with the dlopen_flags keyword argument. If the library should not be dlopen'ed automatically by the JLL package, set dont_dlopen=true.

For example, if the libname is libnettle, this would be satisfied by the following paths:

Libraries matching the search pattern are rejected if they are not dlopen()'able.

If you are unsure what value to use for libname, you can use Base.BinaryPlatforms.parse_dl_name_version:

julia> using Base.BinaryPlatforms
 
 julia> parse_dl_name_version("sfml-audio-2.dll", "windows")[1]
-"sfml-audio"

If the library would have different basenames on different operating systems (e.g., libz.so on Linux and FreeBSD, libz.dylib on macOS, and zlib.dll on Windows), libname can be also a vector of Strings with the different alternatives:

LibraryProduct(["libz", "zlib"], :libz)
BinaryBuilderBase.ProductType

A Product is an expected result after building or installation of a package.

Examples of Products include LibraryProduct, FrameworkProduct, ExecutableProduct and FileProduct. All Product types must define the following minimum set of functionality:

  • locate(::Product): given a Product, locate it within the wrapped Prefix returning its location as a string

  • satisfied(::Product): given a Product, determine whether it has been successfully satisfied (e.g. it is locateable and it passes all callbacks)

  • variable_name(::Product): return the variable name assigned to a Product

  • repr(::Product): Return a representation of this Product, useful for auto-generating source code that constructs Products, if that's your thing.

BinaryBuilderBase.RuntimeDependencyType
RuntimeDependency(dep::Union{PackageSpec,String}; compat::String, platforms::Vector{<:AbstractPlatform}, top_level::Bool=false)

Define a binary dependency that is only listed as dependency of the generated JLL package, but its artifact is not installed in the prefix during the build. The dep argument can be either a string with the name of the JLL package or a Pkg.PackageSpec.

The optional keyword argument compat can be used to specify a string for use in the Project.toml of the generated Julia package.

The optional keyword argument platforms is a vector of AbstractPlatforms which indicates for which platforms the dependency should be used. By default platforms=[AnyPlatform()], to mean that the dependency is compatible with all platforms.

The optional keyword argument top_level specifies whether the dependency should be use only at the top-level of the generated JLL package, instead of inside each platform-specific wrapper. Using top_level=true is useful for packages needed for platform augmentation (e.g. MPIPreferences.jl).

BinaryBuilderBase.UserNSRunnerType
UserNSRunner

A UserNSRunner represents an "execution context", an object that bundles all necessary information to run commands within the container that contains our crossbuild environment. Use run() to actually run commands within the UserNSRunner, and runshell() as a quick way to get an interactive shell within the crossbuild environment.

BinaryBuilder.Wizard.WizardStateType
WizardState

Building large dependencies can take a lot of time. This state object captures all relevant state of this function. It can be passed back to the function to resume where we left off. This can aid debugging when code changes are necessary. It also holds all necessary metadata such as input/output streams.

source

Functions

BinaryBuilderBase.abi_agnosticMethod
abi_agnostic(p::AbstractPlatform)

Strip out any tags that are not the basic annotations like libc and call_abi.

BinaryBuilderBase.accept_apple_sdkMethod
accept_apple_sdk(ins::IO, outs::IO) -> Bool

Ask the user whether they accept the terms of the macOS SDK, and return a boolean with their choice. Write messages to outs, read input from ins.

BinaryBuilderBase.artifact_nameMethod
artifact_name(cs::CompilerShard)

Return the bound artifact name for a particular shard.

BinaryBuilderBase.bindirMethod
bindir(prefix::Prefix)

Returns the binary directory for the given prefix.

BinaryBuilderBase.choose_shardsMethod
choose_shards(p::AbstractPlatform; rootfs_build, ps_build, GCC_builds,
+"sfml-audio"

If the library would have different basenames on different operating systems (e.g., libz.so on Linux and FreeBSD, libz.dylib on macOS, and zlib.dll on Windows), libname can be also a vector of Strings with the different alternatives:

LibraryProduct(["libz", "zlib"], :libz)
BinaryBuilderBase.ProductType

A Product is an expected result after building or installation of a package.

Examples of Products include LibraryProduct, FrameworkProduct, ExecutableProduct and FileProduct. All Product types must define the following minimum set of functionality:

  • locate(::Product): given a Product, locate it within the wrapped Prefix returning its location as a string

  • satisfied(::Product): given a Product, determine whether it has been successfully satisfied (e.g. it is locateable and it passes all callbacks)

  • variable_name(::Product): return the variable name assigned to a Product

  • repr(::Product): Return a representation of this Product, useful for auto-generating source code that constructs Products, if that's your thing.

BinaryBuilderBase.RuntimeDependencyType
RuntimeDependency(dep::Union{PackageSpec,String}; compat::String, platforms::Vector{<:AbstractPlatform}, top_level::Bool=false)

Define a binary dependency that is only listed as dependency of the generated JLL package, but its artifact is not installed in the prefix during the build. The dep argument can be either a string with the name of the JLL package or a Pkg.PackageSpec.

The optional keyword argument compat can be used to specify a string for use in the Project.toml of the generated Julia package.

The optional keyword argument platforms is a vector of AbstractPlatforms which indicates for which platforms the dependency should be used. By default platforms=[AnyPlatform()], to mean that the dependency is compatible with all platforms.

The optional keyword argument top_level specifies whether the dependency should be use only at the top-level of the generated JLL package, instead of inside each platform-specific wrapper. Using top_level=true is useful for packages needed for platform augmentation (e.g. MPIPreferences.jl).

BinaryBuilderBase.UserNSRunnerType
UserNSRunner

A UserNSRunner represents an "execution context", an object that bundles all necessary information to run commands within the container that contains our crossbuild environment. Use run() to actually run commands within the UserNSRunner, and runshell() as a quick way to get an interactive shell within the crossbuild environment.

BinaryBuilder.Wizard.WizardStateType
WizardState

Building large dependencies can take a lot of time. This state object captures all relevant state of this function. It can be passed back to the function to resume where we left off. This can aid debugging when code changes are necessary. It also holds all necessary metadata such as input/output streams.

source

Functions

BinaryBuilderBase.abi_agnosticMethod
abi_agnostic(p::AbstractPlatform)

Strip out any tags that are not the basic annotations like libc and call_abi.

BinaryBuilderBase.accept_apple_sdkMethod
accept_apple_sdk(ins::IO, outs::IO) -> Bool

Ask the user whether they accept the terms of the macOS SDK, and return a boolean with their choice. Write messages to outs, read input from ins.

BinaryBuilderBase.artifact_nameMethod
artifact_name(cs::CompilerShard)

Return the bound artifact name for a particular shard.

BinaryBuilderBase.bindirMethod
bindir(prefix::Prefix)

Returns the binary directory for the given prefix.

BinaryBuilderBase.choose_shardsMethod
choose_shards(p::AbstractPlatform; rootfs_build, ps_build, GCC_builds,
                            LLVM_builds, archive_type)

This method chooses, given a Platform, which shards to download, extract and mount, returning a list of CompilerShard objects. At the moment, this always consists of four shards, but that may not always be the case.

BinaryBuilderBase.chown_cleanupMethod
chown_cleanup(dr::DockerRunner)

On Linux, the user id inside of the docker container doesn't correspond to ours on the outside, so permissions get all kinds of screwed up. To fix this, we have to chown -R $(id -u):$(id -g) $prefix, which really sucks, but is still better than nothing. This is why we prefer the UserNSRunner on Linux.

BinaryBuilderBase.collect_jll_uuidsMethod
collect_jll_uuids(manifest::Pkg.Types.Manifest, dependencies::Set{Base.UUID})

Return a Set of all JLL packages in the manifest with dependencies being the list of direct dependencies of the environment.

BinaryBuilderBase.compress_dirMethod
compress_dir(dir::AbstractString;
              compressor_stream = GzipCompressorStream,
              level::Int = 9,
@@ -125,7 +125,7 @@
           skip_audit = false, ignore_audit_errors = true,
           autofix = true, code_dir = nothing,
           meta_json_file = nothing, require_license = true,
-          dont_dlopen = false, kwargs...)

Runs the boiler plate code to download, build, and package a source package for a list of platforms. This method takes a veritable truckload of arguments, here are the relevant actors, broken down in brief:

  • dir: the root of the build; products will be placed within dir/products, and mountpoints will be placed within dir/build/.

  • src_name: the name of the source package being built and will set the name of the built tarballs.

  • src_version: the version of the source package.

  • platforms: a list of platforms to build for.

  • sources: a vector of all sources to download and unpack before building begins, as AbstractSources.

  • script: a string representing a shell script to run as the build.

  • products: the list of Products which shall be built.

  • dependencies: a vector of JLL dependency packages as AbstractDependency that should be installed before building begins.

  • verbose: Enable verbose mode. What did you expect?

  • debug: cause a failed build to drop into an interactive shell so that the build can be inspected easily.

  • skip_audit: disable the typical audit that occurs at the end of a build.

  • ignore_audit_errors: do not kill a build even if a problem is found.

  • autofix: give BinaryBuilder permission to automatically fix issues it finds during audit passes. Highly recommended.

  • code_dir: sets where autogenerated JLL packages will be put.

  • require_license enables a special audit pass that requires licenses to be installed by all packages.

  • dont_dlopen: don't try to dlopen library products. This is separate from specifying dont_dlopen on a LibraryProduct in that it still results in the generated JLL loading the library at run time, and only prevents BinaryBuilder from doing so during JLL generation.

source
BinaryBuilder.get_compilers_versionsMethod
get_compilers_versions(; compilers = [:c])

Return the script string that is used to print the versions of the given compilers.

source
Base.BinaryPlatforms.detect_cxxstring_abiMethod
detect_cxxstring_abi(oh::ObjectHandle, platform::AbstractPlatform)

Given an ObjectFile, examine its symbols to discover which (if any) C++11 std::string ABI it's using. We do this by scanning the list of exported symbols, triggering off of instances of St7__cxx11 or _ZNSs to give evidence toward a constraint on cxx11, cxx03 or neither.

source
Base.BinaryPlatforms.detect_libstdcxx_versionMethod
detect_libstdcxx_version(oh::ObjectHandle, platform::AbstractPlatform)

Given an ObjectFile, examine its dynamic linkage to discover which (if any) libgfortran it's linked against. The major SOVERSION will determine which GCC version we're restricted to.

source
BinaryBuilder.Auditor.analyze_instruction_setMethod
analyze_instruction_set(oh::ObjectHandle, platform::AbstractPlatform; verbose::Bool = false)

Analyze the instructions within the binary located at the given path for which minimum instruction set it requires, taking note of groups of instruction sets used such as avx, sse4.2, i486, etc....

Some binary files (such as libopenblas) contain multiple versions of functions, internally determining which version to call by using the cpuid instruction to determine processor support. In an effort to detect this, we make note of any usage of the cpuid instruction, disabling our minimum instruction set calculations if such an instruction is found, and notifying the user of this if verbose is set to true.

Note that this function only really makes sense for x86/x64 binaries. Don't run this on armv7l, aarch64, ppc64le etc... binaries and expect it to work.

source
BinaryBuilder.Auditor.auditFunction
audit(prefix::Prefix, src_name::AbstractString = "";
+          dont_dlopen = false, kwargs...)

Runs the boiler plate code to download, build, and package a source package for a list of platforms. This method takes a veritable truckload of arguments, here are the relevant actors, broken down in brief:

  • dir: the root of the build; products will be placed within dir/products, and mountpoints will be placed within dir/build/.

  • src_name: the name of the source package being built and will set the name of the built tarballs.

  • src_version: the version of the source package.

  • platforms: a list of platforms to build for.

  • sources: a vector of all sources to download and unpack before building begins, as AbstractSources.

  • script: a string representing a shell script to run as the build.

  • products: the list of Products which shall be built.

  • dependencies: a vector of JLL dependency packages as AbstractDependency that should be installed before building begins.

  • verbose: Enable verbose mode. What did you expect?

  • debug: cause a failed build to drop into an interactive shell so that the build can be inspected easily.

  • skip_audit: disable the typical audit that occurs at the end of a build.

  • ignore_audit_errors: do not kill a build even if a problem is found.

  • autofix: give BinaryBuilder permission to automatically fix issues it finds during audit passes. Highly recommended.

  • code_dir: sets where autogenerated JLL packages will be put.

  • require_license enables a special audit pass that requires licenses to be installed by all packages.

  • dont_dlopen: don't try to dlopen library products. This is separate from specifying dont_dlopen on a LibraryProduct in that it still results in the generated JLL loading the library at run time, and only prevents BinaryBuilder from doing so during JLL generation.

source
BinaryBuilder.get_compilers_versionsMethod
get_compilers_versions(; compilers = [:c])

Return the script string that is used to print the versions of the given compilers.

source
Base.BinaryPlatforms.detect_cxxstring_abiMethod
detect_cxxstring_abi(oh::ObjectHandle, platform::AbstractPlatform)

Given an ObjectFile, examine its symbols to discover which (if any) C++11 std::string ABI it's using. We do this by scanning the list of exported symbols, triggering off of instances of St7__cxx11 or _ZNSs to give evidence toward a constraint on cxx11, cxx03 or neither.

source
Base.BinaryPlatforms.detect_libstdcxx_versionMethod
detect_libstdcxx_version(oh::ObjectHandle, platform::AbstractPlatform)

Given an ObjectFile, examine its dynamic linkage to discover which (if any) libgfortran it's linked against. The major SOVERSION will determine which GCC version we're restricted to.

source
BinaryBuilder.Auditor.analyze_instruction_setMethod
analyze_instruction_set(oh::ObjectHandle, platform::AbstractPlatform; verbose::Bool = false)

Analyze the instructions within the binary located at the given path for which minimum instruction set it requires, taking note of groups of instruction sets used such as avx, sse4.2, i486, etc....

Some binary files (such as libopenblas) contain multiple versions of functions, internally determining which version to call by using the cpuid instruction to determine processor support. In an effort to detect this, we make note of any usage of the cpuid instruction, disabling our minimum instruction set calculations if such an instruction is found, and notifying the user of this if verbose is set to true.

Note that this function only really makes sense for x86/x64 binaries. Don't run this on armv7l, aarch64, ppc64le etc... binaries and expect it to work.

source
BinaryBuilder.Auditor.auditFunction
audit(prefix::Prefix, src_name::AbstractString = "";
                       io=stderr,
                       platform::AbstractPlatform = HostPlatform(),
                       verbose::Bool = false,
@@ -133,17 +133,17 @@
                       autofix::Bool = false,
                       has_csl::Bool = true,
                       require_license::Bool = true,
-      )

Audits a prefix to attempt to find deployability issues with the binary objects that have been installed within. This auditing will check for relocatability issues such as dependencies on libraries outside of the current prefix, usage of advanced instruction sets such as AVX2 that may not be usable on many platforms, linkage against newer glibc symbols, etc...

This method is still a work in progress, only some of the above list is actually implemented, be sure to actually inspect Auditor.jl to see what is and is not currently in the realm of fantasy.

source
BinaryBuilder.Auditor.check_licenseFunction
check_license(prefix, src_name; verbose::Bool = false,, silent::Bool = false)

Check that there are license files for the project called src_name in the prefix.

source
BinaryBuilder.Auditor.collapse_symlinksMethod
collapse_symlinks(files::Vector{String})

Given a list of files, prune those that are symlinks pointing to other files within the list.

source
BinaryBuilder.Auditor.collect_filesFunction
collect_files(path::AbstractString, predicate::Function = f -> true)

Find all files that satisfy predicate() when the full path to that file is passed in, returning the list of file paths.

source
BinaryBuilder.Auditor.compatible_marchsMethod
compatible_marchs(p::AbstractPlatform)

Return a (sorted) list of compatible microarchitectures, starting from the most compatible to the most highly specialized. If no microarchitecture is specified within p, returns the most generic microarchitecture possible for the given architecture.

source
BinaryBuilder.Auditor.detect_libgfortran_versionMethod
detect_libgfortran_version(oh::ObjectHandle, platform::AbstractPlatform)

Given an ObjectFile, examine its dynamic linkage to discover which (if any) libgfortran it's linked against. The major SOVERSION will determine which GCC version we're restricted to.

source
BinaryBuilder.Auditor.instruction_mnemonicsMethod
instruction_mnemonics(path::AbstractString, platform::AbstractPlatform)

Dump a binary object with objdump, returning a list of instruction mnemonics for further analysis with analyze_instruction_set().

Note that this function only really makes sense for x86/x64 binaries. Don't run this on armv7l, aarch64, ppc64le etc... binaries and expect it to work.

This function returns the list of mnemonics as well as the counts of each, binned by the mapping defined within instruction_categories.

source
BinaryBuilder.Auditor.is_for_platformMethod
is_for_platform(h::ObjectHandle, platform::AbstractPlatform)

Returns true if the given ObjectHandle refers to an object of the given platform; E.g. if the given platform is for AArch64 Linux, then h must be an ELFHandle with h.header.e_machine set to ELF.EM_AARCH64.

In particular, this method and platform_for_object() both exist because the latter is not smart enough to deal with :glibc and :musl yet.

source
BinaryBuilder.Auditor.is_troublesome_library_linkMethod
is_troublesome_library_link(libname::AbstractString, platform::AbstractPlatform)

Return true if depending on libname is known to cause problems at runtime, false otherwise.

source
BinaryBuilder.Auditor.minimum_marchMethod
minimum_march(counts::Dict, p::AbstractPlatform)

This function returns the minimum instruction set required, depending on whether the object file being pointed to is a 32-bit or 64-bit one:

  • For 32-bit object files, this returns one of ["i686", "prescott"]

  • For 64-bit object files, this returns one of ["x86_64", "avx", "avx2", "avx512"]

source
BinaryBuilder.Auditor.platform_for_objectMethod
platform_for_object(oh::ObjectHandle)

Returns the platform the given ObjectHandle should run on. E.g. if the given ObjectHandle is an x86_64 Linux ELF object, this function will return Platform("x86_64", "linux"). This function does not yet distinguish between different libc's such as :glibc and :musl.

source
BinaryBuilder.Auditor.symlink_soname_libMethod
symlink_soname_lib(path::AbstractString)

We require that all shared libraries are accessible on disk through their SONAME (if it exists). While this is almost always true in practice, it doesn't hurt to make doubly sure.

source
BinaryBuilder.Auditor.translate_symlinksMethod
translate_symlinks(root::AbstractString; verbose::Bool=false)

Walks through the root directory given within root, finding all symlinks that point to an absolute path within root, and rewriting them to be a relative symlink instead, increasing relocatability.

source
BinaryBuilder.Auditor.update_linkageMethod
update_linkage(prefix::Prefix, platform::AbstractPlatform, path::AbstractString,
-               old_libpath, new_libpath; verbose::Bool = false)

Given a binary object located at path within prefix, update its dynamic linkage to point to new_libpath instead of old_libpath. This is done using a tool within the cross-compilation environment such as install_name_tool on MacOS or patchelf on Linux. Windows platforms are completely skipped, as they do not encode paths or RPaths within their executables.

source
BinaryBuilder.Auditor.warn_deadlinksMethod
warn_deadlinks(root::AbstractString)

Walks through the given root directory, finding broken symlinks and warning the user about them. This is used to catch instances such as a build recipe copying a symlink that points to a dependency; by doing so, it implicitly breaks relocatability.

source
BinaryBuilder.Wizard.canonicalize_file_urlMethod

Canonicalize URL to a file within a GitHub repo

source
BinaryBuilder.Wizard.canonicalize_source_urlMethod

Canonicalize a GitHub repository URL

source
BinaryBuilder.Wizard.change_script!Method
Change the script. This will invalidate all platforms to make sure we later
-verify that they still build with the new script.
source
BinaryBuilder.Wizard.download_sourceMethod
download_source(state::WizardState)

Ask the user where the source code is coming from, then download and record the relevant parameters, returning the source url, the local path it is stored at after download, and a hash identifying the version of the code. In the case of a git source URL, the hash will be a git treeish identifying the exact commit used to build the code, in the case of a tarball, it is the sha256 hash of the tarball itself.

source
BinaryBuilder.Wizard.edit_scriptMethod
edit_script(state::WizardState, script::AbstractString)

For consistency (and security), use the sandbox for editing a script, launching vi within an interactive session to edit a buildscript.

source
BinaryBuilder.Wizard.filter_object_filesMethod
filter_object_files(files)

Given a list of files, filter out any that cannot be opened by readmeta() from ObjectFile.

source
BinaryBuilder.Wizard.interactive_buildMethod
interactive_build(state::WizardState, prefix::Prefix,
+      )

Audits a prefix to attempt to find deployability issues with the binary objects that have been installed within. This auditing will check for relocatability issues such as dependencies on libraries outside of the current prefix, usage of advanced instruction sets such as AVX2 that may not be usable on many platforms, linkage against newer glibc symbols, etc...

This method is still a work in progress, only some of the above list is actually implemented, be sure to actually inspect Auditor.jl to see what is and is not currently in the realm of fantasy.

source
BinaryBuilder.Auditor.check_licenseFunction
check_license(prefix, src_name; verbose::Bool = false,, silent::Bool = false)

Check that there are license files for the project called src_name in the prefix.

source
BinaryBuilder.Auditor.collapse_symlinksMethod
collapse_symlinks(files::Vector{String})

Given a list of files, prune those that are symlinks pointing to other files within the list.

source
BinaryBuilder.Auditor.collect_filesFunction
collect_files(path::AbstractString, predicate::Function = f -> true)

Find all files that satisfy predicate() when the full path to that file is passed in, returning the list of file paths.

source
BinaryBuilder.Auditor.compatible_marchsMethod
compatible_marchs(p::AbstractPlatform)

Return a (sorted) list of compatible microarchitectures, starting from the most compatible to the most highly specialized. If no microarchitecture is specified within p, returns the most generic microarchitecture possible for the given architecture.

source
BinaryBuilder.Auditor.detect_libgfortran_versionMethod
detect_libgfortran_version(oh::ObjectHandle, platform::AbstractPlatform)

Given an ObjectFile, examine its dynamic linkage to discover which (if any) libgfortran it's linked against. The major SOVERSION will determine which GCC version we're restricted to.

source
BinaryBuilder.Auditor.instruction_mnemonicsMethod
instruction_mnemonics(path::AbstractString, platform::AbstractPlatform)

Dump a binary object with objdump, returning a list of instruction mnemonics for further analysis with analyze_instruction_set().

Note that this function only really makes sense for x86/x64 binaries. Don't run this on armv7l, aarch64, ppc64le etc... binaries and expect it to work.

This function returns the list of mnemonics as well as the counts of each, binned by the mapping defined within instruction_categories.

source
BinaryBuilder.Auditor.is_for_platformMethod
is_for_platform(h::ObjectHandle, platform::AbstractPlatform)

Returns true if the given ObjectHandle refers to an object of the given platform; E.g. if the given platform is for AArch64 Linux, then h must be an ELFHandle with h.header.e_machine set to ELF.EM_AARCH64.

In particular, this method and platform_for_object() both exist because the latter is not smart enough to deal with :glibc and :musl yet.

source
BinaryBuilder.Auditor.is_troublesome_library_linkMethod
is_troublesome_library_link(libname::AbstractString, platform::AbstractPlatform)

Return true if depending on libname is known to cause problems at runtime, false otherwise.

source
BinaryBuilder.Auditor.minimum_marchMethod
minimum_march(counts::Dict, p::AbstractPlatform)

This function returns the minimum instruction set required, depending on whether the object file being pointed to is a 32-bit or 64-bit one:

  • For 32-bit object files, this returns one of ["i686", "prescott"]

  • For 64-bit object files, this returns one of ["x86_64", "avx", "avx2", "avx512"]

source
BinaryBuilder.Auditor.platform_for_objectMethod
platform_for_object(oh::ObjectHandle)

Returns the platform the given ObjectHandle should run on. E.g. if the given ObjectHandle is an x86_64 Linux ELF object, this function will return Platform("x86_64", "linux"). This function does not yet distinguish between different libc's such as :glibc and :musl.

source
BinaryBuilder.Auditor.symlink_soname_libMethod
symlink_soname_lib(path::AbstractString)

We require that all shared libraries are accessible on disk through their SONAME (if it exists). While this is almost always true in practice, it doesn't hurt to make doubly sure.

source
BinaryBuilder.Auditor.translate_symlinksMethod
translate_symlinks(root::AbstractString; verbose::Bool=false)

Walks through the root directory given within root, finding all symlinks that point to an absolute path within root, and rewriting them to be a relative symlink instead, increasing relocatability.

source
BinaryBuilder.Auditor.update_linkageMethod
update_linkage(prefix::Prefix, platform::AbstractPlatform, path::AbstractString,
+               old_libpath, new_libpath; verbose::Bool = false)

Given a binary object located at path within prefix, update its dynamic linkage to point to new_libpath instead of old_libpath. This is done using a tool within the cross-compilation environment such as install_name_tool on MacOS or patchelf on Linux. Windows platforms are completely skipped, as they do not encode paths or RPaths within their executables.

source
BinaryBuilder.Auditor.warn_deadlinksMethod
warn_deadlinks(root::AbstractString)

Walks through the given root directory, finding broken symlinks and warning the user about them. This is used to catch instances such as a build recipe copying a symlink that points to a dependency; by doing so, it implicitly breaks relocatability.

source
BinaryBuilder.Wizard.canonicalize_file_urlMethod

Canonicalize URL to a file within a GitHub repo

source
BinaryBuilder.Wizard.canonicalize_source_urlMethod

Canonicalize a GitHub repository URL

source
BinaryBuilder.Wizard.change_script!Method
Change the script. This will invalidate all platforms to make sure we later
+verify that they still build with the new script.
source
BinaryBuilder.Wizard.download_sourceMethod
download_source(state::WizardState)

Ask the user where the source code is coming from, then download and record the relevant parameters, returning the source url, the local path it is stored at after download, and a hash identifying the version of the code. In the case of a git source URL, the hash will be a git treeish identifying the exact commit used to build the code, in the case of a tarball, it is the sha256 hash of the tarball itself.

source
BinaryBuilder.Wizard.edit_scriptMethod
edit_script(state::WizardState, script::AbstractString)

For consistency (and security), use the sandbox for editing a script, launching vi within an interactive session to edit a buildscript.

source
BinaryBuilder.Wizard.filter_object_filesMethod
filter_object_files(files)

Given a list of files, filter out any that cannot be opened by readmeta() from ObjectFile.

source
BinaryBuilder.Wizard.interactive_buildMethod
interactive_build(state::WizardState, prefix::Prefix,
                   ur::Runner, build_path::AbstractString)
 
 Runs the interactive shell for building, then captures bash history to save
-reproducible steps for building this source. Shared between steps 3 and 5
source
BinaryBuilder.Wizard.match_filesMethod
match_files(state::WizardState, prefix::Prefix,
-            platform::AbstractPlatform, files::Vector; silent::Bool = false)

Inspects all binary files within a prefix, matching them with a given list of files, complaining if there are any files that are not properly matched and returning the set of normalized names that were not matched, or an empty set if all names were properly matched.

source
BinaryBuilder.Wizard.normalize_nameMethod
normalize_name(file::AbstractString)

Given a filename, normalize it, stripping out extensions. E.g. the file path "foo/libfoo.tar.gz" would get mapped to "libfoo".

source
BinaryBuilder.Wizard.pick_preferred_platformMethod

Pick the first platform for use to run on. We prefer Linux x86_64 because that's generally the host platform, so it's usually easiest. After that we go by the following preferences:

  • OS (in order): Linux, Windows, OSX
  • Architecture: x86_64, i686, aarch64, powerpc64le, armv7l
  • The first remaining after this selection
source
BinaryBuilder.Wizard.print_autoconf_hintMethod
print_autoconf_hint(state::WizardState)

Print a hint for projects that use autoconf to have a good ./configure line.

source
BinaryBuilder.Wizard.provide_hintsMethod
provide_hints(state::WizardState, path::AbstractString)

Given an unpacked source directory, provide hints on how a user might go about building the binary bounty they so richly desire.

source
BinaryBuilder.Wizard.step1Method
step1(state::WizardState)

It all starts with a single step, the unabashed ambition to leave your current stability and engage with the universe on a quest to create something new, beautiful and unforeseen. It all ends with compiler errors.

This step selects the relevant platform(s) for the built binaries.

source
BinaryBuilder.Wizard.step2Method
step2(state::WizardState)

This step obtains the source code to be built and required binary dependencies.

source
BinaryBuilder.Wizard.step34Method
step34(state::WizardState)

Starts initial build for Linux x86_64, which is our initial test target platform. Sources that build properly for this platform continue on to attempt builds for more complex platforms.

source
BinaryBuilder.Wizard.step3_auditMethod
step3_audit(state::WizardState, platform::AbstractPlatform, prefix::Prefix)

Audit the prefix.

source
BinaryBuilder.Wizard.step3_interactiveMethod
step3_interactive(state::WizardState, prefix::Prefix, platform::AbstractPlatform,
-                  ur::Runner, build_path::AbstractString)

The interactive portion of step3, moving on to either rebuild with an edited script or proceed to step 4.

source
BinaryBuilder.Wizard.step3_retryMethod
step3_retry(state::WizardState)

Rebuilds the initial Linux x86_64 build after things like editing the script file manually, etc...

source
BinaryBuilder.Wizard.step4Method
step4(state::WizardState, ur::Runner, platform::AbstractPlatform,
-      build_path::AbstractString, prefix::Prefix)

The fourth step selects build products after the first build is done

source
BinaryBuilder.Wizard.with_gitcredsMethod
with_gitcreds(f, username::AbstractString, password::AbstractString)

Calls f with an LibGit2.UserPasswordCredential object as an argument, constructed from the username and password values. with_gitcreds ensures that the credentials object gets properly shredded after it's no longer necessary. E.g.:

julia with_gitcreds(user, token) do creds LibGit2.clone("https://github.com/foo/bar.git", "bar"; credentials=creds) end`

source
BinaryBuilder.Wizard.yggdrasil_build_tarballs_pathMethod
yggdrasil_build_tarballs_path(name::String)

Return the relative path within an Yggdrasil clone where this project (given its name) would be stored. This is useful for things like generating the build_tarballs.jl file and checking to see if it already exists, etc...

Note that we do not allow case-ambiguities within Yggdrasil, we check for this using the utility function case_insensitive_file_exists(path).

source
BinaryBuilder.Wizard.yggdrasil_deployFunction
yggdrasil_deploy(state::WizardState)

Write out a WizardState to a build_tarballs.jl in an Yggdrasil clone, then open a pull request against Yggdrasil.

source
BinaryBuilder.Wizard.yn_promptFunction
yn_prompt(state::WizardState, question::AbstractString, default = :y)

Perform a [Y/n] or [y/N] question loop, using default to choose between the prompt styles, and looping until a proper response (e.g. "y", "yes", "n" or "no") is received.

source

Command Line

BinaryBuilder.build_tarballsFunction
build_tarballs(ARGS, src_name, src_version, sources, script, platforms,
-               products, dependencies; kwargs...)

This should be the top-level function called from a build_tarballs.jl file. It takes in the information baked into a build_tarballs.jl file such as the sources to download, the products to build, etc... and will automatically download, build and package the tarballs, generating a build.jl file when appropriate.

Generally, ARGS should be the top-level Julia ARGS command-line arguments object. build_tarballs does some rudimentary parsing of the arguments. To see what it can do, you can call it with --help in the ARGS or see the Command Line section in the manual.

The kwargs are passed on to autobuild, see there for a list of supported ones. A few additional keyword arguments are accept:

  • julia_compat can be set to a version string which is used to set the supported Julia version in the [compat] section of the Project.toml of the generated JLL package. The default value is "1.0".

  • lazy_artifacts sets whether the artifacts should be lazy.

  • init_block may be set to a string containing Julia code; if present, this code will be inserted into the initialization path of the generated JLL package. This can for example be used to invoke an initialization API of a shared library.

  • augment_platform_block may be set to a string containing Julia code; if present, this code will be inserted into the top-level of the generated JLL package. It must define a function augment_platform! that takes as a single argument, the target platform and returns the target platform, with amended tags. This augmented platform will then be used by the JLL wrapper to select the artifact. Note that this option requires the Julia compatibility julia_compat to be 1.6 or higher.

Note

The init_block and augment_platform_block keyword arguments are experimental and may be removed in a future version of this package. Please use them sparingly.

source

The build_tarballs function also parses command line arguments. The syntax is described in the --help output:

Usage: build_tarballs.jl [target1,target2,...] [--help]
+reproducible steps for building this source. Shared between steps 3 and 5
source
BinaryBuilder.Wizard.match_filesMethod
match_files(state::WizardState, prefix::Prefix,
+            platform::AbstractPlatform, files::Vector; silent::Bool = false)

Inspects all binary files within a prefix, matching them with a given list of files, complaining if there are any files that are not properly matched and returning the set of normalized names that were not matched, or an empty set if all names were properly matched.

source
BinaryBuilder.Wizard.normalize_nameMethod
normalize_name(file::AbstractString)

Given a filename, normalize it, stripping out extensions. E.g. the file path "foo/libfoo.tar.gz" would get mapped to "libfoo".

source
BinaryBuilder.Wizard.pick_preferred_platformMethod

Pick the first platform for use to run on. We prefer Linux x86_64 because that's generally the host platform, so it's usually easiest. After that we go by the following preferences:

  • OS (in order): Linux, Windows, OSX
  • Architecture: x86_64, i686, aarch64, powerpc64le, armv7l
  • The first remaining after this selection
source
BinaryBuilder.Wizard.print_autoconf_hintMethod
print_autoconf_hint(state::WizardState)

Print a hint for projects that use autoconf to have a good ./configure line.

source
BinaryBuilder.Wizard.provide_hintsMethod
provide_hints(state::WizardState, path::AbstractString)

Given an unpacked source directory, provide hints on how a user might go about building the binary bounty they so richly desire.

source
BinaryBuilder.Wizard.step1Method
step1(state::WizardState)

It all starts with a single step, the unabashed ambition to leave your current stability and engage with the universe on a quest to create something new, beautiful and unforeseen. It all ends with compiler errors.

This step selects the relevant platform(s) for the built binaries.

source
BinaryBuilder.Wizard.step2Method
step2(state::WizardState)

This step obtains the source code to be built and required binary dependencies.

source
BinaryBuilder.Wizard.step34Method
step34(state::WizardState)

Starts initial build for Linux x86_64, which is our initial test target platform. Sources that build properly for this platform continue on to attempt builds for more complex platforms.

source
BinaryBuilder.Wizard.step3_auditMethod
step3_audit(state::WizardState, platform::AbstractPlatform, prefix::Prefix)

Audit the prefix.

source
BinaryBuilder.Wizard.step3_interactiveMethod
step3_interactive(state::WizardState, prefix::Prefix, platform::AbstractPlatform,
+                  ur::Runner, build_path::AbstractString)

The interactive portion of step3, moving on to either rebuild with an edited script or proceed to step 4.

source
BinaryBuilder.Wizard.step3_retryMethod
step3_retry(state::WizardState)

Rebuilds the initial Linux x86_64 build after things like editing the script file manually, etc...

source
BinaryBuilder.Wizard.step4Method
step4(state::WizardState, ur::Runner, platform::AbstractPlatform,
+      build_path::AbstractString, prefix::Prefix)

The fourth step selects build products after the first build is done

source
BinaryBuilder.Wizard.with_gitcredsMethod
with_gitcreds(f, username::AbstractString, password::AbstractString)

Calls f with an LibGit2.UserPasswordCredential object as an argument, constructed from the username and password values. with_gitcreds ensures that the credentials object gets properly shredded after it's no longer necessary. E.g.:

julia with_gitcreds(user, token) do creds LibGit2.clone("https://github.com/foo/bar.git", "bar"; credentials=creds) end`

source
BinaryBuilder.Wizard.yggdrasil_build_tarballs_pathMethod
yggdrasil_build_tarballs_path(name::String)

Return the relative path within an Yggdrasil clone where this project (given its name) would be stored. This is useful for things like generating the build_tarballs.jl file and checking to see if it already exists, etc...

Note that we do not allow case-ambiguities within Yggdrasil, we check for this using the utility function case_insensitive_file_exists(path).

source
BinaryBuilder.Wizard.yggdrasil_deployFunction
yggdrasil_deploy(state::WizardState)

Write out a WizardState to a build_tarballs.jl in an Yggdrasil clone, then open a pull request against Yggdrasil.

source
BinaryBuilder.Wizard.yn_promptFunction
yn_prompt(state::WizardState, question::AbstractString, default = :y)

Perform a [Y/n] or [y/N] question loop, using default to choose between the prompt styles, and looping until a proper response (e.g. "y", "yes", "n" or "no") is received.

source

Command Line

BinaryBuilder.build_tarballsFunction
build_tarballs(ARGS, src_name, src_version, sources, script, platforms,
+               products, dependencies; kwargs...)

This should be the top-level function called from a build_tarballs.jl file. It takes in the information baked into a build_tarballs.jl file such as the sources to download, the products to build, etc... and will automatically download, build and package the tarballs, generating a build.jl file when appropriate.

Generally, ARGS should be the top-level Julia ARGS command-line arguments object. build_tarballs does some rudimentary parsing of the arguments. To see what it can do, you can call it with --help in the ARGS or see the Command Line section in the manual.

The kwargs are passed on to autobuild, see there for a list of supported ones. A few additional keyword arguments are accept:

  • julia_compat can be set to a version string which is used to set the supported Julia version in the [compat] section of the Project.toml of the generated JLL package. The default value is "1.0".

  • lazy_artifacts sets whether the artifacts should be lazy.

  • init_block may be set to a string containing Julia code; if present, this code will be inserted into the initialization path of the generated JLL package. This can for example be used to invoke an initialization API of a shared library.

  • augment_platform_block may be set to a string containing Julia code; if present, this code will be inserted into the top-level of the generated JLL package. It must define a function augment_platform! that takes as a single argument, the target platform and returns the target platform, with amended tags. This augmented platform will then be used by the JLL wrapper to select the artifact. Note that this option requires the Julia compatibility julia_compat to be 1.6 or higher.

Note

The init_block and augment_platform_block keyword arguments are experimental and may be removed in a future version of this package. Please use them sparingly.

source

The build_tarballs function also parses command line arguments. The syntax is described in the --help output:

Usage: build_tarballs.jl [target1,target2,...] [--help]
                          [--verbose] [--debug]
                          [--deploy] [--deploy-bin] [--deploy-jll]
                          [--register] [--meta-json]