Skip to content

Commit

Permalink
Merge pull request #1139 from spkenv/rust-1.82
Browse files Browse the repository at this point in the history
Update to Rust 1.82.0 and fix lints
  • Loading branch information
jrray authored Oct 21, 2024
2 parents b07c503 + 111e484 commit ca69f24
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.80.0
toolchain: 1.82.0
target: x86_64-pc-windows-gnu
override: true
- name: Prepare VM
Expand All @@ -40,7 +40,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 45
container:
image: rust:1.80.0
image: rust:1.82.0
options: --security-opt seccomp=unconfined --privileged
env:
# Disable cnproc because we're in a container
Expand Down
2 changes: 1 addition & 1 deletion .site/spi/.spdev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ release_notes: |
toolchain:
- kind: Rust
toolchain: 1.80.0
toolchain: 1.82.0
additional_toolchains:
- nightly
- kind: Shell
Expand Down
5 changes: 2 additions & 3 deletions crates/spfs/src/config_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,8 @@ fn test_config_env_overrides<F: Fn(&Config) -> R, R: ToString>(
let config = load_config();
// Restore env
for (var, orig) in cleared_vars.iter() {
match orig {
Some(orig) => std::env::set_var(var, orig),
None => {}
if let Some(orig) = orig {
std::env::set_var(var, orig)
}
}
for (var, (_, orig)) in env_vars_to_set.iter().zip(generated_values.iter()) {
Expand Down
4 changes: 1 addition & 3 deletions crates/spfs/src/monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,12 @@ pub async fn wait_for_empty_runtime(rt: &runtime::Runtime, config: &crate::Confi
},
)
.await
.map(|result| {
.inspect(|_| {
if had_to_retry.load(Ordering::Relaxed) {
// Want to know if this happened...
#[cfg(feature = "sentry")]
tracing::error!(target: "sentry", "read mount namespace succeeded after retries");
}

result
})
.unwrap_or_default();

Expand Down
5 changes: 2 additions & 3 deletions crates/spk-schema/crates/ident/src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -726,9 +726,8 @@ impl std::hash::Hash for PkgRequest {
self.pkg.hash(state);
self.prerelease_policy.hash(state);
self.inclusion_policy.hash(state);
match &self.pin {
Some(p) => p.hash(state),
None => {}
if let Some(p) = &self.pin {
p.hash(state)
};
self.required_compat.hash(state);
// The 'requested_by' field is not included in the hash
Expand Down
15 changes: 6 additions & 9 deletions crates/spk-storage/src/storage/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -539,16 +539,13 @@ async fn find_layers_by_filenames<S: AsRef<str>>(

let mut paths_remaining = false;
for (index, path_opt) in paths.iter_mut() {
match path_opt {
Some(path) => {
if manifest.get_path(path).is_some() {
results[*index] = layer.digest()?;
*path_opt = None;
} else {
paths_remaining = true;
}
if let Some(path) = path_opt {
if manifest.get_path(path).is_some() {
results[*index] = layer.digest()?;
*path_opt = None;
} else {
paths_remaining = true;
}
None => {}
}
}

Expand Down
2 changes: 1 addition & 1 deletion rpmbuild.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN yum install -y \

RUN ln -s cmake3 /usr/bin/cmake
# install rustup for the cargo tool and compile toolchain
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh /dev/stdin -y --default-toolchain=1.80.0
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh /dev/stdin -y --default-toolchain=1.82.0
ENV PATH="${PATH}:/root/.cargo/bin"
# install protobuf compiler (protoc command)
ENV PB_REL="https://github.com/protocolbuffers/protobuf/releases"
Expand Down
2 changes: 1 addition & 1 deletion website/layouts/partials/logo.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<a id="logo"
href='{{ (cond (and (ne .Site.Params.landingPageURL nil) (.Site.IsMultiLingual)) .Site.Params.landingPageURL "/") }}'>
href='{{ (cond (and (ne .Site.Params.landingPageURL nil) (hugo.IsMultilingual)) .Site.Params.landingPageURL "/") }}'>
<div id="spk-logo" style="width:100%; height:100%;">
{{if and (.File) (strings.Contains .File.Path "spfs/")}}
<img style="max-width: 200px" alt="SPFS Logo" src="/images/spfs_white.png" />
Expand Down
6 changes: 3 additions & 3 deletions website/layouts/partials/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<ul>
<li>
<a class="padding"
href='{{ (cond (and (ne .Site.Params.landingPageURL nil) (.Site.IsMultiLingual)) .Site.Params.landingPageURL "/") }}'>{{
href='{{ (cond (and (ne .Site.Params.landingPageURL nil) (hugo.IsMultilingual)) .Site.Params.landingPageURL "/") }}'>{{
safeHTML (cond (ne .Site.Params.landingPageName nil) .Site.Params.landingPageName "<i class='fas fa-home'></i>Home") }}</a>
</li>
</ul>
Expand Down Expand Up @@ -50,11 +50,11 @@ <h3>{{ if not $disableShortcutsTitle}}{{ T "Shortcuts-Title"}}{{ end }}</h3>
</section>
{{end}}

{{ if or .Site.IsMultiLingual $showvisitedlinks }}
{{ if or hugo.IsMultilingual $showvisitedlinks }}
<section id="prefooter">
<hr />
<ul>
{{ if and .Site.IsMultiLingual (not .Site.Params.DisableLanguageSwitchingButton)}}
{{ if and hugo.IsMultilingual (not .Site.Params.DisableLanguageSwitchingButton)}}
<li>
<a class="padding">
<i class="fas fa-language fa-fw"></i>
Expand Down
2 changes: 1 addition & 1 deletion website/layouts/partials/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script type="text/javascript" src="{{"js/lunr.min.js" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}"></script>
<script type="text/javascript" src="{{"js/auto-complete.js" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}"></script>
<script type="text/javascript">
{{ if .Site.IsMultiLingual }}
{{ if hugo.IsMultilingual }}
var baseurl = "{{.Site.BaseURL}}{{.Site.LanguagePrefix}}";
{{ else }}
var baseurl = "{{.Site.BaseURL}}";
Expand Down

0 comments on commit ca69f24

Please sign in to comment.