Skip to content

Commit

Permalink
build(dc/wireshark): specifiy rust target for bindgen
Browse files Browse the repository at this point in the history
  • Loading branch information
camshaft committed Dec 11, 2024
1 parent fa47fce commit 5dad754
Show file tree
Hide file tree
Showing 5 changed files with 758 additions and 2,405 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,7 @@ jobs:
lfs: true

- name: Install rust toolchain
working-directory: dc/wireshark
run: |
rustup toolchain install stable --profile minimal --component clippy,rustfmt
rustup override set stable
Expand Down
6 changes: 5 additions & 1 deletion dc/wireshark/generate-bindings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -xeuo pipefail

VERSION="4.2.5"
VERSION="4.4.2"
BRANCH="wireshark-$VERSION"
PKG_CONFIG_PATH="${PKG_CONFIG_PATH:-}"

Expand Down Expand Up @@ -79,10 +79,13 @@ OPTIONS=(

mkdir -p src/wireshark_sys/

RUST_TARGET=$(rustup show | awk 'NF' | awk 'END{print $2}')

# This list is filtered to roughly what our current usage requires.
# It's possible there's a better way to do this -- some of the Wireshark
# headers end up pulling in C++ so we do need some filtering.
bindgen \
--rust-target $RUST_TARGET \
--raw-line '// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.' \
--raw-line '// SPDX-License-Identifier: Apache-2.0' \
${OPTIONS[@]} \
Expand All @@ -91,6 +94,7 @@ bindgen \
-- ${INCLUDES[@]}

bindgen \
--rust-target $RUST_TARGET \
--raw-line '// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.' \
--raw-line '// SPDX-License-Identifier: Apache-2.0' \
${OPTIONS[@]} \
Expand Down
2 changes: 2 additions & 0 deletions dc/wireshark/src/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ pub unsafe extern "C" fn proto_register() {

#[derive(Debug)]
pub struct Registration {
#[allow(dead_code)]
pub protocol: i32,
#[allow(dead_code)]
pub all_subtree: i32,
pub tag_subtree: i32,
pub control_data_subtree: i32,
Expand Down
Loading

0 comments on commit 5dad754

Please sign in to comment.