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

Docs failed to build for 0.2.5. #40

Open
mitchmindtree opened this issue Jun 25, 2020 · 2 comments
Open

Docs failed to build for 0.2.5. #40

mitchmindtree opened this issue Jun 25, 2020 · 2 comments

Comments

@mitchmindtree
Copy link
Member

I recently added the following to the Cargo.toml in the hope of fixing coreaudio-sys on docs.rs:

[package.metadata.docs.rs]
all-features = true
default-target = "x86_64-apple-darwin"
targets = ["x86_64-apple-darwin", "x86_64-apple-ios"]

However it appears that, while our CI can successfully build the docs for x86_64-apple-darwin, the docs.rs build system cannot. The docs.rs build fails with:

[INFO] [stderr] coreaudio.h:1:10: fatal error: 'AudioToolbox/AudioToolbox.h' file not found

Our github docs-check action looks like this:

  # Build the docs with all features to make sure docs.rs will work.
  macos-docs:
    runs-on: macOS-latest
    steps:
    - uses: actions/checkout@v2
    - name: Install llvm and clang
      run: brew install llvm
    - name: Install stable
      uses: actions-rs/toolchain@v1
      with:
        profile: minimal
        toolchain: stable
        override: true
    - name: cargo doc - all features
      run: cargo doc --all-features --verbose

Perhaps we need to tell docs.rs how to do the "install llvm and clang" step somehow?

I don't have time to dig deeper into this right now, but thought I'd open this in case anyone else has some ideas.

@mitchmindtree
Copy link
Member Author

I've also opened an issue at rust-lang/docs.rs#853.

@mitchmindtree
Copy link
Member Author

The problem is that docs.rs cross-compiles from Ubuntu and does not build on apple-darwin itself:

A big difference from your CI build is that docs.rs is always cross-compiling from linux, you are only able to control the target not the host. So there would need to be a way to get the required header files on the Ubuntu image used for the build.

It looks like we might benefit from solving #38 (which is currently running into the same error reported by docs.rs) and updating our docs-check action to cross-compile from Ubuntu to match the docs.rs approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant