Skip to content

Commit

Permalink
[Runners] Do not generate toolchain files if we are bootstrapping (#185)
Browse files Browse the repository at this point in the history
* [Runners] Do not generate toolchain files if we are bootstrapping

* [Runners] Add test about starting a bootstrap runner

* [CI] Further increase timeout to 60 minutes
  • Loading branch information
giordano authored Dec 2, 2021
1 parent fb93175 commit 2b9abd2
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
jobs:
test:
name: Julia ${{ matrix.julia-version }} - x64 - runner ${{ matrix.runner }} - SquashFS ${{ matrix.squashfs }}
timeout-minutes: 45
timeout-minutes: 60
runs-on: ubuntu-latest
env:
BINARYBUILDER_RUNNER: ${{ matrix.runner }}
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "BinaryBuilderBase"
uuid = "7f725544-6523-48cd-82d1-3fa08ff4056e"
authors = ["Elliot Saba <staticfloat@gmail.com>"]
version = "1.0.4"
version = "1.0.5"

[deps]
CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193"
Expand Down
8 changes: 5 additions & 3 deletions src/DockerRunner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,11 @@ function DockerRunner(workspace_root::String;
generate_compiler_wrappers!(platform; bin_path=compiler_wrapper_path, extract_kwargs(kwargs, (:compilers,:allow_unsafe_flags,:lock_microarchitecture))...)
push!(workspaces, compiler_wrapper_path => "/opt/bin")

# Generate CMake and Meson files
generate_toolchain_files!(platform, envs; toolchains_path=toolchains_path)
push!(workspaces, toolchains_path => "/opt/toolchains")
if isempty(bootstrap_list)
# Generate CMake and Meson files, only if we are not bootstrapping
generate_toolchain_files!(platform, envs; toolchains_path=toolchains_path)
push!(workspaces, toolchains_path => "/opt/toolchains")
end

# the workspace_root is always a workspace, and we always mount it first
insert!(workspaces, 1, workspace_root => "/workspace")
Expand Down
8 changes: 5 additions & 3 deletions src/UserNSRunner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ function UserNSRunner(workspace_root::String;
generate_compiler_wrappers!(platform; bin_path=compiler_wrapper_path, extract_kwargs(kwargs, (:compilers,:allow_unsafe_flags,:lock_microarchitecture))...)
push!(workspaces, compiler_wrapper_path => "/opt/bin")

# Generate CMake and Meson files
generate_toolchain_files!(platform, envs; toolchains_path=toolchains_path)
push!(workspaces, toolchains_path => "/opt/toolchains")
if isempty(bootstrap_list)
# Generate CMake and Meson files, only if we are not bootstrapping
generate_toolchain_files!(platform, envs; toolchains_path=toolchains_path)
push!(workspaces, toolchains_path => "/opt/toolchains")
end

# the workspace_root is always a workspace, and we always mount it first
insert!(workspaces, 1, workspace_root => "/workspace")
Expand Down
4 changes: 4 additions & 0 deletions test/runners.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,16 @@ end

@testset "hello world" begin
mktempdir() do dir
# Make sure we can start a shell in a runner when the bootstrap list is non-empty
@eval BinaryBuilderBase bootstrap_list = [:rootfs, :platform_support]
ur = preferred_runner()(dir; platform=Platform("x86_64", "linux"; libc="musl"))
iobuff = IOBuffer()
@test run(ur, `/bin/bash -c "echo test"`, iobuff)
seek(iobuff, 0)
# Test that we get the output we expect (e.g. the second line is `test`)
@test readlines(iobuff)[2] == "test"
# Restore empty bootstrap list
@eval BinaryBuilderBase bootstrap_list = Symbol[]
end
end

Expand Down

2 comments on commit 2b9abd2

@giordano
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/49784

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.0.5 -m "<description of version>" 2b9abd26cc4343aa2417da1d7b7ea00584bf6a41
git push origin v1.0.5

Please sign in to comment.