Commit Graph

80 Commits

Author SHA1 Message Date
Michal Trybus f0cb8a4520 fix(mmap): pre-allocate temp file before mmapping
This avoids SIGBUS on memory write in case the temp file is sparse.
Implemented for linux only; other target_os cfg values unchanged.
2023-05-19 00:48:36 +02:00
Michal Trybus 58de0b2d10
feat(mmap): new feature for mmap-based optimization (#49)
Ref: https://github.com/zkat/cacache-rs/issues/48
2023-05-17 15:45:46 -07:00
Kat Marchán 81bc84b33d
chore: Release cacache version 11.5.2 2023-03-31 17:54:59 -07:00
Kat Marchán b7c10ecaaf
fix(deps): move async-attributes over to dev-dependencies 2023-03-31 17:53:37 -07:00
Kat Marchán 6a4e534215
chore: Release cacache version 11.5.1 2023-03-31 17:46:44 -07:00
Kat Marchán 4950998f77
fix(deps): bump ssri too 2023-03-31 17:45:59 -07:00
Kat Marchán cfd29afe16
chore: Release cacache version 11.5.0 2023-03-31 17:42:30 -07:00
Kat Marchán 364f9da65e
feat(deps): bump miette and thiserror 2023-03-31 17:35:19 -07:00
Kat Marchán 646ae52e2f
chore: Release cacache version 11.4.0 2023-03-09 18:26:16 -08:00
Johannes Becker 02d7f146f1
fix(security): bump tempfile version to 3.4.0 (#45) 2023-03-07 10:21:02 -08:00
Kat Marchán 262e1ca2ba
chore: Release cacache version 11.3.0 2023-03-04 17:24:30 -08:00
Kat Marchán 80e5b4135b
chore: Release cacache version 11.2.0 2023-02-27 19:10:50 -08:00
Kat Marchán d39e83801d
feat(copy): add support for reflink-copy and unsafe-copy (#42) 2023-02-27 19:09:02 -08:00
Scott Haug ac56fd9ce6
feat(link_to): Add support for linking to existing files from the cache (#41) 2023-02-27 14:08:01 -08:00
Kat Marchán 4d85f3ca84
(cargo-release) start next development iteration 11.1.1-alpha.0 2023-02-19 01:24:04 -08:00
Kat Marchán 13809bc1b9
(cargo-release) version 11.1.0 2023-02-19 01:23:33 -08:00
Kat Marchán 70b3d5e695
(cargo-release) start next development iteration 11.0.3-alpha.0 2023-02-18 21:39:53 -08:00
Kat Marchán 61aec9e61c
(cargo-release) version 11.0.2 2023-02-18 21:39:20 -08:00
Kat Marchán 067d082690
(cargo-release) start next development iteration 11.0.2-alpha.0 2023-02-18 21:35:40 -08:00
Kat Marchán 1ffa7fc3d2
(cargo-release) version 11.0.1 2023-02-18 21:35:07 -08:00
Kat Marchán f8cbfefc12
feat(deps): bump ssri to 8.0.0 2023-02-18 21:31:00 -08:00
Kat Marchán 856c059096
(cargo-release) start next development iteration 11.0.1-alpha.0 2023-01-28 19:29:33 -08:00
Kat Marchán c86cd4c950
(cargo-release) version 11.0.0 2023-01-28 19:27:42 -08:00
Kat Marchán c2d5390a84
feat(errors): integrate miette and generally improve error reporting (#38)
BREAKING CHANGE: This bumps the MSRV to 1.67.0 and documents it in the README.
2023-01-28 19:17:53 -08:00
Kat Marchán 7afcb8d649
tests: stop spawning a new tokio runtime every benchmark iteration 2023-01-28 15:55:00 -08:00
Kat Marchán 526386ada8
fix(deps): only include rt-multi-threaded for tokio when running tests 2023-01-28 15:55:00 -08:00
C J Silverio e34dcfdc25
feature(async): Add tokio as an executor option (#36)
This PR is based on the work @alexschrod did in PR #29. All
I did was carry it over the finish line.

This PR adds a feature to the crate named `tokio-runtime`. If
you disable default features and enable this new one, cacache
uses tokio as its async executor. This makes integrating cacache
with tokio-using projects easier, because the file types leak out
if you use anything more than the top-level convenience functions.

The PR implements the feature using shims in a new submodule named
`async_lib`. This module conditionally uses either async-std
or tokio based on feature selection, and hides some differences with
convenience functions.

This change should not be a breaking change, because the default is
still async-std.

There are a few other small changes in this PR worth noting.

- The README shows how to switch runtimes.
- There's a justfile to run common tasks, including those in makefile.toml.
  The default shell is `sh`, so this might not work out of the box for
  Windows users.
- The tests can now run under either runtime. The justfile has a recipe
  that runs them both.
- The benchmarks can also run under either runtime. The justfile has two
  recipe for this, one using bench and the other using criterion's runner.
- The dependencies now pull in async-attributes by default along with
  async-std. This made it easier to swap runtimes in the tests.
- All dependency versions have been bumped.

Co-authored-by: @alexschrod
2023-01-28 13:01:59 -08:00
C J Silverio 6d84ff0aed
fix(write): set tmpfile length in async writer (#35)
Fixes: https://github.com/zkat/cacache-rs/issues/34

The async `poll_write()` implementation was creating a tempfile as
a backing for its inner mmap, but it was failing to set the length
on the file to match the incoming data. Compare with the sync
implementation!

This bug was exposed when the `memmap2` crate was swapped in
for `memmap`. The older crate was likely more lax about this.

Wrote a pair of new tests for `cacache::write_hash_sync` and
`cacache::write_hash`. The async test fails without this change, as
does any benchmarks run. Everything passes with it.

BREAKING CHANGE: This commit also bumps the MSRV for cacache to 1.66.1.
2023-01-23 17:37:34 -08:00
Kat Marchán 1b29e7435c
(cargo-release) start next development iteration 10.0.2-alpha.0 2022-02-25 09:06:47 -08:00
Kat Marchán e083991a54
(cargo-release) version 10.0.1 2022-02-25 09:06:15 -08:00
Kat Marchán d9291763ce
(cargo-release) start next development iteration 10.0.1-alpha.0 2022-01-23 10:07:47 -08:00
Kat Marchán 54170f4149
(cargo-release) version 10.0.0 2022-01-23 10:07:08 -08:00
Christian Haynes 03d4596baa
fix(security): replaced memmap with memmap2 (#30) 2022-01-23 10:04:07 -08:00
Kat Marchán c5aa6dc24f
(cargo-release) start next development iteration 9.0.1-alpha.0 2021-09-15 20:26:22 -07:00
Kat Marchán 64c60e3f41
(cargo-release) version 9.0.0 2021-09-15 20:25:45 -07:00
Kat Marchán 9163a58481
fix(cleanup): general house cleaning, bumping deps, etc 2021-09-15 20:23:00 -07:00
Kat Marchán 97890872d5
feat(license): change license to Apache-2.0
BREAKING CHANGE: This is a significant licensing change. Please review.
2021-09-15 19:52:50 -07:00
Kat Marchán 35a09fe961
8.0.0 2020-07-18 10:46:31 -07:00
Kat Marchán 803d0c3ede
feat(write): Use mmap for small writes (#26)
BREAKING CHANGE: This bumps the minimum Rust version from 1.39 to 1.43. Thanks, remove_dir_all! >:(
2020-07-18 10:43:38 -07:00
Kat Marchán addf858ab7 7.0.0 2020-04-29 21:40:47 -07:00
Florian Albertz bb815f5f22 feat(errors): remove anyhow and use custom error types (#24)
Co-authored-by: Florian Albertz <git@albertz.io>

BREAKING CHANGE: This changes the exported error type(s) for cacache, making it way easier to do error handling when something goes kaput.
2020-04-29 19:34:43 -07:00
Kat Marchán f596068172
6.0.0 2019-11-11 20:01:09 -08:00
Kat Marchán c44b781a34
feat(deps): upgrade to latest async-std and regular futures crate
Fixes: #22

BREAKING CHANGE: returned futures are now regular futures crate futures
2019-11-11 19:31:28 -08:00
Kat Marchán d5bb0dffb6
feat(chown): stop changing owner/group on unix platforms
Fixes: #16

BREAKING CHANGE: If you were relying on the chown functionality for the index (which you probably weren't), then your index will no longer be updated that way.
2019-11-06 20:59:24 -08:00
Kat Marchán 89d6c23f25
5.0.0 2019-10-23 21:21:29 -07:00
Kat Marchán 12f7ba02d9
4.0.0 2019-10-20 23:49:09 -04:00
Kat Marchán 62298cdf35
feat(errors): improved errors messaging and context (#20)
Fixes: #19

BREAKING CHANGE: Error values have changed. If you were inspecting or
matching against actual return values, you'll need to change your code
to use the new enums.
2019-10-20 23:47:56 -04:00
Kat Marchán ee149a70ca
feat(errors): Replace failure with anyhow crate (#17)
Fixes: #14

BREAKING CHANGE: Result functions now return anyhow::Error
2019-10-20 00:25:28 -04:00
Kat Marchán f12c0ddb04
meta: remove travis-ci badge 2019-10-18 22:41:24 -04:00
Kat Marchán 0cb833d144
3.0.0 2019-10-18 22:25:56 -04:00