Skip to content

Commit

Permalink
Merge pull request #179 from morningtzh/deny-update
Browse files Browse the repository at this point in the history
ci: update rust to 1.81
  • Loading branch information
abel-von authored Jan 10, 2025
2 parents 54d5d2e + aa882d1 commit 3374d0a
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- run: rustup toolchain install nightly --component rustfmt
- run: rustup show
- name: Install Protoc
uses: arduino/[email protected]
with:
Expand Down
13 changes: 7 additions & 6 deletions runc/src/sandbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,19 @@ impl Sandboxer for RuncSandboxer {
let mut sandbox = sandbox.lock().await;
let mut sandbox_parent = self.sandbox_parent.lock().await;
let sandbox_pid = sandbox_parent.fork_sandbox_process(id, &sandbox.data.netns)?;
sandbox.prepare_sandbox_ns(sandbox_pid).await.map_err(|e| {
kill(Pid::from_raw(sandbox_pid), Signal::SIGKILL).unwrap_or_default();
e
})?;
sandbox
.prepare_sandbox_ns(sandbox_pid)
.await
.inspect_err(|_| {
kill(Pid::from_raw(sandbox_pid), Signal::SIGKILL).unwrap_or_default();
})?;

sandbox
.data
.task_address
.clone_from(&format!("ttrpc+{}", self.task_address));
sandbox.dump().await.map_err(|e| {
sandbox.dump().await.inspect_err(|_| {
kill(Pid::from_raw(sandbox_pid), Signal::SIGKILL).unwrap_or_default();
e
})?;
Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.78"
channel = "1.81"
components = ["rustfmt", "clippy", "llvm-tools"]
22 changes: 22 additions & 0 deletions vmm/common/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

use std::fs;

use ttrpc_codegen::{Codegen, Customize, ProtobufCustomize};

fn main() {
Expand Down Expand Up @@ -45,4 +47,24 @@ fn main() {
)
.run()
.expect("Gen protos code failed");

// Protobuf-rust 3.5.1 no longer generates the `#![allow(box_pointers)]` lint.
// However, ttrpc-rust has not yet upgraded to protobuf-rust 3.5.1.
// As a temporary measure, we are modifying the files to suppress the warning.
remove_box_pointers("src/api").expect("Remove api box_pointer failed");
}

fn remove_box_pointers(dir: &str) -> std::io::Result<()> {
for entry in fs::read_dir(dir)? {
let entry = entry?;
let path = entry.path();

if path.is_file() {
let content = fs::read_to_string(&path)?;
let new_content = content.replace("#![allow(box_pointers)]", "");

fs::write(path, new_content)?;
}
}
Ok(())
}

0 comments on commit 3374d0a

Please sign in to comment.