Commit graph

782 commits

Author SHA1 Message Date
Jiahao XU
ea8ae5ce26
Merge pull request #261 from ryankurte/dependabot/cargo/tokio-1.20.1
Bump tokio from 1.20.0 to 1.20.1
2022-08-01 13:40:35 +10:00
Jiahao XU
fba5394e77
Merge pull request #263 from ryankurte/dependabot/cargo/clap-3.2.16
Bump clap from 3.2.14 to 3.2.16
2022-08-01 13:40:07 +10:00
dependabot[bot]
c5961ee07f
Bump clap from 3.2.14 to 3.2.16
Bumps [clap](https://github.com/clap-rs/clap) from 3.2.14 to 3.2.16.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v3.2.14...v3.2.16)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-01 01:33:47 +00:00
dependabot[bot]
3cdb2aeddd
Bump tokio from 1.20.0 to 1.20.1
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.20.0 to 1.20.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.20.0...tokio-1.20.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-01 01:33:36 +00:00
Jiahao XU
3d967a5405
Merge pull request #256 from NobodyXu/optimize-release-build
Use `build-std` feature for release build to reduce binary size
2022-07-31 19:44:13 +10:00
Jiahao XU
a6889c678e
Rm unused rustflags value in ci-scripts/compile-settings.jq
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-31 16:21:31 +10:00
Jiahao XU
9e5ff25be8
Fix release build: Set RUSTFLAGS to link with libgcc statically
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-31 13:40:17 +10:00
Jiahao XU
af3b87df7a
Fix releasae build: Install rust-src for release
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-30 16:20:18 +10:00
Jiahao XU
7a7220b1a2
Fix build: Rm unnecessary env.TOOLCHAIN
Since we build it using +nightly anyway.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-30 16:20:18 +10:00
Jiahao XU
98d8a96a02
Use build-std feature for release build to reduce binary size
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-30 16:20:17 +10:00
Félix Saparelli
ac995798ef
Split features and build args handling in build (#257) 2022-07-30 17:27:49 +12:00
Félix Saparelli
47fd7c14a6
Add -V, clean up errors and help text (#259)
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-30 17:26:52 +12:00
Félix Saparelli
806f69832e
Place import at the top (#258) 2022-07-30 10:07:54 +12:00
Jiahao XU
0c761857be
Merge pull request #252 from NobodyXu/feature/binstall-format
Feature: Create metafile format for cargo-binstall
2022-07-29 00:47:30 +10:00
Jiahao XU
6c6d0fe9c2
Update logging for binstall_v1::append
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-28 23:15:26 +10:00
Jiahao XU
241b763477
Use CompactString for field CrateVersionSource::name
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-28 23:14:00 +10:00
Jiahao XU
cb4cffd0ab
Fix confusing comment for field MetaData::other
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-28 20:33:24 +10:00
Jiahao XU
0d8b865ba4
Update binstall_v1::default_path and fix typo in it
The postfix should be `.json`, not `.toml`.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-28 19:50:10 +10:00
Jiahao XU
c5db0fefb5
Use Vec for field MetaData::other
by using `tuple_vec_map` to make the `Vec<(CompactString,
serde_json::Value)>` appears as a map.

This is OK because we don't access that part anyway and only add such
field to avoid losing any information when deserialize, modify it and
serialize it again to overwrite existing metafile.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-28 19:45:47 +10:00
Jiahao XU
4ad8e4f46e
Add new dep serde-tuple-vec-map v1.0.1
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-28 19:43:58 +10:00
Jiahao XU
98556cb2af
Add field MetaData::other for forward compatibility
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-28 19:24:14 +10:00
Jiahao XU
00fb2528af
Rm unused import std::fs in binstall_v1
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-28 18:09:53 +10:00
Jiahao XU
73af5b2824
Test appending behavior of append_to_path
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-28 18:09:38 +10:00
Jiahao XU
96d90c0376
Fix append_to_path on windows: Use create_if_not_exist
to open the file.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-28 18:06:39 +10:00
Jiahao XU
3f72e9b81a
Use tempfile::NamedTempFile in unit test of binstall_v1
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-28 01:45:54 +10:00
Jiahao XU
3cd9866d32
Use unwrap in unit test for binstall_v1
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-28 01:24:16 +10:00
Jiahao XU
2490c08840
Write to .binstall-crates.toml in entry
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-27 23:15:54 +10:00
Jiahao XU
7ccbdb2356
Impl binstall_v1::append
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-27 23:15:46 +10:00
Jiahao XU
d796424199
Fix Records::overwrite: Update file len
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-27 23:13:41 +10:00
Jiahao XU
c9139fec68
Add unit tests for metafiles::binstall_v1
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-27 23:09:52 +10:00
Jiahao XU
5987acbf95
Derive Clone for Source
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-27 22:55:16 +10:00
Jiahao XU
671b2fb6f0
Derive Clone for MetaData
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-27 22:54:32 +10:00
Jiahao XU
cef4dfee5c
Update doc of binstall_v1::Records::insert
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-27 22:32:20 +10:00
Jiahao XU
e6ee493771
Impl binstall_v1::Records::{len, is_empty}
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-27 22:31:51 +10:00
Jiahao XU
8ec33c5b6c
Impl get, contains, insert, replace, remove & take
for `binstall_v1::Records`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-27 22:30:58 +10:00
Jiahao XU
04f167491a
Impl Borrow<str> for MetaData for Records
so that we can use `&str` to query `BTreeSet<MetaData>`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-27 22:25:36 +10:00
Jiahao XU
aba2c87d6d
Impl IntoIterator for &Records
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-27 22:22:07 +10:00
Jiahao XU
df3af9727e
Impl new fn Records::overwrite
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-27 22:15:21 +10:00
Jiahao XU
1047a782e5
Impl newtype Records and methods load{_from_path}
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-27 20:36:13 +10:00
Jiahao XU
90203dd467
Impl PartialOrd and Ord for MetaData
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-27 20:33:40 +10:00
Jiahao XU
4114b6e7c4
Impl PartialEq, Eq and Hash fo MetaData
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-27 20:19:05 +10:00
Jiahao XU
2f27a5fd93
Refactor: Use binstall_v1::MetaData in mod binstall
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-27 19:44:16 +10:00
Jiahao XU
05c0d5fcae
Mark binstall_v1::{Source, SourceType} pub
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-27 19:24:01 +10:00
Jiahao XU
1a8fda1f5e
Impl binstall_v1::Source::cratesio_registry
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-27 19:23:15 +10:00
Jiahao XU
cc13aa911f
Refactor: Extract helpers::cratesio_url
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-27 19:22:45 +10:00
Jiahao XU
5ca1278c22
Add new enum binstall_v1::SourceType
Use it to represent source type instead of using `CompactString`.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-27 19:18:44 +10:00
Jiahao XU
cbd64b039d
Rename binstall_v1::Item to MetaData
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-27 18:50:21 +10:00
Jiahao XU
951a0f8b9f
Impl binstall_v1::default_path
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-27 18:39:22 +10:00
Jiahao XU
ce50186f4a
Impl io::Seek for FileLock
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-26 22:52:25 +10:00
Jiahao XU
ebb2d5d0c3
Impl io::Read for FileLock
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-26 22:51:20 +10:00