inflation / vapoursynth4-rs

A safe wrapper for Vapoursynth v4 API
6 stars 2 forks source link

Target stable channel, add build job, more features usage #4

Closed sgt0 closed 5 months ago

sgt0 commented 5 months ago

This started with just a small fix to building on nightly and turned into a bit more, sorry. I separated each thing into individual commits to make it easier to review.

So on 1.79.0-nightly (3a36386dc 2024-04-25), there's the follow build error:

error: `std::ptr::mut_ptr::<impl *mut T>::copy_from_nonoverlapping` is not yet stable as a const fn
   --> vapoursynth4-sys\src\helper.rs:179:13
    |
179 |             dstp.copy_from_nonoverlapping(srcp, row_size * height);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: add `#![feature(const_intrinsic_copy)]` to the crate attributes to enable

#![feature] can only be used on nightly though, so adding this would make the project not build on stable or beta. I'm not sure what's desired here, but since most of the CI jobs were using nightly, I'm assuming that's what we want so I added the #![feature].

I then added a rust-toolchain.toml to indicate to rustup that this project requires nightly stable. Should help future developers know what toolchain to install.


Then come the less-related changes that I should've split out, and I still can if we want, but:

I put set_api_default() and set_api() behind the link-library feature, which I believe fixes https://github.com/inflation/vapoursynth4-rs/issues/2, or at least it does for me.

I also added a build job to verify everything builds properly on nightly stable.

The coverage and sanitizer jobs are unfortunately gonna fail. They try to link to VS (because they use --all-features, enabling link-library), so I added rlaphoenix/install-vapoursynth-action to install VS, but that action builds VS without VSScript so linking to vapoursynth-script will fail. I couldn't find an easy way to recursively disable default features (because we need to disable vsscript from sample-plugin > vapoursynth4-rs > vapoursynth4-sys), so I'm just gonna leave the jobs alone.

inflation commented 5 months ago

The CI jobs only use nightly for code coverage and sanitizers. So I don't want to make this project nightly only without a potential advantage.

sgt0 commented 5 months ago

Alright, removed the #![feature] and targeted stable.

sgt0 commented 5 months ago

Looks like most of this was handled in other PRs.