Skip to content

Commit

Permalink
Try #1201:
Browse files Browse the repository at this point in the history
  • Loading branch information
bors[bot] authored Feb 3, 2023
2 parents 4645d93 + 5b0bf5c commit ad82658
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changes/962.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"description": "fix SELinux labels to allow use in multiple containers and/or the host filesystem.",
"type": "fixed",
"issues": [961]
}
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased] - ReleaseDate

## [v0.2.5] - 2023-02-03

## Fixed

- #962 - fix SELinux labels to allow use in multiple containers and/or the host filesystem.

## [v0.2.4] - 2022-07-10

## Fixed
Expand Down Expand Up @@ -364,7 +370,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
<!-- prettier-ignore-start -->
<!-- next-url -->

[Unreleased]: https://github.com/cross-rs/cross/compare/v0.2.4...HEAD
[Unreleased]: https://github.com/cross-rs/cross/compare/v0.2.5...HEAD

[v0.2.5]: https://github.com/cross-rs/cross/compare/v0.2.4...v0.2.5

[v0.2.4]: https://github.com/cross-rs/cross/compare/v0.2.3...v0.2.4

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ keywords = ["cross", "compilation", "testing", "tool"]
license = "MIT OR Apache-2.0"
name = "cross"
repository = "https://github.com/cross-rs/cross"
version = "0.2.4"
version = "0.2.5"
edition = "2021"
include = [
"src/**/*",
Expand Down Expand Up @@ -66,7 +66,6 @@ once_cell = "1"
walkdir = "2"

[package.metadata.release]
dev-version = false
push = false
publish = false
tag = false
Expand Down
14 changes: 7 additions & 7 deletions src/docker/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,29 @@ pub(crate) fn run(
docker_user_id(&mut docker, engine.kind);

docker
.args(&["-v", &format!("{}:/xargo:Z", dirs.xargo.to_utf8()?)])
.args(&["-v", &format!("{}:/cargo:Z", dirs.cargo.to_utf8()?)])
.args(&["-v", &format!("{}:/xargo:z", dirs.xargo.to_utf8()?)])
.args(&["-v", &format!("{}:/cargo:z", dirs.cargo.to_utf8()?)])
// Prevent `bin` from being mounted inside the Docker container.
.args(&["-v", "/cargo/bin"]);
if mount_volumes {
docker.args(&[
"-v",
&format!("{}:{}:Z", dirs.host_root.to_utf8()?, dirs.mount_root),
&format!("{}:{}:z", dirs.host_root.to_utf8()?, dirs.mount_root),
]);
} else {
docker.args(&["-v", &format!("{}:/project:Z", dirs.host_root.to_utf8()?)]);
docker.args(&["-v", &format!("{}:/project:z", dirs.host_root.to_utf8()?)]);
}
docker
.args(&["-v", &format!("{}:/rust:Z,ro", dirs.sysroot.to_utf8()?)])
.args(&["-v", &format!("{}:/target:Z", dirs.target.to_utf8()?)]);
.args(&["-v", &format!("{}:/rust:z,ro", dirs.sysroot.to_utf8()?)])
.args(&["-v", &format!("{}:/target:z", dirs.target.to_utf8()?)]);
docker_cwd(&mut docker, &paths, mount_volumes)?;

// When running inside NixOS or using Nix packaging we need to add the Nix
// Store to the running container so it can load the needed binaries.
if let Some(ref nix_store) = dirs.nix_store {
docker.args(&[
"-v",
&format!("{}:{}:Z", nix_store.to_utf8()?, nix_store.as_posix()?),
&format!("{}:{}:z", nix_store.to_utf8()?, nix_store.as_posix()?),
]);
}

Expand Down

0 comments on commit ad82658

Please sign in to comment.