Skip to content

Commit

Permalink
Merge #1694
Browse files Browse the repository at this point in the history
1694: ci: ensure fmt fails on jenkins r=tiagolobocastro a=tiagolobocastro



Co-authored-by: Tiago Castro <[email protected]>
  • Loading branch information
mayastor-bors and tiagolobocastro committed Jul 18, 2024
2 parents 6b4def0 + 41a3b33 commit a7e00d7
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 178 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,10 @@ pipeline {
steps {
cleanWs()
unstash 'source'
sh 'nix-shell --run "./scripts/rust-style.sh" ci.nix'
sh 'nix-shell --run "FMT_OPTS=--check ./scripts/rust-style.sh" ci.nix'
sh 'nix-shell --run "./scripts/rust-linter.sh" ci.nix'
sh 'nix-shell --run "./scripts/js-check.sh" ci.nix'
sh 'nix-shell --run "nixpkgs-fmt --check ." ci.nix'
script {
if (env.BRANCH_NAME != "trying") {
sh 'nix-shell --run "./scripts/check-submodule-branches.sh" ci.nix'
Expand Down
9 changes: 6 additions & 3 deletions ci.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ let
numactl
pytest_inputs
udev
libnvme
nvme-cli
xfsprogs
nixpkgs-fmt
];

shellEnv = with pkgs; {
Expand Down Expand Up @@ -67,6 +70,6 @@ let
};
};
in
pkgs.mkShell shellAttrs // {
name = "io-engine-dev-shell";
}
pkgs.mkShell shellAttrs // {
name = "io-engine-dev-shell";
}
10 changes: 5 additions & 5 deletions ide.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
, spdk ? "develop"
, spdk-path ? null
} @ args:
import ./ci.nix {
inherit rust;
inherit spdk;
inherit spdk-path;
}
import ./ci.nix {
inherit rust;
inherit spdk;
inherit spdk-path;
}
2 changes: 1 addition & 1 deletion io-engine/src/bdev/nvmx/qpair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ use spdk_rs::libspdk::{
spdk_nvme_qpair_set_abort_dnr,
};

use std::mem::zeroed;
#[cfg(feature = "spdk-async-qpair-connect")]
use std::{os::raw::c_void, time::Duration};
use std::mem::zeroed;

#[cfg(feature = "spdk-async-qpair-connect")]
use spdk_rs::{
Expand Down
2 changes: 1 addition & 1 deletion io-engine/src/core/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use spdk_rs::{
libspdk::{
spdk_app_shutdown_cb,
spdk_env_dpdk_post_init,
spdk_env_dpdk_rte_eal_init,
spdk_env_fini,
spdk_log_close,
spdk_log_level,
Expand All @@ -43,7 +44,6 @@ use spdk_rs::{
spdk_thread_lib_fini,
spdk_thread_send_critical_msg,
spdk_trace_cleanup,
spdk_env_dpdk_rte_eal_init,
SPDK_LOG_DEBUG,
SPDK_LOG_INFO,
SPDK_RPC_RUNTIME,
Expand Down
2 changes: 1 addition & 1 deletion nix/overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ self: super: rec {
nvmet-cli = super.callPackage ./pkgs/nvmet-cli { };
units = (super.callPackage ./pkgs/io-engine/units.nix { inherit tag sourcer; });
}
// (import ../spdk-rs/nix/overlay.nix { } self super)
// (import ../spdk-rs/nix/overlay.nix { } self super)
2 changes: 2 additions & 0 deletions nix/pkgs/io-engine/cargo-package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
, targetPlatform
, versions
, systemdMinimal
, rdma-core
, cargoBuildFlags ? [ ]
}:
let
Expand Down Expand Up @@ -87,6 +88,7 @@ let
protobuf
systemdMinimal.dev
utillinux.dev
rdma-core
];
cargoLock = {
lockFile = ../../../Cargo.lock;
Expand Down
22 changes: 0 additions & 22 deletions nix/pkgs/io-engine/default.nix
Original file line number Diff line number Diff line change
@@ -1,27 +1,5 @@
{ stdenv
, clang
, dockerTools
, e2fsprogs
, lib
, libaio
, libbsd
, libspdk
, libspdk-dev
, libpcap
, udev
, liburing
, makeRustPlatform
, numactl
, openssl
, pkg-config
, protobuf
, sources
, xfsprogs
, utillinux
, llvmPackages
, targetPackages
, buildPackages
, targetPlatform
, pkgs
, git
, tag
Expand Down
1 change: 0 additions & 1 deletion nix/sources.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@

# Redirects to `spdk-rs`.
import ../spdk-rs/nix/sources.nix
134 changes: 0 additions & 134 deletions scripts/rust-linter-env.sh

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/rust-linter.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

source ${BASH_SOURCE%/*}/rust-linter-env.sh
source ${BASH_SOURCE%/*}/../spdk-rs/scripts/rust-linter-env.sh
$CARGO clippy --all --all-targets --features=io-engine-testing -- -D warnings \
-A clippy::await-holding-lock \
-A clippy::await-holding-refcell-ref \
Expand Down
2 changes: 1 addition & 1 deletion scripts/rust-style.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

FMT_OPTS=${FMT_OPTS:-""}

source ${BASH_SOURCE%/*}/rust-linter-env.sh
source ${BASH_SOURCE%/*}/../spdk-rs/scripts/rust-linter-env.sh
$CARGO fmt --all -- $FMT_OPTS
10 changes: 5 additions & 5 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
, spdk ? "develop"
, spdk-path ? null
} @ args:
import ./ci.nix {
inherit rust;
inherit spdk;
inherit spdk-path;
}
import ./ci.nix {
inherit rust;
inherit spdk;
inherit spdk-path;
}

0 comments on commit a7e00d7

Please sign in to comment.