Bug 1530715 Comment 4 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

### Building [cubeb-coreaudio-rs][0] within gecko

#### Steps
0. `cd` to the gecko source code folder
1. Import [cubeb-coreaudio-rs][0] into *gecko* by
    - Apply attachment 9046751 [details] [diff] [review] and run `cd <gecko-source>/media/libcubeb/cubeb-coreaudio-rs/ && sh update.sh <upstream_src_directory>`
        - `<gecko-source>` is the path of the gecko source folder
        - `<upstream_src_directory>` is the path of [cubeb-coreaudio-rs][0] repo
    - or git clone [cubeb-coreaudio-rs][0] directly under *<gecko-source>/media/libcubeb*
2. Build [cubeb-coreaudio-rs][0] within *gkrust-shared* and call it via *cubeb.c*
    - Apply attachment 9046753 [details] [diff] [review]
3. Update *gkrust-shared* and load dependencies of [cubeb-coreaudio-rs][0] into *third_party/rust/*
    - Run `$ cargo update -p gkrust-shared && ./mach vendor rust --ignore-modified`, under *<gecko-source>*
4. Build gecko
    - Run `$ ./mach build`

#### Notes

- [Customizing *coreaudio-sys*][1]
  - [meet][2] the [*bindgen* version used in *gecko*][3], or it may need to add another *bindgen* into the [buildtime whitelist][whitelist]
  - To avoid [build error on 10.13.6 (High Sierra)][4], using [the `features` cubeb-coreaudio-rs needs explicitly][5]

[0]: https://github.com/ChunMinChang/cubeb-coreaudio-rs
[1]: https://github.com/ChunMinChang/coreaudio-sys/tree/gecko-build
[2]: https://github.com/ChunMinChang/coreaudio-sys/commit/dd3043ee5a301771d62ba015decdb1de8421a9b0
[3]: https://searchfox.org/mozilla-central/rev/dbddac86aadf1d4871fb350bbe66db43728a9f81/third_party/rust/bindgen/Cargo.toml#15
[4]: https://github.com/RustAudio/coreaudio-sys/issues/19#issuecomment-467225004
[5]: https://github.com/ChunMinChang/cubeb-coreaudio-rs/blob/642857dadd83e806ce47890265d16e18e0c3c418/Cargo.toml
[whitelist]: https://searchfox.org/mozilla-central/rev/dbddac86aadf1d4871fb350bbe66db43728a9f81/python/mozbuild/mozbuild/vendor_rust.py#158
### Building [cubeb-coreaudio-rs][0] within gecko

#### Steps
0. `cd` to the gecko source code folder
1. Import [cubeb-coreaudio-rs][0] into *gecko* by
    - Apply attachment 9046751 [details] [diff] [review] and run `cd <gecko-source>/media/libcubeb/cubeb-coreaudio-rs/ && sh update.sh <upstream_src_directory>`
        - `<gecko-source>` is the path of the gecko source folder
        - `<upstream_src_directory>` is the path of [cubeb-coreaudio-rs][0] repo
    - or git clone [cubeb-coreaudio-rs][0] directly under *<gecko-source>/media/libcubeb*
2. Build [cubeb-coreaudio-rs][0] within *gkrust-shared* and call it via *cubeb.c*
    - Apply attachment 9046753 [details] [diff] [review]
3. Update *gkrust-shared* and load dependencies of [cubeb-coreaudio-rs][0] into *third_party/rust/*
    - Run `$ cargo update -p gkrust-shared && ./mach vendor rust --ignore-modified`, under *<gecko-source>*
4. Build gecko
    - Run `$ ./mach build`

#### Notes

- [Customize *coreaudio-sys*][1] for [cubeb-coreaudio-rs][6]
  - [meet][2] the [*bindgen* version used in *gecko*][3], or it may need to add another *bindgen* into the [buildtime whitelist][whitelist]
  - To avoid [build error on 10.13.6 (High Sierra)][4], using [the `features` cubeb-coreaudio-rs needs explicitly][5]

[0]: https://github.com/ChunMinChang/cubeb-coreaudio-rs
[1]: https://github.com/ChunMinChang/coreaudio-sys/tree/gecko-build
[2]: https://github.com/ChunMinChang/coreaudio-sys/commit/dd3043ee5a301771d62ba015decdb1de8421a9b0
[3]: https://searchfox.org/mozilla-central/rev/dbddac86aadf1d4871fb350bbe66db43728a9f81/third_party/rust/bindgen/Cargo.toml#15
[4]: https://github.com/RustAudio/coreaudio-sys/issues/19#issuecomment-467225004
[5]: https://github.com/ChunMinChang/cubeb-coreaudio-rs/blob/642857dadd83e806ce47890265d16e18e0c3c418/Cargo.toml
[whitelist]: https://searchfox.org/mozilla-central/rev/dbddac86aadf1d4871fb350bbe66db43728a9f81/python/mozbuild/mozbuild/vendor_rust.py#158
[6]: https://github.com/ChunMinChang/cubeb-coreaudio-rs/blob/2d19e722a71a9f7459e87c1fc5281f1a9dedcce6/Cargo.toml#L16
### Building [cubeb-coreaudio-rs][0] within gecko

#### Steps
0. `cd` to the gecko source code folder
1. Import [cubeb-coreaudio-rs][0] into *gecko* by
    - Apply attachment 9048724 [details] [diff] [review] and run `cd <gecko-source>/media/libcubeb/cubeb-coreaudio-rs/ && sh update.sh <upstream_src_directory>`
        - `<gecko-source>` is the path of the gecko source folder
        - `<upstream_src_directory>` is the path of [cubeb-coreaudio-rs][0] repo
    - or git clone [cubeb-coreaudio-rs][0] directly under *<gecko-source>/media/libcubeb*
2. Build [cubeb-coreaudio-rs][0] within *gkrust-shared* and call it via *cubeb.c*
    - Apply attachment 9046753 [details] [diff] [review]
3. Update *gkrust-shared* and load dependencies of [cubeb-coreaudio-rs][0] into *third_party/rust/*
    - Run `$ cargo update -p gkrust-shared && ./mach vendor rust --ignore-modified`, under *<gecko-source>*
4. Build gecko
    - Run `$ ./mach build`

#### Notes

- [Customize *coreaudio-sys*][1] for [cubeb-coreaudio-rs][6]
  - [meet][2] the [*bindgen* version used in *gecko*][3], or it may need to add another *bindgen* into the [buildtime whitelist][whitelist]
  - To avoid [build error on 10.13.6 (High Sierra)][4], using [the `features` cubeb-coreaudio-rs needs explicitly][5]
  - The *Rust* *FFI* bindings to *C* APIs are generated from [*bindgen*][bindgen] if it's possible. The path of the APIs' headers need to be fed into the *bindgen*. However, we might have no ideas where those headers are ,e.g., running on a macos within a virtual machine based on a Linux server (macos on tryserver). In that case, we use a *fullback raw bindings* that are generated from *bindgen* in advance and use `link` attribute linkings the bindings to C APIs. [Here][cross-compile-issue] is an example.

[0]: https://github.com/ChunMinChang/cubeb-coreaudio-rs
[1]: https://github.com/ChunMinChang/coreaudio-sys/tree/gecko-build
[2]: https://github.com/ChunMinChang/coreaudio-sys/commit/dd3043ee5a301771d62ba015decdb1de8421a9b0
[3]: https://searchfox.org/mozilla-central/rev/dbddac86aadf1d4871fb350bbe66db43728a9f81/third_party/rust/bindgen/Cargo.toml#15
[4]: https://github.com/RustAudio/coreaudio-sys/issues/19#issuecomment-467225004
[5]: https://github.com/ChunMinChang/cubeb-coreaudio-rs/blob/642857dadd83e806ce47890265d16e18e0c3c418/Cargo.toml
[whitelist]: https://searchfox.org/mozilla-central/rev/dbddac86aadf1d4871fb350bbe66db43728a9f81/python/mozbuild/mozbuild/vendor_rust.py#158
[6]: https://github.com/ChunMinChang/cubeb-coreaudio-rs/blob/2d19e722a71a9f7459e87c1fc5281f1a9dedcce6/Cargo.toml#L16
[bindgen]: https://github.com/rust-lang/rust-bindgen
[cross-compile-issue]: https://github.com/RustAudio/coreaudio-sys/issues/23#issuecomment-468847361
### Building [cubeb-coreaudio-rs][0] within gecko

#### Steps
0. `cd` to the gecko source code folder
1. Import [cubeb-coreaudio-rs][0] into *gecko* by
    - Apply attachment 9048724 [details] [diff] [review] and run `cd <gecko-source>/media/libcubeb/cubeb-coreaudio-rs/ && sh update.sh <upstream_src_directory>`
        - `<gecko-source>` is the path of the gecko source folder
        - `<upstream_src_directory>` is the path of [cubeb-coreaudio-rs][0] repo
    - or git clone [cubeb-coreaudio-rs][0] directly under *<gecko-source>/media/libcubeb*
2. Build [cubeb-coreaudio-rs][0] within *gkrust-shared* and call it via *cubeb.c*
    - Apply attachment 9048726 [details] [diff] [review]
3. Update *gkrust-shared* and load dependencies of [cubeb-coreaudio-rs][0] into *third_party/rust/*
    - Run `$ cargo update -p gkrust-shared && ./mach vendor rust --ignore-modified`, under *<gecko-source>*
4. Build gecko
    - Run `$ ./mach build`

#### Notes

- [Customize *coreaudio-sys*][1] for [cubeb-coreaudio-rs][6]
  - [meet][2] the [*bindgen* version used in *gecko*][3], or it may need to add another *bindgen* into the [buildtime whitelist][whitelist]
  - To avoid [build error on 10.13.6 (High Sierra)][4], using [the `features` cubeb-coreaudio-rs needs explicitly][5]
  - The *Rust* *FFI* bindings to *C* APIs are generated from [*bindgen*][bindgen] if it's possible. The path of the APIs' headers need to be fed into the *bindgen*. However, we might have no ideas where those headers are ,e.g., running on a macos within a virtual machine based on a Linux server (macos on tryserver). In that case, we use a *fullback raw bindings* that are generated from *bindgen* in advance and use `link` attribute linkings the bindings to C APIs. [Here][cross-compile-issue] is an example.

[0]: https://github.com/ChunMinChang/cubeb-coreaudio-rs
[1]: https://github.com/ChunMinChang/coreaudio-sys/tree/gecko-build
[2]: https://github.com/ChunMinChang/coreaudio-sys/commit/dd3043ee5a301771d62ba015decdb1de8421a9b0
[3]: https://searchfox.org/mozilla-central/rev/dbddac86aadf1d4871fb350bbe66db43728a9f81/third_party/rust/bindgen/Cargo.toml#15
[4]: https://github.com/RustAudio/coreaudio-sys/issues/19#issuecomment-467225004
[5]: https://github.com/ChunMinChang/cubeb-coreaudio-rs/blob/642857dadd83e806ce47890265d16e18e0c3c418/Cargo.toml
[whitelist]: https://searchfox.org/mozilla-central/rev/dbddac86aadf1d4871fb350bbe66db43728a9f81/python/mozbuild/mozbuild/vendor_rust.py#158
[6]: https://github.com/ChunMinChang/cubeb-coreaudio-rs/blob/2d19e722a71a9f7459e87c1fc5281f1a9dedcce6/Cargo.toml#L16
[bindgen]: https://github.com/rust-lang/rust-bindgen
[cross-compile-issue]: https://github.com/RustAudio/coreaudio-sys/issues/23#issuecomment-468847361
### Building [cubeb-coreaudio-rs][0] within gecko

#### Steps
0. `cd` to the gecko source code folder
1. Import [cubeb-coreaudio-rs][0] by
    - Apply attachment 9050823 [details] [diff] [review] and run `cd <gecko-source>/media/libcubeb/cubeb-coreaudio-rs/ && sh update.sh <upstream_src_directory>`
        - `<gecko-source>` is the path of the gecko source folder
        - `<upstream_src_directory>` is the path of [cubeb-coreaudio-rs][0] repo
    - or git clone [cubeb-coreaudio-rs][0] directly under *<gecko-source>/media/libcubeb*
2. Build [cubeb-coreaudio-rs][0] within *gkrust-shared* and call it via *cubeb.c*
    - Apply attachment 9048726 [details] [diff] [review]
3. Update *gkrust-shared* and load dependencies of [cubeb-coreaudio-rs][0] into *third_party/rust/*
    - Run `$ cargo update -p gkrust-shared && ./mach vendor rust --ignore-modified`, under *<gecko-source>*
4. Build gecko
    - Run `$ ./mach build`

#### Notes

- [Customize *coreaudio-sys*][1] for [cubeb-coreaudio-rs][6]
  - [meet][2] the [*bindgen* version used in *gecko*][3], or it may need to add another *bindgen* into the [buildtime whitelist][whitelist]
  - To avoid [build error on 10.13.6 (High Sierra)][4], using [the `features` cubeb-coreaudio-rs needs explicitly][5]
  - The *Rust* *FFI* bindings to *C* APIs are generated from [*bindgen*][bindgen] if it's possible. The path of the APIs' headers need to be fed into the *bindgen*. However, we might have no ideas where those headers are ,e.g., running on a macos within a virtual machine based on a Linux server (macos on tryserver). In that case, we use a *fullback raw bindings* that are generated from *bindgen* in advance and use `link` attribute linkings the bindings to C APIs. [Here][cross-compile-issue] is an example.
- Test files are omitted
  - The tests are verbose and they are not cross-devices
  - They should be run on Travis CI(on github) after being revised

[0]: https://github.com/ChunMinChang/cubeb-coreaudio-rs
[1]: https://github.com/ChunMinChang/coreaudio-sys/tree/gecko-build
[2]: https://github.com/ChunMinChang/coreaudio-sys/commit/dd3043ee5a301771d62ba015decdb1de8421a9b0
[3]: https://searchfox.org/mozilla-central/rev/dbddac86aadf1d4871fb350bbe66db43728a9f81/third_party/rust/bindgen/Cargo.toml#15
[4]: https://github.com/RustAudio/coreaudio-sys/issues/19#issuecomment-467225004
[5]: https://github.com/ChunMinChang/cubeb-coreaudio-rs/blob/642857dadd83e806ce47890265d16e18e0c3c418/Cargo.toml
[whitelist]: https://searchfox.org/mozilla-central/rev/dbddac86aadf1d4871fb350bbe66db43728a9f81/python/mozbuild/mozbuild/vendor_rust.py#158
[6]: https://github.com/ChunMinChang/cubeb-coreaudio-rs/blob/2d19e722a71a9f7459e87c1fc5281f1a9dedcce6/Cargo.toml#L16
[bindgen]: https://github.com/rust-lang/rust-bindgen
[cross-compile-issue]: https://github.com/RustAudio/coreaudio-sys/issues/23#issuecomment-468847361

Back to Bug 1530715 Comment 4