Skip to content

Allow ruby-prism-sys to use a custom sysroot #4165

Description

@magic-akari

ruby-prism-sys already supports wasm32-wasip1 through the WASI SDK. I would also like to target freestanding WebAssembly (wasm32-unknown-unknown), where the application provides its own minimal sysroot.

This can currently be configured through CFLAGS_<target> and BINDGEN_EXTRA_CLANG_ARGS_<target>, but those variables affect every C and bindgen dependency in the same Cargo build. Vendoring ruby-prism-sys solely to pass additional compiler arguments also creates unnecessary maintenance work.

Would you accept a crate-scoped RUBY_PRISM_CFLAGS option whose arguments are applied consistently to both cc::Build and bindgen::Builder?

This would allow freestanding builds to provide options such as:

  • --sysroot=/path/to/sysroot
  • additional include paths with -I
  • Prism configuration macros such as -DPRISM_HAS_NO_FILESYSTEM=1

without affecting unrelated C or bindgen dependencies.

I would be happy to submit a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions