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

Rollup of 4 pull requests #123585

Merged
merged 13 commits into from
Apr 7, 2024
Merged

Rollup of 4 pull requests #123585

merged 13 commits into from
Apr 7, 2024

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

crazytonyli and others added 13 commits April 4, 2024 19:08
The expected value is "<arch>-apple-watchos<major>.<minor>.0", i.e.
"arm64_32-apple-watchos8.0.0".

compiler/rustc_target/src/spec/base/apple/mod.rs contains functions that
construct such string. There is an existing function
`watchos_sim_llvm_target` which returns llvm target value for watchOS
simulator. But there is none for watchOS device. This commit adds that
missing function to align watchOS with other Apple platform targets.
This test was introduced in rust-lang#118644, but was over-specified in that it assumed the path of the linker was always `cc`.
Fix a few places where these primitives were missing from librustdoc.
…st, r=fmease

Relax framework linking test

This test was introduced by myself in rust-lang#118644, but was over-specified in that it assumed the path of the linker was always `cc`, which [causes a test failure for Chromium](https://issues.chromium.org/issues/332562251).
…t, r=estebank

Fix incorrect 'llvm_target' value used on watchOS target

## Issue

`xcodebuild -create-xcframework` command doesn't recognize static libraries that are built on "arm64_32-apple-watchos" target.

Here are steps to reproduce the issue on a Mac:
1. Install nightly toolchain `nightly-2024-03-27`. Needs this specific version, because newer nightly versions are broken on watchos target.
1. Create an empty library: `mkdir watchos-lib && cd watchos-lib && cargo init --lib`.
1. Add configuration `lib.crate-type=["staticlib"]` to Cargo.toml.
1. Build the library: `cargo  nightly-2024-03-27 build --release -Zbuild-std --target arm64_32-apple-watchos`
1. Run `xcodebuild -create-xcframework` to put the static library into a xcframework, which results in an error:

```
$ xcodebuild -create-xcframework -library target/arm64_32-apple-watchos/release/libwatchos_lib.a -output test.xcframework
error: unable to determine the platform for the given binary '.../watchos-lib/target/arm64_32-apple-watchos/release/libwatchos_lib.a'; check your deployment version settings
```

## Fix

The root cause of this error is `xcodebuild` couldn't read `LC_BUILD_VERSION` from the static library to determine the library's target platform. And the reason it's missing is that an incorrect `llvm_target` value is used in `arm64_32-apple-watchos` target. The expected value is `<arch>-apple-watchos<major>.<minor>.0`, i.e. "arm64_32-apple-watchos8.0.0".

The [.../apple/mod.rs](https://github.com/rust-lang/rust/blob/43f4f2a3b1a3d3fb3dbbbe4fde33fb97c780ee98/compiler/rustc_target/src/spec/base/apple/mod.rs#L321) file contains functions that construct such string. There is an existing function `watchos_sim_llvm_target` which returns llvm target value for watchOS simulator. But there is none for watchOS device. This PR adds that missing function to align watchOS with other Apple platform targets.

To verify the fix, you can simply build a toolchain on this PR branch and repeat the steps above using the built local toolchain to verify the `xcodebuild -create-xcframework` command can create a xcframework successfully.

Furthermore, you can verify `LC_BUILD_VERSION` contains correct info by using the simple shell script below to print `LC_BUILD_VERSION` of the static library that's built on watchos target:

```shell
bin=target/arm64_32-apple-watchos/release/libwatchos_lib.a
file=$(ar -t "$bin" | grep -E '\.o$' | head -n 1)
ar -x "$bin" "$file"
vtool -show-build-version "$file"
```

Here is an example output from my machine:

```
watchos_rust-495d6aaf3bccc08d.watchos_rust.35ba42bf9255ca9d-cgu.0.rcgu.o:
Load command 1
      cmd LC_BUILD_VERSION
  cmdsize 24
 platform WATCHOS
    minos 8.0
      sdk n/a
   ntools 0
```
… r=fmease

Add `f16` and `f128` to rustdoc's `PrimitiveType`

Fix a few places where these primitives were missing from librustdoc. This should fix the CI failures from doc links in rust-lang#122470.
@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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Apr 7, 2024
@matthiaskrgr
Copy link
Member Author

@bors r rollup=never p=4

@bors
Copy link
Contributor

bors commented Apr 7, 2024

📌 Commit 549d85d has been approved by matthiaskrgr

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-review Status: Awaiting review from the assignee but also interested parties. labels Apr 7, 2024
@bors
Copy link
Contributor

bors commented Apr 7, 2024

⌛ Testing commit 549d85d with merge 8f2c255...

@bors
Copy link
Contributor

bors commented Apr 7, 2024

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 8f2c255 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 7, 2024
@bors bors merged commit 8f2c255 into rust-lang:master Apr 7, 2024
12 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Apr 7, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#123410 Relax framework linking test 7493740d58e621555aa98edb64eb769d76664ee5 (link)
#123446 Fix incorrect 'llvm_target' value used on watchOS target 0d679fe330e9f7df09b248cc6a933a866da500f6 (link)
#123579 add some more tests 0df4d37fc7a2249bc977a8e1fe4129a8be97dcda (link)
#123581 Add f16 and f128 to rustdoc's PrimitiveType 0f16779dd52676c59a4f24dd3872899de1d1f500 (link)

previous master: 0e3235f85b

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (8f2c255): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.5% [0.3%, 0.8%] 8
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

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)
2.6% [1.4%, 3.5%] 3
Regressions ❌
(secondary)
2.9% [0.7%, 6.0%] 19
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.6% [1.4%, 3.5%] 3

Cycles

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

Binary size

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

Bootstrap: 668.306s -> 667.68s (-0.09%)
Artifact size: 318.47 MiB -> 318.27 MiB (-0.06%)

@matthiaskrgr matthiaskrgr deleted the rollup-dexaj7a branch September 1, 2024 17:35
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. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants