Commit graph

86 commits

Author SHA1 Message Date
dependabot[bot]
28449c21f4
Bump toml_edit from 0.19.0 to 0.19.1 (#753) 2023-01-31 01:41:22 +00:00
dependabot[bot]
1ad5d4657f
Bump toml_edit from 0.18.0 to 0.19.0 (#748) 2023-01-30 02:37:41 +00:00
Jiahao XU
9047d99c1a
Fix unused import in binstalk-manifests (#740)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-01-24 23:47:50 +11:00
Jiahao XU
152ea8376b
Switch from toml back to toml_edit (#738)
Since now toml simply uses toml_edit, there is no reason to continue
using it as it merely increase compilation time and bloat.

Instead, we switch to toml_edit v0.18.0 with feature serde enabled.

This also remove the `CratesTomlParseError::TomlParseNonUtf8` variant
intorduced in #736.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-01-24 16:27:34 +13:00
dependabot[bot]
425c6c2509
Bump toml from 0.5.11 to 0.6.0 (#736)
* Bump toml from 0.5.11 to 0.6.0

Bumps [toml](https://github.com/toml-rs/toml) from 0.5.11 to 0.6.0.
- [Release notes](https://github.com/toml-rs/toml/releases)
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.5.11...toml-v0.6.0)

---
updated-dependencies:
- dependency-name: toml
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix use of `toml` v0.6
* Optimize `CratesTomlParseError`: Box variant `TomlParse`
   Since now `toml:🇩🇪:Error` is a wrapper of `toml_edit::TomlError`,
   which is at least 3 * `size_of::<Vec<_>>()`.

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-01-24 02:51:29 +00:00
dependabot[bot]
e22d319825
Bump toml from 0.5.10 to 0.5.11 (#734)
Bumps [toml](https://github.com/toml-rs/toml) from 0.5.10 to 0.5.11.
- [Release notes](https://github.com/toml-rs/toml/releases)
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.5.10...toml-v0.5.11)

---
updated-dependencies:
- dependency-name: toml
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-23 04:50:58 +00:00
github-actions[bot]
8119acfeb0
release: detect-targets v0.1.5 (#706)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-01-16 11:23:54 +11:00
github-actions[bot]
24c15e57e9
release: binstalk-manifests v0.2.0 (#684)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-01-10 23:48:36 +00:00
github-actions[bot]
3d79401d81
release: binstalk-types v0.2.0 (#685)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-01-11 10:29:31 +11:00
github-actions[bot]
9cdaf777c0
release: detect-targets v0.1.4 (#683)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-01-10 23:12:37 +00:00
Jiahao XU
d4da4680f6
Minor Optimization and fix for bintalk-manifests (#643)
* Optimize `CratesToml::load_from_reader`: Avoid dup monomorphization
* Optimize `CratesToml::write_to_writer`: Avoid dup monomophization
* Optimize `create_if_not_exist`: Take `&path` to avoid dup monomorphization
* Fix `CratesToml::write_to_path`: Use exclusive file lock
   to prevent race conditions.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-01-04 00:37:01 +00:00
dependabot[bot]
c022cd9b0c
Bump serde from 1.0.151 to 1.0.152 (#633)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.151 to 1.0.152.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.151...v1.0.152)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-28 02:30:38 +00:00
Jiahao XU
31c6524833
Impl new fn CratesToml::append_to_file (#629)
Prepare for fix for #588

* Impl new fn `CratesToml::append_to_file`
* Optimize `CratesToml::append_to_file`: Avoid dup monomorphization

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-12-28 11:33:35 +11:00
Jiahao XU
c87d42d2d8
Fix CratesToml::load_from_reader: Ret default for empty reader (#622)
Fixed #621

Also add a new unit test for this bug.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-12-28 00:31:47 +00:00
Jiahao XU
fef8bb6774
Optimize binstalk-{manifest, types} (#610)
* Add new dep maybe-owned v0.3.4 to binstalk-types with features serde
* Re-export maybe_owned in binstalk-types
* Optimize `CrateSource::url`: Use `MaybeOwned<'static, Url>`
   to avoid cloning in `CrateSource::cratesio_registry`
* Optimize `Source`: Use `MaybeOwned<'static, Url>`
   to avoid cloning in `Source::cratesio_registry` and
   `impl From<&CrateSource> for Source`.
* Optimize `Source`: Add lifetime `<'a>` to avoid cloning
   in `impl<'a> From<&'a CrateSource> for Source<'a>`
* Optimize `CratesToml::append_to_path`: Avoid cloning
   caused by `CrateVersionSource::from` by manually `format!` name, version
   and source into string.
* Add new dep beef v0.5.2 to binstalk-manifests with features impl_serde
* Optimize `CratesToml::append_to_path`: Eliminate `metadata.bins.clone()` by using `Cow`
* Replace dep toml_edit with toml v0.5.10 in binstalk-manifests
   to speed up compilation and reduce bloat.
   
   Previously we switch to toml_edit because it is unmaintained, but now
   with it moved into toml-rs/toml as a workspace, it is now under active
   maintenance again, thus we switch back to it.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-12-21 06:07:04 +00:00
dependabot[bot]
e519409ad8
Bump thiserror from 1.0.37 to 1.0.38 (#618)
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.37 to 1.0.38.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.37...1.0.38)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-20 14:38:07 +11:00
dependabot[bot]
7714d42b60
Bump semver from 1.0.14 to 1.0.16 (#614) 2022-12-19 05:51:35 +00:00
dependabot[bot]
daf52a475a
Bump serde from 1.0.150 to 1.0.151 (#616) 2022-12-19 05:12:15 +00:00
dependabot[bot]
b209d10ed5
Bump serde_json from 1.0.89 to 1.0.91 (#615) 2022-12-19 04:39:48 +00:00
github-actions[bot]
2595bbabfb
release: binstalk-manifests v0.1.1 (#603)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2022-12-12 07:42:36 +00:00
dependabot[bot]
058208bae9
Bump serde from 1.0.149 to 1.0.150 (#597)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.149 to 1.0.150.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.149...v1.0.150)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-12 02:40:53 +00:00
dependabot[bot]
97c5857e58
Bump serde from 1.0.148 to 1.0.149 (#592)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.148 to 1.0.149.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.148...v1.0.149)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-12 00:59:27 +00:00
Jiahao XU
ec026c1711
Optimize CratesToml::collect_into_crates_versions (#589)
Avoid calling `CrateVersionSource::from_str` which parses the source and
allocates `Url`.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-12-04 01:46:30 +00:00
Jiahao XU
39f175be04
Feature: Check for installed crates in cargo_install_v1_manifest (#582)
* Add & Impl new fn `CratesToml::collect_into_crates_versions`
   to iterate over crates listed in cargo_crates_v1, accessing their names
   and versions.
* Re-export `CompactString`, `Version` & `Url` in binstalk-manifests
   for convenience
* Fix `CratesToml::load_from_path`: Wrap `File` in `FileLock::new_shared`
   to avoid concurrent write while reading the file.
* Filter out installed crates in cargo_install_v1_metadata
* Make match in `filter_out_installed_crates` more explicit
* Add new test `cargo_crates_v1::test::test_loading`
* Optimize `CratesToml`: Use `Vec` instead of `BTreeMap`
  since we cannot simply call `BTreeMap::get` to find an entry for a crate
  anyway.
  This also accidentally fixed the CI.
* Impl new API `CratesToml::remove`
* Fix`CratesToml::append_to_path` by removing previous records of
   the crates that are just updated.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-12-03 15:25:41 +00:00
dependabot[bot]
30cc94b5bc
Bump serde from 1.0.147 to 1.0.148 (#572)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.147 to 1.0.148.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.147...v1.0.148)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-29 13:39:33 +11:00
dependabot[bot]
f71c3606f8
Bump miette from 5.4.1 to 5.5.0 (#565)
Bumps [miette](https://github.com/zkat/miette) from 5.4.1 to 5.5.0.
- [Release notes](https://github.com/zkat/miette/releases)
- [Changelog](https://github.com/zkat/miette/blob/main/CHANGELOG.md)
- [Commits](https://github.com/zkat/miette/compare/miette-derive-v5.4.1...miette-derive-v5.5.0)

---
updated-dependencies:
- dependency-name: miette
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-24 12:46:34 +00:00
github-actions[bot]
0084254c8c
release: binstalk-manifests v0.1.0 (#558)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2022-11-22 10:36:10 +00:00
github-actions[bot]
6fd3044c12
release: binstalk-types v0.1.0 (#557)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2022-11-22 09:21:27 +00:00
Jiahao XU
73751c4437
Set version of newly created crates to v0.0.0 (#556)
so that release-pr can operate on them and increase minor version for a
new release.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-11-22 08:52:27 +00:00
github-actions[bot]
e5cd7d7ca1
release: detect-targets v0.1.3 (#555)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2022-11-22 08:31:43 +00:00
Jiahao XU
822e7094e5
Upgrade dependencies (#554)
- bytes v1.2.1 => v1.3.0
 - serde_json v1.0.88 => v1.0.89
 - compact_str v0.6.0 => v0.6.1

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-11-22 07:39:58 +00:00
dependabot[bot]
7706aa14cf
Bump serde_json from 1.0.87 to 1.0.88 (#547)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.87 to 1.0.88.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.87...v1.0.88)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-21 02:37:50 +00:00
Jiahao XU
325cb5cc19
Optimizations plus bug fix (#541)
* Optimize `Download::and_extract`: Avoid dup monomorphization
* Increase buffer size for binstall_crates_v1 to `4096 * 5`
* Optimize `opts::resolve`: Avoid unnecessary `clone`s
* Fix reserve in `opts::resolve`: Do not over-reserve
* Rename field `opts::Options::resolver` => `resolvers`
* Refactor: Extract new type `resolve::PackageInfo`
    - which makes `opts::resolve_inner` easier to understand
    - reduce number of parameters required for `download_extract_and_verify` and
      `collect_bin_files`
    - reducing size of future returned by `opts::resolve_inner` by dropping
      `cargo_toml::{Manifest, Package}` as early as possible since
      `Manifest` is 3000 Bytes large while `Package` is 600 Bytes large.
* Optimize `fetchers::Data`: Use `CompactString` for field name & version
   since they are usually small enough to fit in inlined version of
   `CompactString`.
* Optimize `gh_crate_meta`: Avoid unnecessary allocation
   in `RepositoryHost::get_default_pkg_url_template`.
* Refacator: Use `Itertools::cartesian_product` in `apply_filenames_to_paths`
* Optimize `ops::resolve`: Avoid unnecessary `clone` & reduce future size
   by calling `fetcher.target_meta()` to obtain final metadata after
   downloaded and extracted the binaries.
* Optimize `ops::resolve`: Avoid unnecessary allocation
   in `download_extract_and_verify`: Replace `Itertools::join` with
   `Itertools::format` to avoid allocating the string.
* Fix disabling cargo-install fallback
* Simplify `BinFile::from_product`: Takes `&str` instead of `&Product`
   since we only need `product.name`
* Rename `BinFile::from_product` => `BinFile::new`
* Refactor: Create newtype `ops::resolve::Bin`
   so that we don't need to `unwrap()` on `Product::name`
   and reduce memory usage.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-11-17 23:59:35 +00:00
Jiahao XU
d9cc3ce219
Refactor: Extract new crate binstalk-types plus other misc refactor and optimization (#535)
* Refactor: Extract new crate binstalk-types
* Optimize: Rm field `CrateInfo::other`
   which also removes dep serde-tuple-vec-map and serde-json from
   binstalk-types.
   
   This also makes `CrateInfo` easier to use, more generic and can be used
   over any `Serializer`, not just `serde_json::Value`.
* Mark all errors in `binstalk-manifests` as non_exhaustive
* Reduce size of `CvsParseError` by using `Box<str>`
   instead of `String` for variant `UnknownSourceType`.
* Reduce size of `CratesTomlParseError` to 16 bytes on 64bit platform
   by boxing variants `TomlWrite` and `CvsParse` as these two fields are
   significantly larger than other variants.
* Unify import style in mod `binstall_crates_v1`
* Replace dep binstalk-manifests with binstalk-types in binstalk-downloader
   to reduce its transitive dependencies and enables binstalk-downloader to
   be built in parallel to binstak-manifests.
* Replace dep binstalk-manifests with binstalk-types in binstalk
   to reduce transitive dependencies and enables binstalk to be built in
   parallel to binstalk-manifests.
   
   This is benefitial because binstalk-manifests pulls in toml_edit, which
   could takes up to 15s to be built on M1 (7-9s for codegen).
* Add dep binstalk-manifests to crates/bin
* Update dependabot and GHA release-pr

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-11-17 13:46:27 +13:00
Jiahao XU
b6f223d925
Switch binstalk-manifests LICENSE to "Apache-2.0 OR MIT" (#513)
Signed-off-by: Félix Saparelli <felix@passcod.name>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: pinage404
Signed-off-by: Ryo Yamashita <qryxip@gmail.com>
Signed-off-by: azzamsa

and https://github.com/cargo-bins/cargo-binstall/pull/513#issuecomment-1315898664 for Ryan Kurte
2022-11-15 22:51:11 +00:00
Jiahao XU
fc6d9ab956
Refactor: Extract new crate binstalk-manifests (#511)
* Refactor: Extract new crate binstalk-manifests
* Fix clippy warning in mod `binstall_crates_v1`
* Rm unused deps in binstalk
* Update release-pr

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-11-08 00:50:02 +00:00