Skip to content

Commit 5347594

Browse files
authored
Merge pull request #58 from rust-lang/ghcr
Use crates-build-env from GHCR
2 parents 1b5f174 + 04da0ff commit 5347594

File tree

4 files changed

+21
-7
lines changed

4 files changed

+21
-7
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
- New method `Toolchain::rustup_binary` to allow running arbitrary binaries managed by rustup. Before, only `rustc` and `cargo` could be run.
1111

12+
### Changed
13+
14+
- The default sandbox image is now fetched from [GitHub Container Registry][ghcr-linux].
15+
16+
[ghcr-linux]: https://github.com/orgs/rust-lang/packages/container/package/crates-build-env/linux
17+
1218
## [0.12.0] - 2021-01-28
1319

1420
### Added
1521

1622
- New variant `PrepareError::MissingDependencies`, returned during the prepare
1723
step when a dependency does not exist.
24+
1825
### Changed
1926

2027
- Path dependencies are no longer removed from `Cargo.toml` during the prepare

src/workspace.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use std::time::Duration;
1212
static DEFAULT_SANDBOX_IMAGE: &str = "rustops/crates-build-env-windows";
1313

1414
#[cfg(not(windows))]
15-
static DEFAULT_SANDBOX_IMAGE: &str = "rustops/crates-build-env";
15+
static DEFAULT_SANDBOX_IMAGE: &str = "ghcr.io/rust-lang/crates-build-env/linux";
1616

1717
const DEFAULT_COMMAND_TIMEOUT: Option<Duration> = Some(Duration::from_secs(15 * 60));
1818
const DEFAULT_COMMAND_NO_OUTPUT_TIMEOUT: Option<Duration> = None;
@@ -53,11 +53,11 @@ impl WorkspaceBuilder {
5353

5454
/// Override the image used for sandboxes.
5555
///
56-
/// By default rustwide will use the [rustops/crates-build-env] image on Linux systems, and
57-
/// [rustops/crates-build-env-windows] on Windows systems. Those images contain dependencies to
58-
/// build a large amount of crates.
56+
/// By default rustwide will use the [ghcr.io/rust-lang/crates-build-env/linux-micro] image on
57+
/// Linux systems, and [rustops/crates-build-env-windows] on Windows systems. Those images
58+
/// contain dependencies to build a large amount of crates.
5959
///
60-
/// [rustops/crates-build-env]: https://hub.docker.com/r/rustops/crates-build-env
60+
/// [ghcr.io/rust-lang/crates-build-env/linux-micro]: https://github.com/orgs/rust-lang/packages/container/package/crates-build-env/linux-micro
6161
/// [rustops/crates-build-env-windows]: https://hub.docker.com/r/rustops/crates-build-env-windows
6262
pub fn sandbox_image(mut self, image: SandboxImage) -> Self {
6363
self.sandbox_image = Some(image);

tests/buildtest/inside_docker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::io::Write;
55
use std::path::Path;
66
use std::process::Command;
77

8-
static DOCKER_IMAGE_TAG: &str = "rustops/crates-build-env";
8+
static DOCKER_IMAGE_TAG: &str = "ghcr.io/rust-lang/crates-build-env/linux-micro";
99
static DOCKER_SOCKET: &str = "/var/run/docker.sock";
1010
static CONTAINER_PREFIX: &str = "/outside";
1111

tests/utils/mod.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use failure::Error;
22
use log::LevelFilter;
3-
use rustwide::{Workspace, WorkspaceBuilder};
3+
use rustwide::{cmd::SandboxImage, Workspace, WorkspaceBuilder};
44
use std::path::{Path, PathBuf};
55

66
static USER_AGENT: &str = "rustwide-tests (https://github.com/rust-lang/rustwide)";
@@ -22,6 +22,13 @@ pub(crate) fn init_named_workspace(name: &str) -> Result<Workspace, Error> {
2222
builder = builder.running_inside_docker(true);
2323
}
2424

25+
// Use the micro image when running tests on Linux, speeding them up.
26+
if cfg!(target_os = "linux") {
27+
builder = builder.sandbox_image(SandboxImage::remote(
28+
"ghcr.io/rust-lang/crates-build-env/linux-micro",
29+
)?);
30+
}
31+
2532
builder.init()
2633
}
2734

0 commit comments

Comments
 (0)