Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update rust to 1.81 #179

Merged
merged 2 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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(())
}
Loading