Skip to content

Make novendor feature the default#521

Closed
mmullin-halcyon wants to merge 3 commits into
libbpf:masterfrom
mmullin-halcyon:origin/story/vendorize_dependencies
Closed

Make novendor feature the default#521
mmullin-halcyon wants to merge 3 commits into
libbpf:masterfrom
mmullin-halcyon:origin/story/vendorize_dependencies

Conversation

@mmullin-halcyon
Copy link
Copy Markdown

See: libbpf/libbpf-sys#64

The "static" feature will now get libbpf-sys to do all the static compilation of the libraries required by libbpf rather than the application developer statically compiling these libraries themselves, or relying on the distribution to provide static versions.

The default feature will no longer link libbpf statically. All libbpf libraries, including libbpf, will now be dynamically linked to distribution provided shared libraries

CHANGELOG NOTE #1: feature "static" allows libelf and zlib to be statically linked. Completely static binaries can now be compiled via the command RUSTFLAGS='-C target-feature=+crt-static' cargo build --target x86_64-unknown-linux-gnu.
CHANGELOG NOTE #2: "static" feature will not work with musl.

Thank you for considering a contribution!

In order to streamline review experience for contributors and reviewers, please
be sure to read and follow the Contributor's Guide. It
lays out basic best practices, which, if followed will reduce unnecessary back
and forth and, ultimately, minimize the time it takes to get your change into
the library.

@mmullin-halcyon
Copy link
Copy Markdown
Author

RE: #498

@mmullin-halcyon
Copy link
Copy Markdown
Author

Note on Changelog #2. I do not believe that libbpf ever compiled with musl. musl-gcc does not "play well" with Linux Kernel headers, and libbpf uses some of the headers that musl-gcc does not play well with. I believe that Alpine Linux has always required the "libbpf-sys/novendor" feature (now it should simply compile with default).

@mmullin-halcyon
Copy link
Copy Markdown
Author

Posting this in anticipation of approval of the libbpf-sys change.

Comment thread libbpf-rs/Cargo.toml
Comment on lines +18 to +20
# When turned on, compile and link all libbpf library dependencies statically
# When turned off, dynamically link all libbpf library dependencies
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's please also mention that static implies vendoring of all C library dependencies? That is crucial from my perspective.

@danielocfb danielocfb marked this pull request as draft July 28, 2023 20:21
See: libbpf/libbpf-sys#64

The "static" feature will now get libbpf-sys to do all the static compilation
of the libraries required by libbpf rather than the application developer
statically compiling these libraries themselves, or relying on the
distribution to provide static versions.

The default feature will no longer link libbpf statically.  All libbpf
libraries, including libbpf, will now be dynamically linked to
distribution provided shared libraries

CHANGELOG NOTE libbpf#1: feature "static" allows libelf and zlib to be statically
linked. Completely static binaries can now be compiled via the command
`RUSTFLAGS='-C target-feature=+crt-static' cargo build --target
x86_64-unknown-linux-gnu`.
CHANGELOG NOTE libbpf#2: "static" feature will not work with musl.

Signed-off-by: Michael Mullin <mmullin@halcyon.ai>
@mmullin-halcyon mmullin-halcyon force-pushed the origin/story/vendorize_dependencies branch from 73ff47e to 8cd1b2e Compare July 29, 2023 16:56
@danielocfb
Copy link
Copy Markdown
Collaborator

I think we are still blocked on waiting for a new libbpf-sys release before we can move forward here :-(

@github-actions
Copy link
Copy Markdown

This pull request is considered stale because it has been open 30 days with no activity. Remove stale label or comment or it will be closed in 5 days.

@github-actions github-actions Bot added the Stale label Dec 28, 2023
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 2, 2024

Closing pull request as it is stale.

@github-actions github-actions Bot closed this Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants