* Specify classes as fully-qualified names in stubs
When stubs are generated, the type annotations don't use a loading `\`, which means they are interpreted as relative to the current namespace. That's wrong, as all types are relative to the root namespace.
* rustfmt
This should fix the errors from the build at
<https://github.com/davidcole1340/ext-php-rs/actions/runs/3145521955/jobs/5112909446>:
Compiling clap v4.0.0
error: Unknown `#[clap(long)]` attribute (`#[arg(long)] exists)
--> crates/cli/src/lib.rs:92:12
|
92 | #[clap(long)]
| ^^^^
error: Unknown `#[clap(long)]` attribute (`#[arg(long)] exists)
--> crates/cli/src/lib.rs:115:12
|
115 | #[clap(long)]
| ^^^^
error: Unknown `#[clap(short)]` attribute (`#[arg(short)] exists)
--> crates/cli/src/lib.rs:134:12
|
134 | #[clap(short, long)]
| ^^^^^
error: could not compile `cargo-php` due to 3 previous errors
warning: build failed, waiting for other jobs to finish...
Error: Process completed with exit code 101.
These errors were probably caused by the release of `clap` 4.0.0
a few hours ago.
Clippy linting had some errors:
error: boolean to int conversion using if
Error: --> src/builders/module.rs:59:29
|
59 | zend_debug: if PHP_DEBUG { 1 } else { 0 },
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with from: `u8::from(PHP_DEBUG)`
|
= note: `-D clippy::bool-to-int-with-if` implied by `-D warnings`
= note: `PHP_DEBUG as u8` or `PHP_DEBUG.into()` can also be valid options
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_to_int_with_if
error: boolean to int conversion using if
Error: --> src/builders/module.rs:60:22
|
60 | zts: if PHP_ZTS { 1 } else { 0 },
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with from: `u8::from(PHP_ZTS)`
|
= note: `PHP_ZTS as u8` or `PHP_ZTS.into()` can also be valid options
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_to_int_with_if
error: could not compile `ext-php-rs` due to 2 previous errors
This commit tries to fix those.
* Preliminary Windows support
* Start work on cross-platform build script
* Fix compilation on macOS
* Updated README, tidied up build script
* Check linker version before starting compilation
It doesn't seem like it's possible to change the linker from within the
build script, however, we can retrieve the linker in use and give the
user a suggestion if the linker will not work.
* Switch to using Github repository for bindgen
* Split Windows and Unix implementations into two files
* Fix building on Windows
* Remove `reqwest` and `zip` as dependencies on Unix
* Fix guide tests on Windows
* Started work on Windows CI
* runs -> run
* Use preinstalled LLVM on Windows
* Debugging for Windows CI
* Switch to upstream `rust-bindgen` master branch
* Switch to `rust-lld` for Windows linking
* Don't compile `cargo-php` on Windows
* Switch to using skeptic for tests
* cargo-php: Disable stub generation, fix ext install/remove
The plan is to replace the stub generation by generating them with PHP
code. This is cross-platform and means we don't need to worry about ABI.
We also don't need to embed information into the library.
* cargo-php: Fix on unix OS
* Fix clippy lint
* Updated README
* Re-add CI for Unix + PHP 8.0
* Fix building on thread-safe PHP
* Tidy up build scripts
* Use dynamic lookup on Linux, test with TS Windows
* Define `ZTS` when compiling PHP ZTS
* Combine Windows and Unix CI, fix linking for Win32TS
* Fix exclusions in build CI
* rust-toolchain -> rust
* Set LLVM version
* Only build docs.rs on Ubuntu PHP 8.1
* Fix build on Linux thread-safe
* Update guide example
* Attempt to fix CI on macOS by not installing LLVM
* Download LLVM even on macOS
* Only set LIBCLANG_PATH on non-macOS
* Fix yaml
* Try to set SDK path for macOS
* Multi-line run
* Clippy lint
* Only check docs on PHP 8.1
* When running with docs stub, use PHP 8.1
* Only build docs on Ubuntu
* Remove `macos-ci` branch from actions
* Trigger actions