Skip to content

Rustc args: strings vs vectors & extracting link directories #149

Open
@aldanor

Description

@aldanor

@laumann

We need to parse the flags in utility methods like .clean_rmeta() which proves to be quite painful, e.g. link flags could be either -Lfoo or -L foo or -Lnative=foo, etc. The current method of splitting by whitespace is wrong and generally dangerous. It would also be hard to handle paths with spaces correctly.

One possible suggestion: instead, store flags as Vec<String>, so we can at least skip parsing quotes, whitespace, etc; each flags and its (optional) value to be stored in each element. An example would be ["-Lfoo", "-L", "foo", "-Lnative=foo"]. This would obviously be a breaking change.

Another option would be to still store flags as strings but only perform cleaning in the "default" locations (those added by the .link_deps()), but then the user folders would be ignored.

Finally, yet another option: still store flags as strings, but store link flags separately, link link_flags. It's also a little weird since then there would be an overlap.

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