libresolv-sys: use bindgen package, update cargo #13

Merged
lvkv merged 1 commit from lvkv/libresolv-sys-package into master 2026-04-12 17:43:22 +12:00
lvkv commented 2026-04-10 08:29:46 +12:00 (Migrated from github.com)

This is for https://github.com/mikedilger/resolv-rs/issues/11, where the end goal is to publish the 0.4 version of these crates.
The first step IMO is to publish the libresolv-sys crate. I've made some changes to make packaging work (and clean things up along the way):

  • Use the bindgen crate as a build dependency instead of requiring users to have the bindgen CLI installed. This makes the crate much easier to build and prevents lines like this in CI scripts: github.com/deshaw/srv-rs@ecf0a86560/.github/workflows/rust.yml (L36)
    • Unignore lib.rs to make this work
  • Fix all the lints in build.rs
  • Specify an edition of 2021 (somewhat arbitrary) to prevent Cargo from defaulting to the ancient 2015 edition
  • Create a workspace and add libresolv-sys to it

Before (doesn't package):

> cargo package
   Packaging libresolv-sys v0.4.0 (/tmp/resolv-rs/libresolv-sys)
warning: ignoring library `libresolv_sys` as `lib.rs` is not included in the published package
error: failed to prepare local package for uploading

Caused by:
  no targets specified in the manifest
  either src/lib.rs, src/main.rs, a [lib] section, or [[bin]] section must be present

After (packaging works!):

> cargo package
   Packaging libresolv-sys v0.4.0 (/tmp/resolv-rs/libresolv-sys)
    Updating crates.io index
    Packaged 10 files, 15.3KiB (4.6KiB compressed)
   Verifying libresolv-sys v0.4.0 (/tmp/resolv-rs/libresolv-sys)
   Compiling clang-sys v1.8.1
   Compiling regex-automata v0.4.14
   Compiling libloading v0.8.9
   Compiling bindgen v0.72.1
   Compiling regex v1.12.3
   Compiling libresolv-sys v0.4.0 (/tmp/resolv-rs/target/package/libresolv-sys-0.4.0)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 9.23s

CC @mikedilger

This is for https://github.com/mikedilger/resolv-rs/issues/11, where the end goal is to publish the 0.4 version of these crates. The first step IMO is to publish the `libresolv-sys` crate. I've made some changes to make packaging work (and clean things up along the way): - Use the bindgen crate as a build dependency instead of requiring users to have the bindgen CLI installed. This makes the crate much easier to build and prevents lines like this in CI scripts: https://github.com/deshaw/srv-rs/blob/ecf0a86560b920712c1570d7aee1bd5d4c646864/.github/workflows/rust.yml#L36 - Unignore `lib.rs` to make this work - Fix all the lints in `build.rs` - Specify an edition of 2021 (somewhat arbitrary) to prevent Cargo from defaulting to the ancient 2015 edition - Create a workspace and add `libresolv-sys` to it Before (doesn't package): ```console > cargo package Packaging libresolv-sys v0.4.0 (/tmp/resolv-rs/libresolv-sys) warning: ignoring library `libresolv_sys` as `lib.rs` is not included in the published package error: failed to prepare local package for uploading Caused by: no targets specified in the manifest either src/lib.rs, src/main.rs, a [lib] section, or [[bin]] section must be present ``` After (packaging works!): ```console > cargo package Packaging libresolv-sys v0.4.0 (/tmp/resolv-rs/libresolv-sys) Updating crates.io index Packaged 10 files, 15.3KiB (4.6KiB compressed) Verifying libresolv-sys v0.4.0 (/tmp/resolv-rs/libresolv-sys) Compiling clang-sys v1.8.1 Compiling regex-automata v0.4.14 Compiling libloading v0.8.9 Compiling bindgen v0.72.1 Compiling regex v1.12.3 Compiling libresolv-sys v0.4.0 (/tmp/resolv-rs/target/package/libresolv-sys-0.4.0) Finished `dev` profile [unoptimized + debuginfo] target(s) in 9.23s ``` CC @mikedilger
mikedilger commented 2026-04-12 17:44:23 +12:00 (Migrated from github.com)

If you want I can add you as another maintainer on crates.io. If so, let me know your handle there.

If you want I can add you as another maintainer on crates.io. If so, let me know your handle there.
lvkv commented 2026-04-14 03:42:54 +12:00 (Migrated from github.com)

If you want I can add you as another maintainer on crates.io. If so, let me know your handle there.

@mikedilger Sure! My profile is https://crates.io/users/lvkv

> If you want I can add you as another maintainer on crates.io. If so, let me know your handle there. @mikedilger Sure! My profile is https://crates.io/users/lvkv
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mikedilger/resolv-rs!13
No description provided.