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 OpenHarmony targets #108792

Merged
merged 1 commit into from
Mar 29, 2023
Merged

Add OpenHarmony targets #108792

merged 1 commit into from
Mar 29, 2023

Conversation

Amanieu
Copy link
Member

@Amanieu Amanieu commented Mar 5, 2023

  • aarch64-unknown-linux-ohos
  • armv7-unknown-linux-ohos

Compiler team MCP: rust-lang/compiler-team#568

@rustbot
Copy link
Collaborator

rustbot commented Mar 5, 2023

r? @ehuss

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 5, 2023
@rustbot
Copy link
Collaborator

rustbot commented Mar 5, 2023

These commits modify compiler targets.
(See the Target Tier Policy.)

These commits modify the Cargo.lock file. Random changes to Cargo.lock can be introduced when switching branches and rebasing PRs.
This was probably unintentional and should be reverted before this PR is merged.

If this was intentional then you can ignore this comment.

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@Amanieu Amanieu marked this pull request as draft March 5, 2023 23:29
@workingjubilee
Copy link
Member

I hate to be a pedantic bore about minor points of protocol that mostly don't really matter, but I was cursed at birth with an editor's eyes:

Recently, {arch}-fuchsia was changed to {arch}-unknown-fuchsia for Toolchain Reasons. Are we sure we want to skip the vendor "field" in this tuple?

@ehuss
Copy link
Contributor

ehuss commented Mar 6, 2023

r? compiler

@rustbot rustbot assigned petrochenkov and unassigned ehuss Mar 6, 2023
@Amanieu
Copy link
Member Author

Amanieu commented Mar 6, 2023

Recently, {arch}-fuchsia was changed to {arch}-unknown-fuchsia for Toolchain Reasons. Are we sure we want to skip the vendor "field" in this tuple?

I really don't feel too strongly about it. The C toolchain uses aarch64-linux-ohos but then again so do many toolchains for which we use -unknown. In the end it's just a naming thing and doesn't really matter.

@workingjubilee
Copy link
Member

Yeah, I don't really care either, my only preference is against name churn. So I just wanted to ask if anyone had doublechecked that, as "C toolchain" might mean "Clang", and I don't know if the same rationales as in #106429 will or will not apply because I'm just another ignorant 外国人 who only heard of OpenHarmony today.

@rust-log-analyzer

This comment has been minimized.

@petrochenkov petrochenkov marked this pull request as ready for review March 6, 2023 14:07
@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 6, 2023
@Amanieu
Copy link
Member Author

Amanieu commented Mar 9, 2023

Updated to libc 0.2.140 which has OpenHarmony support. This is now ready for review.

The only remaining question is whether to name the targets *-linux-ohos or *-unknown-linux-ohos. The Clang toolchain uses *-linux-ohos but other Rust targets add -unknown- for an explicit vendor.

@tmandry @djkoloski Do you have any thoughts since the same issue came up with fuchsia?

@djkoloski
Copy link
Contributor

djkoloski commented Mar 9, 2023

In our case, we added vendor info to Fuchsia's triples to bring them in line with other triples. Clang actually supports both x86_64-fuchsia and x86_64-unknown-fuchsia, and IIRC it does so by parsing targets and filling in implied or default info. Rust just matches on the triple, which is less flexible. So if memory serves, clang should already support triples with and without vendor info for OpenHarmony.

Right now Rust still has the old set of Fuchsia triples (doubles) as an alias for the new ones (actual triples), but those are on the way out.

@Amanieu Amanieu force-pushed the ohos branch 3 times, most recently from 9190662 to 479cdbe Compare March 10, 2023 23:27
@bors

This comment was marked as resolved.

@tmandry
Copy link
Member

tmandry commented Mar 21, 2023

To add to what @djkoloski said, we consider x86_64-unknown-fuchsia to be the "canonical" triple for both clang and now rustc. Consistency with other targets and across compilers (or frontend/backend) is desirable.

If rustc also supported dropping vendor info for any target where it's unknown that would be fine, but you would have to decide if you want to handle that in rustup and possibly other places. For now we just went with what's most consistent.

@Amanieu
Copy link
Member Author

Amanieu commented Mar 27, 2023

I've renamed the OpenHarmony targets to include a -unknown- vendor component. They are now consistent with the other Linux targets (except for Android).

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 27, 2023
@petrochenkov
Copy link
Contributor

r=me after squashing commits.
@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 28, 2023
- `aarch64-unknown-linux-ohos`
- `armv7-unknown-linux-ohos`
@Amanieu
Copy link
Member Author

Amanieu commented Mar 28, 2023

@bors r=petrochenkov

@bors
Copy link
Contributor

bors commented Mar 28, 2023

📌 Commit e3968be has been approved by petrochenkov

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 28, 2023
@bors
Copy link
Contributor

bors commented Mar 29, 2023

⌛ Testing commit e3968be with merge f346fb0...

@bors
Copy link
Contributor

bors commented Mar 29, 2023

☀️ Test successful - checks-actions
Approved by: petrochenkov
Pushing f346fb0 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 29, 2023
@bors bors merged commit f346fb0 into rust-lang:master Mar 29, 2023
@rustbot rustbot added this to the 1.70.0 milestone Mar 29, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f346fb0): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.7% [1.7%, 1.7%] 2
Regressions ❌
(secondary)
2.4% [1.1%, 8.5%] 11
Improvements ✅
(primary)
-2.4% [-2.4%, -2.4%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [-2.4%, 1.7%] 3

Cycles

This benchmark run did not return any relevant results for this metric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants