Skip to content

Commit

Permalink
feat: Use upstream cargo-llvm-cov and add cachix
Browse files Browse the repository at this point in the history
  • Loading branch information
uttarayan21 committed Nov 18, 2024
1 parent bdcb002 commit bb42fef
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- id: set-matrix
name: Generate Nix Matrix
run: |
Expand All @@ -36,7 +35,10 @@ jobs:
lfs: true
submodules: 'recursive'
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: cachix/cachix-action@v14
with:
name: mnn-rs
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix build -L '.#${{ matrix.attr }}'

codecov:
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

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

5 changes: 1 addition & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@
lockFile = "${src}/Cargo.lock";
};
};
cargo-llvm-cov = prev.cargo-llvm-cov.overrideAttrs (_: {
LLVM_COV = "${final.llvmPackages_19.llvm}/bin/llvm-cov";
LLVM_PROFDATA = "${final.llvmPackages_19.llvm}/bin/llvm-profdata";
});
})
];
};
Expand Down Expand Up @@ -222,6 +218,7 @@
git
git-lfs
llvm
mnn
nushell
rust-bindgen
rustToolchainWithRustAnalyzer
Expand Down
6 changes: 3 additions & 3 deletions mnn-sync/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ impl SessionRunnerState {
tracing::info!("Unloading session");
match core::mem::take(self) {
Self::Loaded(sr) => {
let net = sr.unload()?;
let net = sr.unload();
*self = Self::Unloaded(net);
Ok(())
}
Expand Down Expand Up @@ -221,11 +221,11 @@ impl SessionRunner {
})
}

pub fn unload(self) -> Result<mnn::Interpreter> {
pub fn unload(self) -> mnn::Interpreter {
let session = self.session;
let net = self.interpreter;
drop(session);
Ok(net)
net
}

pub fn run_session(&mut self) -> Result<()> {
Expand Down

0 comments on commit bb42fef

Please sign in to comment.