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 --print host-triple to print host target triple #125579

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Noratrieb
Copy link
Member

People often parse -vV output to get to the host triple, which is annoying to do. It's easier to just get it directly.

I called it "host-triple" instead of "host" because it's clearer that it's just the target name. I'm open to different names, but I think this one is fine.

a quick GitHub search for '^host reveals many instances of people doing the parsing, for example:

https://github.com/japaric/xargo/blob/68e0ca57cd90837fe02f262f074182f9cfeb6227/README.md?plain=1#L369
https://github.com/taiki-e/setup-cross-toolchain-action/blob/0e38473b0c562d6db19a98d3ec20a80f7ac189ae/main.sh#L96
https://github.com/taiki-e/cargo-llvm-cov/blob/8a3553b86551eabf9c30c060b1f72a5bbccb98c6/README.md?plain=1#L625
https://github.com/SiliconLabs/cpc-nvm3/blob/43f3ec39709b30700ef7f39d91fa647974323bf1/do.sh#L35

needs a compiler FCP. I could also do an MCP but I think just an FCP here makes the most sense.

@Noratrieb Noratrieb added the needs-fcp This change is insta-stable, so needs a completed FCP to proceed. label May 26, 2024
@rustbot
Copy link
Collaborator

rustbot commented May 26, 2024

r? @oli-obk

rustbot has assigned @oli-obk.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 26, 2024
@rust-log-analyzer

This comment has been minimized.

People often parse `-vV` output to get to the host triple, which is
annoying to do. It's easier to just get it directly.

I called it "host-triple" instead of "host" because it's clearer that
it's just the target name.
@workingjubilee
Copy link
Member

workingjubilee commented May 26, 2024

I would prefer host-tuple, so we don't have to stress about ontologies if the tuple happens to have 2 or 5. I am not the only one who has noticed this, and we also use tools that refer to them as target tuples. ( And as far as I can tell this would be the first stable API that explicitly names the concept beyond "target". )

@bjorn3
Copy link
Member

bjorn3 commented May 27, 2024

a quick GitHub search for '^host reveals many instances of people doing the parsing, for example:

Cargo also does this.

@oli-obk
Copy link
Contributor

oli-obk commented May 27, 2024

@rfcbot merge

@rfcbot
Copy link

rfcbot commented May 27, 2024

Team member @oli-obk has proposed to merge this. The next step is review by the rest of the tagged team members:

Concerns:

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rfcbot rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels May 27, 2024
@lcnr
Copy link
Contributor

lcnr commented May 27, 2024

@rfcbot concern triple vs tuple

#125579 (comment)

@michaelwoerister
Copy link
Member

As a data point, our existing documentation seem to call it "triple" pretty consistently:
https://doc.rust-lang.org/rustc/?search=triple
https://doc.rust-lang.org/cargo/index.html?search=triple
https://doc.rust-lang.org/reference/?search=triple

@bors

This comment was marked as resolved.

@apiraino
Copy link
Contributor

apiraino commented Jul 18, 2024

So, should that be "tuple" or "triple"?

(trying to understand if the concern raised is still standing)

@lcnr
Copy link
Contributor

lcnr commented Jul 18, 2024

I personally don't have a strong opinion here and would be open to rescind my concern

  • tuple is more accurate as some targets don't use exactly 3 words
  • triple is currently the used terminology, though it seems to only be internal

https://doc.rust-lang.org/rustc/platform-support/loongarch-linux.html?highlight=tuple#loongarch-unknown-linux- already uses tuple

@michaelwoerister @workingjubilee does one of you care strongly about either option? It is fairly arbitrary in the end (and its documentation should probably mention the alternative).

One simple way to resolve this might just be a vote on zulip and we pick whatever ends up on top as long as nobody feels very strongly about this: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/.60--print.20host.5B-tuple.7C-triple.5D.60

@michaelwoerister
Copy link
Member

I voted "don't care" on Zulip.

@oli-obk
Copy link
Contributor

oli-obk commented Jul 25, 2024

r? compiler

@rustbot rustbot assigned davidtwco and unassigned oli-obk Jul 25, 2024
@davidtwco
Copy link
Member

I don't think there's necessarily a strong consensus from the Zulip poll on terminology here, the team seems to have a slight preference towards host-tuple, do you want to change it to that @Noratrieb?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. needs-fcp This change is insta-stable, so needs a completed FCP to proceed. proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.