Jiahao XU
28aeae938e
fs::create_dir_all(&install_path)
in main.rs
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-04 14:00:44 +10:00
Jiahao XU
346bb8ee67
Fix binstall::resolve
( #266 )
2022-08-04 11:12:06 +12:00
Jiahao XU
f7625fcefc
Merge pull request #264 from NobodyXu/fix-repeated-crates-on-batch-installation
...
Fix repeated crates on batch installation: Dedup them and only keep the last one
2022-08-03 21:32:09 +10:00
Jiahao XU
8d410a5710
Merge pull request #265 from NobodyXu/minor-fix-and-optimize
...
Minor fix (use `PathBuf` instead of `String` to relax utf-8 req) and micro optimization
2022-08-03 13:21:45 +10:00
Jiahao XU
60d17c7e56
Ret CompactString
in Fetcher::source_name
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-02 22:42:05 +10:00
Jiahao XU
f72eafb049
Use PathBuf
for field Options::install_path
...
Since it does not require a utf-8 string.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-02 22:28:44 +10:00
Jiahao XU
a52ac3fc7a
Use CompactString
for Options::version_req
...
which is unlikely to be larger than 24 bytes.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-02 22:26:44 +10:00
Jiahao XU
b7cfa0aa64
Use CompactString
for field Resolution::Fetch::version
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-02 22:21:45 +10:00
Jiahao XU
d430c077d4
Use CompactString
for fields of CrateName
...
Since most of the time, they are shorter than 24 bytes.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-02 22:17:11 +10:00
Jiahao XU
caeb49ce33
Rm duplicate crate_names
specified on cmdline
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-02 22:15:09 +10:00
Jiahao XU
09c1afe616
Impl new fn CrateName::dedup
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-02 22:14:05 +10:00
Jiahao XU
58c50cbe91
Add new dep itertools v0.10.3
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-02 20:18:44 +10:00
Jiahao XU
9391d22fa2
Apply clippy suggestion
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-02 19:54:01 +10:00
Jiahao XU
a2e6709ed6
Merge pull request #262 from ryankurte/dependabot/cargo/bytes-1.2.1
...
Bump bytes from 1.2.0 to 1.2.1
2022-08-01 18:23:50 +10:00
dependabot[bot]
da19855500
Bump bytes from 1.2.0 to 1.2.1
...
Bumps [bytes](https://github.com/tokio-rs/bytes ) from 1.2.0 to 1.2.1.
- [Release notes](https://github.com/tokio-rs/bytes/releases )
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md )
- [Commits](https://github.com/tokio-rs/bytes/commits )
---
updated-dependencies:
- dependency-name: bytes
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-08-01 03:41:34 +00:00
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