Skip to content
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

Add --cxx flag #2269

Closed
wants to merge 1 commit into from
Closed

Add --cxx flag #2269

wants to merge 1 commit into from

Conversation

pvdrz
Copy link
Contributor

@pvdrz pvdrz commented Sep 9, 2022

Addresses #1456

Copy link
Member

@kulp kulp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@bors-servo
Copy link

☔ The latest upstream changes (presumably 4b006da) made this pull request unmergeable. Please resolve the merge conflicts.

Copy link
Contributor

@emilio emilio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not particularly opposed to this, but how does this address #1456?

In that issue, the user was using the Builder API to use c++ directly. I think to address that we should probably either adjust the docs to provide an example that passes the two arguments separately, or maybe just add an add_cxx_flags API there that effectively does clang_args(["-x", "c++"]). But honestly I think the example would be more than enough.

@pvdrz
Copy link
Contributor Author

pvdrz commented Sep 23, 2022

I'd say that if someone asks for c++ support and the answer is

just add the cxx arg

There is less chance for error than with

just add the -x c++ clang arg

regardless of what documentation says.

I don't have super strong opinions about this feature so I'm OK with not merging this.

@kulp
Copy link
Member

kulp commented Sep 24, 2022

See also #1852 and #1855; "-x c++" seems to be a papercut for more than one person.

I do think this PR might "address" (in the sense of mitigating) #1456, but not close it. I had assumed that was why @pvdrz used the term "address" anyway.

@emilio
Copy link
Contributor

emilio commented Sep 24, 2022

I'd say that if someone asks for c++ support and the answer is

just add the cxx arg

There is less chance for error than with

just add the -x c++ clang arg

regardless of what documentation says.

Not really, --cxx is not a clang-arg (it's a bindgen arg), so if you use clang_args(["--cxx"]) it'll error, right? Or am I missing something?

@pvdrz
Copy link
Contributor Author

pvdrz commented Sep 24, 2022

I'd say that if someone asks for c++ support and the answer is

just add the cxx arg

There is less chance for error than with

just add the -x c++ clang arg

regardless of what documentation says.

Not really, --cxx is not a clang-arg (it's a bindgen arg), so if you use clang_args(["--cxx"]) it'll error, right? Or am I missing something?

Yeah we agree on that. My point is that using clang args is more error prone while regular args are not as there is no way to set arbitrary arguments for bindgen but we can add the invalid "-x c++" argument for clang.

@emilio
Copy link
Contributor

emilio commented Oct 4, 2022

Right, but the original issue was about the library usage, so this patch doesn't change anything there afaict.

@pvdrz
Copy link
Contributor Author

pvdrz commented Oct 4, 2022

this also includes a .cxx() method @emilio

@bors-servo
Copy link

☔ The latest upstream changes (presumably #2284) made this pull request unmergeable. Please resolve the merge conflicts.

@bors-servo
Copy link

☔ The latest upstream changes (presumably b3ac3ef) made this pull request unmergeable. Please resolve the merge conflicts.

@pvdrz pvdrz closed this Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants