Partially resolve#731
Using symlinks not only add unnecessary bloat to users' `$CARGO_HOME/bin` directory, but it actually breaks `sccache`, which inspects its binary name and decides how to act on.
For `sccache` to function, it must be invoked directly or use a hard link.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Replace the algorithm with explicit state and complex matching with a loop that encodes state in the current structure of the loop.
The new code is much more readable and might be more performant since it uses `str::find`/`str::split_once` to look for next token instead of manually iterating over `str::chars`.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* leon: first implementation
* Update crates/leon/src/values.rs
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
* Workaround orphan rules to make API more intuitive
* Fmt
* Clippy
* Use CoW
* Use cow for items too
* Test that const construction works
* leon: Initial attempt at O(n) parser
* leon: finish parser (except escapes)
* leon: Improve ergonomics of compile-time templates
* Document helpers
* leon: Docs tweaks
* leon: Use macro to minimise parser tests
* leon: add escapes to parser
* leon: test escapes preceding keys
* leon: add multibyte tests
* leon: test escapes following keys
* Format
* Debug
* leon: Don't actually need to keep track of the key
* leon: Parse to vec first
* leon: there's actually no need for string cows
* leon: reorganise and redo macro now that there's no coww
* Well that was silly
* leon: Adjust text end when pushing
* leon: catch unbalanced keys
* Add error tests
* leon: Catch unfinished escape
* Comment out debugging
* leon: fuzz
* Clippy
* leon: Box parse error
* leon: &dyn instead of impl
* Can't impl FromStr, so rename to parse
* Add Vec<> to values
* leon: Add benches for ways to supply values
* leon: Add bench comparing to std and tt
* Fix fuzz
* Fmt
* Split ParseError and RenderError
* Make miette optional
* Remove RenderError lifetime
* Simplify ParseError type schema
* Write concrete Values types instead of generics
* Add license files
* Reduce criterion deps
* Make default a cow
* Add a CLI leon tool
* Fix tests
* Clippy
* Disable cli by default
* Avoid failing the build when cli is off
* Add to ci
* Update crates/leon/src/main.rs
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
* Update crates/leon/Cargo.toml
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
* Bump version
* Error not transparent
* Diagnostic can do forwarding
* Simplify error type
* Expand doc examples
* Generic Values for Hash and BTree maps
* One more borrowed
* Forward implementations
* More generics
* Add has_keys
* Lock stdout in leon tool
* No more debug comments in parser
* Even more generics
* Macros to reduce bench duplication
* Further simplify error
* Fix leon main
* Stable support
* Clippy
---------
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
Fixed https://github.com/cargo-bins/cargo-quickinstall/issues/195
- Fix `fetchers::QuickInstall`: Stop sending stats for `universal-apple-darwin`
since quickinstall only supports targets officially supports by rust.
- Only send stats report to quickinstall if the `Fetcher::find` is `.await`ed on
This prevents stats report to be sent for cases where the `QuickInstall` fetcher
is actually unused, e.g. resolved to `GhCrateMeta` or other `QuickInstall` fetcher
with different target.
This also reduces amount of http requests created in background.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Fixed#859
* Impl `cargo_config`
* Use `install.root` in `$CARGO_HOME/.cargo/config.toml`
before fallback to `cargo_home`.
* Improve logging in `get_cargo_roots_path`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
The startup/init code in `entry::install_crates` performs a lot of blocking operations, from testing if dir exists to reading from files and there is no `.await` in there until after the startup.
There are also a few cases where `block_in_place` should be called (e.g. loading manifests, loading TLS certificates) but is missing.
Most of the `Args` passed to `entry::install_crates` are actually consumed before the first `.await` point, so performing startup/init code eagerly would make the generated future much smaller, reduce codegen and also makes it easier to optimize.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
to make the pre-built artifacts auditable by `cargo-audit` and other
tools.
* Add new env `JUST_USE_AUDITABLE` to enable use of `cargo-auditable`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>