Closed Bug 1611431 Opened 4 years ago Closed 4 years ago

Generate mp4parse-rust bindings as part of mach build

Categories

(Core :: Audio/Video: Playback, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla74
Tracking Status
firefox74 --- fixed

People

(Reporter: jbauman, Assigned: jbauman)

Details

Attachments

(1 file)

Currently the mp4parse-rust C bindings are generated manually when the crate is updated from its GitHub source via the update-rust.sh script. This is inconsistent with other integrated rust code which specify binding generation with RunCbindgen.py in their moz.build files.

As a result, iterating on changes to the rust/C++ interface requires an inconvenient manual process:

  1. Remove the build = false line and add back the cbindgen build dependency in media/mp4parse-rust/mp4parse_capi/Cargo.toml
  2. Do a cargo build in the mp4parse_capi dir (since mach build fails with error: no matching package named `cbindgen` found)
  3. Copy media/mp4parse-rust/mp4parse_capi/include/mp4parse.hmedia/mp4parse-rust/mp4parse.h
  4. Revert changes to media/mp4parse-rust/mp4parse_capi/Cargo.toml so mach build works again
  5. mach build

Changing the binding generation process to be consistent with other code will be more convenient and less error-prone.

Assignee: nobody → jbauman

Now that cbindgen.toml is a required file, update-rust.sh must be
updated to avoid clobbering it.

Tried to land this on autoland but got the following:

We're sorry, Autoland could not rebase your commits for you automatically. Please manually rebase your commits and try again. applying /tmp/tmp4MayL7 media/mp4parse-rust/mp4parse.h Hunk #1 FAILED at 2. 1 out of 1 hunk FAILED -- saving rejects to file media/mp4parse-rust/mp4parse.h.rej abort: patch command failed: exited with status 256

Flags: needinfo?(jbauman)

I rebased, so hopefully that fixes the conflict. I think it was conflicting with this change since that's the only difference I see between my two phabricator revisions.

Flags: needinfo?(jbauman)
Pushed by mgregan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a431e44d2e6f
Generate mp4parse-rust bindings as part of mach build. r=kinetik
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: