Jiahao XU
d72abde8e9
Fixed #704 : Fix get_target_from_rustc
for alpine ( #705 )
...
On Alpine, rustc returns host triple `x86_64-alpine-linux-musl`, so we
have to adopt code from
[`convert_custom_linux_target`](5519aeb5c2/build-common.rs (L1-L13)
) to fix this.
* Optimize `get_target_from_rustc`: Avoid frequent String allocation
caused by `Cursor::new(stdout).lines()` which calls `BufRead::lines` and
returns `Lines` iterator, which returns `Item = io::Result<String>`.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-01-16 10:57:53 +11:00
Félix Saparelli
aea9df602c
Migrate CI and builds to Just, add "full" builds ( #660 )
2023-01-08 16:27:36 +11:00
Jiahao XU
42672ccf40
Fix detect_targets_linux
: Detect arch/libc at runtime using guess_host_triple
( #649 )
...
- Enable `guess_host_triple` on all targets
- Fix `detect_targets_linux`: Detect runtime arch/libc using
`guess_host_triple` instead of using the one specified in `TARGET`.
- Add support for android in `detect_targets`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-01-04 14:32:13 +13:00
Jiahao XU
59d79d1573
Refactor detect-targets
( #636 )
...
* Enable dep guess_host_triple for any non-linux OS
* Refactor: Rm `{windows, macos}::detect_target_*`
* Refactor `detect_targets`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-12-29 01:24:28 +00:00
Jiahao XU
31c9d4de1d
Verify target triple retrieved from rustc
is valid ( #637 )
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-12-29 13:42:54 +13:00
Jiahao XU
62e350eba9
detect-targets: Add support of MacOS universal binary ( #552 )
...
* Add support for MacOS universal bin
* Refactor: Extract new fn `macos::detect_alternative_targets`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-11-21 22:16:28 +13:00
Jiahao XU
ec2bdb551e
Use CARGO
env variable if present ( #453 )
...
* Run `$CARGO -vV` in `detect-targets` if env `CARGO` present
* Improve crate doc for `detect-targets`
* Use env var `CARGO` in `install_from_source` if present
* Test use of `CARGO` env in `tests.sh`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-10-02 04:52:25 +13:00
Jiahao XU
89869db239
Fix doc of desired_targets
( #337 )
2022-09-04 15:11:28 +00:00
Jiahao XU
b330a18d40
Change typeof Args::targets
to Option<Vec<String>>
( #327 )
...
* Change typeof `Args::targets` to `Option<Vec<String>>`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-31 16:48:15 +12:00
Jiahao XU
62f9450d2d
Refactor: Extract new crate detect-targets
and improve code quality ( #307 )
...
* Refactor: Extract new crate `detect-targets`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Refactor: Extract new mod `detect` for `detect-targets`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Refactor: Extract `desired_targets` in crate `detect-targets`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Refactor: Extract `detect::linux` in crate `detect-targets`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Refactor: Extract `detect::macos` in crate `detect-targets`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Refactor: Extract `detect::windows` in crate `detect-targets`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Add new dep cfg-if v1.0.0 for `detect-targets`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Refactor: Simplify mod declaration in `detect` using `cfg_if!`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Refactor: Simplify `detect_targets` using `cfg_if!`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Add crate doc for `detect-targets`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Enable feature "macros" of tokio in `detect-targets`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Enable feature "io-util" of dep tokio
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Rm unused feature "io-util" & "macros" of dep tokio
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Set stdin & stderr to null in `get_target_from_rustc`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Improve doc of `get_desired_targets`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Improve `detect_targets_linux`: Run `ldd` with stdin set to null
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix potential panic in `windows::detect_alternative_targets`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* FIx fmt of `detect_targets_linux`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Do not re-export dep `detect-targets` in `crates/lib`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix typo in crate doc for `detect-targets`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Enable feature "macros" of tokio in dev mode
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Add example to crate doc of `detect-targets`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Improve API `get_desired_targets`: Take `Option<&str>`
instead of `&Option<String>`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-21 22:21:33 +10:00