Skip to content

Failed to build aarch64-apple-tvos target #121640

Description

@arttet

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

According to the docs, the target maintainer is @thomcc

Activity

  1. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Feb 26, 2024
  2. added
    T-libsRelevant to the library team, which will review and decide on the PR/issue.
    Libs-SmallLibs issues that are considered "small" or self-contained
    O-tvosOperating system: tvOS (including simulator)
    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
    and removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Feb 26, 2024
  3. saethlin commented on Feb 26, 2024

    @saethlin
    Member

    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.

  4. Rajveer100 commented on Mar 20, 2024

    @Rajveer100
    Contributor

    @saethlin
    Can you describe a bit about this?

  5. saethlin commented on Mar 20, 2024

    @saethlin
    Member

    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 with x.py is 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-tvos will 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 of rustc +nightly --print target-list.

    Is there something more specific you want to know?

  6. Rajveer100 commented on Mar 21, 2024

    @Rajveer100
    Contributor

    What's your suggestion in terms of fixing this issue?

  7. saethlin commented on Mar 21, 2024

    @saethlin
    Member

    add --set rust.deny-warnings=false

    As I said above.

    Alternatively, you could contribute the rest of the tvos std implementation.

  8. Rajveer100 commented on Apr 8, 2024

    @Rajveer100
    Contributor

    Can you describe a bit about this?

    @saethlin
    I was actually asking in terms of opening a PR for this, what's the way to go about this?

  9. saethlin commented on Apr 8, 2024

    @saethlin
    Member

    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.

  10. removed
    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
    Libs-SmallLibs issues that are considered "small" or self-contained
    on Apr 8, 2024
  11. Rajveer100 commented on Apr 10, 2024

    @Rajveer100
    Contributor

    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.

  12. saethlin commented on Apr 10, 2024

    @saethlin
    Member

    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?

  13. added a commit that references this issue on Jul 14, 2024
  14. added a commit that references this issue on Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.O-tvosOperating system: tvOS (including simulator)T-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions