Skip to content

Can the build script be removed or reduced? #208

@hanna-kruppe

Description

@hanna-kruppe

I was wondering what the build script is needed for, because any build script invites some scrutiny and makes build times slightly worse (especially if the library otherwise has no dependencies!). From a quick look, everything done in the build script seems replaceable:

  • Rust version check for AArch64 SIMD intrinsics which were stabilized after MSRV (1.47 vs. 1.59). I didn't find anything written down about how MSRV is determined and when it can be increased, but even the very conservative policy of "whatever a year-old Debian stable supports" would allow 1.63 nowadays.
  • Checking and setting a bunch of ad-hoc cfgs to control whether SIMD is used at all and how it's detected. I believe all of these could be just spelled out in the source code with normal #[cfg(...)] expressions, though this may be somewhat more complex and will lose the warnings that the build script emits. But maybe this is a good chance to reconsider which of these knobs are actually needed: I find it hard to imagine someone relying on them for anything but one-off tests and tolerating the resulting warnings on every build.
  • Something about cfg(target_feature=....) being unstable, which was true at the time that comment was written but hasn't been true since Rust 1.27.
  • Printing some warnings if SIMD usage is disable due to lack of std feature or running under Miri. These don't have any non-build-script equivalent, but if they'd be the only remaining reason to have a build script, then they don't seem important to keep around in my view. But even if they're left in, the build script would be much smaller and simpler than today.

I might try my hand on some of these changes (no promises though!) but of course that doesn't make any sense if you'd rather keep the build script's functionality as-is.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions