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

build(dc/wireshark): specifiy rust target for bindgen #2414

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading