-
Notifications
You must be signed in to change notification settings - Fork 451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accpet OsStr
instead of str
for flags
#1100
Conversation
It is possible that the environment variable contains non-utf8 charactes Signed-off-by: Jiahao XU <[email protected]>
… Error>` Signed-off-by: Jiahao XU <[email protected]>
Signed-off-by: Jiahao XU <[email protected]>
Signed-off-by: Jiahao XU <[email protected]>
…_modifiers` Signed-off-by: Jiahao XU <[email protected]>
Signed-off-by: Jiahao XU <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely a good idea!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with this but I have just one query really. Not a blocker though.
src/lib.rs
Outdated
#[deprecated(since = "1.0.100", note = "please use `cpp_link_stdlib_path` instead")] | ||
pub fn cpp_link_stdlib<'a, V: Into<Option<&'a str>>>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we absolutely have to deprecate this rather than, I dunno, doing some special trait shenanigans so it works with str but OsStr also works? Maybe we do but it seems unfortunate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No I don't think we can, Into< Option<&str>>
prevents this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is unfortunate. It's usually not a path, but a literal "c++"
or "stdc++"
so I don't know that deprecating this is worth it.
Edit: People who really care can just link the c++ stdlib as a normal library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will revert that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've reverted changes to cpp_{set, link}_stdlib
according to review feedback of @thomcc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unsure about the deprecation.
src/lib.rs
Outdated
#[deprecated(since = "1.0.100", note = "please use `cpp_link_stdlib_path` instead")] | ||
pub fn cpp_link_stdlib<'a, V: Into<Option<&'a str>>>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is unfortunate. It's usually not a path, but a literal "c++"
or "stdc++"
so I don't know that deprecating this is worth it.
Edit: People who really care can just link the c++ stdlib as a normal library.
Signed-off-by: Jiahao XU <[email protected]>
Signed-off-by: Jiahao XU <[email protected]>
Just note that this is a breaking change: https://github.com/servo/servo/actions/runs/9672905431/job/26686002372?pr=32616#step:12:441 |
Oops looks like cargo-semver-check missed this one cc @obi1kenobi
looks like we would have to revert the change to the interface and add a set of new interface to accept OsStr |
@sagudev It is unfortunate that AsRef does not work for Cow<', str>, however looking at the log, it seems that they are converting an OsStr to Cow<', str> to workaround a past limiation of our interface. maybe the best way forward is to pass the OsStr directly? |
Yes, indeed. I just wanted to warn that this is a breaking change, although trivial to fix on our side, there might be more crates affected by this. |
Thank you, now that we have released 1.0.100, I'm not sure if we should yank and then revert its interface, that could break people on new releases. On the other hand, most people are probably using old version and has yet update, so maybe we could still yank and revert? |
It's probably worth yanking rather than breaking semver if we have a way to avoid breaking semver. |
Eh, At this point we've probably missed the boat for this to be a good candidate for yanking. I may change my mind if more reports of bustage come in though. |
Yup, it can't currently check anything related to changes in types: https://predr.ag/blog/four-challenges-cargo-semver-checks-has-yet-to-tackle/#surprising-limitation-no-checking-of-types It's tied to the next point in that blog post: a lack of sustainable project funding. I'd love to build type-aware checks, but that requires being able to pay my rent with For any folks negatively affected by this issue, please remember:
Companies, I'd love to put your logo on the |
Fixed #1018