coreaudio-sys icon indicating copy to clipboard operation
coreaudio-sys copied to clipboard

Docs failed to build for 0.2.5.

Open mitchmindtree opened this issue 5 years ago • 2 comments

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 avatar Jun 25 '20 10:06 mitchmindtree

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

mitchmindtree avatar Jun 25 '20 10:06 mitchmindtree

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 RustAudio/coreaudio-sys#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.

mitchmindtree avatar Jun 25 '20 10:06 mitchmindtree