Repository navigation
Labels
C-bugCategory: This is a bug.Category: This is a bug.O-tvosOperating system: tvOS (including simulator)Operating system: tvOS (including simulator)T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
I tried to build aarch64-apple-tvos, x86_64-apple-tvos, aarch64-apple-tvos-sim targets.
Unfortunately, I got
the following errors:
error: methods `as_raw_stat`, `st_birthtime`, `st_birthtime_nsec`, `st_flags`, `st_gen`, and `st_lspare` are never used
--> library/std/src/os/ios/fs.rs:29:8
|
15 | pub trait MetadataExt {
| ----------- methods in this trait
...
29 | fn as_raw_stat(&self) -> &raw::stat;
| ^^^^^^^^^^^
...
60 | fn st_birthtime(&self) -> i64;
| ^^^^^^^^^^^^
61 | #[stable(feature = "metadata_ext2", since = "1.8.0")]
62 | fn st_birthtime_nsec(&self) -> i64;
| ^^^^^^^^^^^^^^^^^
...
68 | fn st_flags(&self) -> u32;
| ^^^^^^^^
69 | #[stable(feature = "metadata_ext2", since = "1.8.0")]
70 | fn st_gen(&self) -> u32;
| ^^^^^^
71 | #[stable(feature = "metadata_ext2", since = "1.8.0")]
72 | fn st_lspare(&self) -> u32;
| ^^^^^^^^^
|
= note: `-D dead-code` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(dead_code)]`
error: method `set_created` is never used
--> library/std/src/os/ios/fs.rs:151:8
|
148 | pub trait FileTimesExt: Sealed {
| ------------ method in this trait
...
151 | fn set_created(self, t: SystemTime) -> Self;
| ^^^^^^^^^^^
Did not run successfully: exit status: 1
How to reproduce
./configure \
--enable-option-checking \
--tools=cargo,clippy,rustdoc,rustfmt,rust-analyzer,analysis,src \
--target=aarch64-apple-tvos,x86_64-apple-tvos,aarch64-apple-tvos-sim \
--set llvm.download-ci-llvm=true \
--set build.verbose=1 \
--set rust.channel=dev \
--dist-compression-formats=xz \
--prefix=install
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.O-tvosOperating system: tvOS (including simulator)Operating system: tvOS (including simulator)T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Activity
saethlin commentedon Feb 26, 2024
I think you can just add
--set rust.deny-warnings=false. Those look like warnings that are treated as errors in the default config.The code still needs maintenance, but maybe that unblocks you.
Rajveer100 commentedon Mar 20, 2024
@saethlin
Can you describe a bit about this?
saethlin commentedon Mar 20, 2024
tvos is a tier 3 target, which means that it may not have any CI. In this case, it looks like it doesn't. The support tiers are documented and explained here: https://doc.rust-lang.org/nightly/rustc/platform-support.html
The default build configuration used by
x.py, the bootstrap entrypoint, is to build the compiler and library with-Dwarnings. We have an option to turn this off, i.e. to treat warnings as warnings. The person who reported this issue is not actually encountering a bug, they are just tripping over an unfortunate default. Building the library and compiler withx.pyis primarily intended for developers of the compiler and standard library, not for end users. We deny warnings in CI, so the default dev setup matches CI.If you want to use the tvos targets, they build perfectly fine using
-Zbuild-std, which should be the normal way to use a Tier 3 target:cargo +nightly build -Zbuild-std --target=aarch64-apple-tvoswill locally build the standard library for the aarch64 tvOS target. The distributed rustc is a cross-compiler that supports all our targets, you never need to rebuild the compiler in order to use any of the built-in targets, meaning the contents ofrustc +nightly --print target-list.Is there something more specific you want to know?
Rajveer100 commentedon Mar 21, 2024
What's your suggestion in terms of fixing this issue?
saethlin commentedon Mar 21, 2024
As I said above.
Alternatively, you could contribute the rest of the tvos std implementation.
Rajveer100 commentedon Apr 8, 2024
@saethlin
I was actually asking in terms of opening a PR for this, what's the way to go about this?
saethlin commentedon Apr 8, 2024
Oh, are you asking because I labeled this easy 🤦
Actually making these functions used is not easy, and probably amounts to "finish the TvOS support". What I was thinking of then was that OP needs to add the flag I mentioned above, and that wherever they got that command needs to be adjusted.
Rajveer100 commentedon Apr 10, 2024
Well, no worries although I would still be happy to contribute if you think it's approachable despite it not being a good-first-issue.
saethlin commentedon Apr 10, 2024
It's approachable, but would be best done with some advice from the target maintainer, @thomcc: It looks like a bunch of filesystem metadata functions are unused in the tvos target. Is there missing implementation? Whats' the general strategy for finishing the implementation up?
Auto merge of rust-lang#125935 - madsmtm:merge-os-apple, r=workingjub…
Auto merge of #125935 - madsmtm:merge-os-apple, r=workingjubilee
Auto merge of #125935 - madsmtm:merge-os-apple, r=workingjubilee
Auto merge of rust-lang#123723 - madsmtm:apple-std-os, r=dtolnay
Auto merge of #123723 - madsmtm:apple-std-os, r=dtolnay
Auto merge of #123723 - madsmtm:apple-std-os, r=dtolnay
Auto merge of #125935 - madsmtm:merge-os-apple, r=workingjubilee
Auto merge of #123723 - madsmtm:apple-std-os, r=dtolnay