Skip to content

Encoded CFLAGS for supporting spaces #847

@MarijnS95

Description

@MarijnS95

According to https://github.com/rust-lang/cc-rs/#external-configuration-via-environment-variables spaces nor escapes for spaces are not supported in e.g. C(XX)FLAGS. In xbuild we use CFLAGS to set a --sysroot path, and this can occasionally contain spaces on Windows machines (because the toolchain is unpacked to a user folder, and users like to have Firstname Surname as username and profile directory).

A likable solution is new CARGO_ENCODED_RUSTFLAGS-like variables, where spaces within individual args are supported by requiring the user to replace space delimiters in between separate arguments with the \x1f ASCII Unit Separator: https://doc.rust-lang.org/cargo/reference/environment-variables.html, to allow more mechanical piecing-together of these variables without messing around with nested quotes or backslash-escapes.

Referencing rust-mobile/xbuild#124, where this is one of the deciding factors to build our Android compiler support differently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions