Skip to content

Commit

Permalink
Use nightly 2024-09-12 (#2845)
Browse files Browse the repository at this point in the history
* downgrade rust toolchain

* changelog

* Does this work?

* fix agent?

* macos release

* override rust-toolchain.toml in lint

* whatever

* override toolchain for agent unit tests

* Is  installed?

* Revert installing gcc target.

setup-rust-toolchain said:
error: component 'rust-std' for target 'aarch64-linux-gnu-gcc' is unavailable for download for channel 'nightly-2024-10-11'

This reverts commit 2f5cee3.

* fix ci

* ..

* ..

---------

Co-authored-by: Aviram Hassan <[email protected]>
  • Loading branch information
t4lz and aviramha authored Oct 17, 2024
1 parent 5b53e01 commit 2cbf416
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 28 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ jobs:
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# the setup rust toolchain action ignores the input if file exists.. so remove it
- run: rm rust-toolchain.toml
- run: rustup default nightly-2024-10-11
- name: test
run: cargo test --target x86_64-unknown-linux-gnu -p mirrord-agent

Expand Down Expand Up @@ -387,7 +390,7 @@ jobs:
with:
components: rustfmt, clippy
target: aarch64-apple-darwin
toolchain: nightly-2024-10-11
toolchain: nightly-2024-09-12
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: x86_64-apple-darwin,aarch64-apple-darwin
toolchain: nightly-2024-10-11
toolchain: nightly-2024-09-12
rustflags: ""
- name: Import Code-Signing Certificates
uses: Apple-Actions/import-codesign-certs@v3
Expand All @@ -73,7 +73,7 @@ jobs:
brew tap mitchellh/gon
brew install mitchellh/gon/gon
- name: build mirrord-layer x86-64
run: cargo +nightly-2024-10-11 build --release -p mirrord-layer --target=x86_64-apple-darwin
run: cargo +nightly-2024-09-12 build --release -p mirrord-layer --target=x86_64-apple-darwin
- name: build mirrord-layer macOS arm/arm64e
# Editing the arm64 binary, since arm64e can be loaded into both arm64 & arm64e
# >> target/debug/libmirrord_layer.dylib: Mach-O 64-bit dynamically linked shared library arm64
Expand All @@ -82,7 +82,7 @@ jobs:
# >> magic bits: 0000000 facf feed 000c 0100 0002 0000 0006 0000
# >> target/debug/libmirrord_layer.dylib: Mach-O 64-bit dynamically linked shared library arm64e
run: |
cargo +nightly-2024-10-11 build --release -p mirrord-layer --target=aarch64-apple-darwin
cargo +nightly-2024-09-12 build --release -p mirrord-layer --target=aarch64-apple-darwin
cp target/aarch64-apple-darwin/release/libmirrord_layer.dylib target/aarch64-apple-darwin/release/libmirrord_layer_arm64e.dylib
printf '\x02' | dd of=target/aarch64-apple-darwin/release/libmirrord_layer_arm64e.dylib bs=1 seek=8 count=1 conv=notrunc
- name: Sign layer binaries
Expand All @@ -102,11 +102,11 @@ jobs:
- name: build macOS arm cli with universal dylib
env:
MIRRORD_LAYER_FILE: /tmp/target/universal-apple-darwin/release/libmirrord_layer.dylib
run: cargo +nightly-2024-10-11 build --release -p mirrord --target=aarch64-apple-darwin
run: cargo +nightly-2024-09-12 build --release -p mirrord --target=aarch64-apple-darwin
- name: build macOS x86-64 cli with universal dylib
env:
MIRRORD_LAYER_FILE: /tmp/target/universal-apple-darwin/release/libmirrord_layer.dylib
run: cargo +nightly-2024-10-11 build --release -p mirrord --target=x86_64-apple-darwin
run: cargo +nightly-2024-09-12 build --release -p mirrord --target=x86_64-apple-darwin
- name: Sign cli binaries
env:
AC_USERNAME: ${{ secrets.APPLE_DEVELOPER }}
Expand Down
1 change: 1 addition & 0 deletions changelog.d/downgrade-rust.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Downgrade rust toochain to nightly-2024-09-12.
7 changes: 2 additions & 5 deletions mirrord/kube/src/api/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,8 @@ impl<E> FromResidual<Result<Infallible, E>> for NodeCheck
where
E: Into<KubeApiError>,
{
fn from_residual(error: Result<Infallible, E>) -> Self {
match error {
Ok(_) => unreachable!(),
Err(err) => NodeCheck::Error(err.into()),
}
fn from_residual(Err(err): Result<Infallible, E>) -> Self {
NodeCheck::Error(err.into())
}
}

Expand Down
22 changes: 6 additions & 16 deletions mirrord/layer/src/detour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ impl<S> Try for Detour<S> {
impl<S> FromResidual<Detour<convert::Infallible>> for Detour<S> {
fn from_residual(residual: Detour<convert::Infallible>) -> Self {
match residual {
Detour::Success(_) => unreachable!(),
Detour::Bypass(b) => Detour::Bypass(b),
Detour::Error(e) => Detour::Error(e),
}
Expand All @@ -280,29 +279,20 @@ impl<S, E> FromResidual<Result<convert::Infallible, E>> for Detour<S>
where
E: Into<HookError>,
{
fn from_residual(residual: Result<convert::Infallible, E>) -> Self {
match residual {
Ok(_) => unreachable!(),
Err(e) => Detour::Error(e.into()),
}
fn from_residual(Err(e): Result<convert::Infallible, E>) -> Self {
Detour::Error(e.into())
}
}

impl<S> FromResidual<Result<convert::Infallible, Bypass>> for Detour<S> {
fn from_residual(residual: Result<convert::Infallible, Bypass>) -> Self {
match residual {
Ok(_) => unreachable!(),
Err(e) => Detour::Bypass(e),
}
fn from_residual(Err(e): Result<convert::Infallible, Bypass>) -> Self {
Detour::Bypass(e)
}
}

impl<S> FromResidual<Option<convert::Infallible>> for Detour<S> {
fn from_residual(residual: Option<convert::Infallible>) -> Self {
match residual {
Some(_) => unreachable!(),
None => Detour::Bypass(Bypass::EmptyOption),
}
fn from_residual(_none_residual: Option<convert::Infallible>) -> Self {
Detour::Bypass(Bypass::EmptyOption)
}
}

Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "nightly-2024-10-11"
channel = "nightly-2024-09-12"
components = [ "rustfmt", "clippy", "rustc" ]
profile = "minimal"

0 comments on commit 2cbf416

Please sign in to comment.