Release 0.4 given fixed breakage? #11

Open
opened 2025-06-07 01:27:46 +12:00 by chrysn · 6 comments
chrysn commented 2025-06-07 01:27:46 +12:00 (Migrated from github.com)

There are issues with building 0.3 when using a current bindgen-cli (0.71.1). I didn't investigate any further, but checked with the current master branch, and found that that one builds perfectly (and is even suitable to build alookup, which was written for 0.1.4).

Would you consider publishing the current state as 0.4.0?

For reference: errors from building 0.3.0 on a current stable Rust with current bindgen-cli
error[E0308]: mismatched types
    --> src/record/ns.rs:30:13
     |
25   |         let size = unsafe { ::libresolv_sys::ns_name_uncompress(
     |                             ----------------------------------- arguments to this function are incorrect
...
30   |             MAXDNAME as u64)
     |             ^^^^^^^^^^^^^^^ expected `usize`, found `u64`
     |
note: function defined here
    --> /home/chrysn/git/crates/resolv-rs/libresolv-sys/resolv.rs:4802:12
     |
4802 |     pub fn ns_name_uncompress(
     |            ^^^^^^^^^^^^^^^^^^
help: you can convert a `u64` to a `usize` and panic if the converted value doesn't fit
     |
30   |             (MAXDNAME as u64).try_into().unwrap())
     |             +               +++++++++++++++++++++

There are issues with building 0.3 when using a current bindgen-cli (0.71.1). I didn't investigate any further, but checked with the current master branch, and found that that one builds perfectly (and is even suitable to build alookup, which was written for 0.1.4). Would you consider publishing the current state as 0.4.0? <details><summary>For reference: errors from building 0.3.0 on a current stable Rust with current bindgen-cli</summary> ```rust error[E0308]: mismatched types --> src/record/ns.rs:30:13 | 25 | let size = unsafe { ::libresolv_sys::ns_name_uncompress( | ----------------------------------- arguments to this function are incorrect ... 30 | MAXDNAME as u64) | ^^^^^^^^^^^^^^^ expected `usize`, found `u64` | note: function defined here --> /home/chrysn/git/crates/resolv-rs/libresolv-sys/resolv.rs:4802:12 | 4802 | pub fn ns_name_uncompress( | ^^^^^^^^^^^^^^^^^^ help: you can convert a `u64` to a `usize` and panic if the converted value doesn't fit | 30 | (MAXDNAME as u64).try_into().unwrap()) | + +++++++++++++++++++++ ``` </details>
mikedilger commented 2025-06-07 11:36:34 +12:00 (Migrated from github.com)

Yes I agree.

I can't seem to package/publish this anymore, I think cargo has changed to not like this code layout.

If you can suggest changes for bumping the version and getting "cargo package" to work for both crates (including libresolv-sys) please share. Otherwise I'll eventually get around to figuring it out.

Yes I agree. I can't seem to package/publish this anymore, I think cargo has changed to not like this code layout. If you can suggest changes for bumping the version and getting "cargo package" to work for both crates (including libresolv-sys) please share. Otherwise I'll eventually get around to figuring it out.
mikedilger commented 2025-06-07 11:43:12 +12:00 (Migrated from github.com)

I might need to generate lib.rs differently and then have a commited lib.rs like this:
include!(concat!(env!("OUT_DIR"), "/generated.rs"));

I might also need to use a workspace.

I might need to generate lib.rs differently and then have a commited lib.rs like this: `include!(concat!(env!("OUT_DIR"), "/generated.rs"));` I might also need to use a workspace.
lvkv commented 2026-04-10 03:31:20 +12:00 (Migrated from github.com)

@mikedilger what would it take to publish 0.4? Would you accept a PR or two?

@mikedilger what would it take to publish 0.4? Would you accept a PR or two?
mikedilger commented 2026-04-10 05:48:59 +12:00 (Migrated from github.com)

I tried to publish it. Many times now. But Cargo isn't letting me package it and the error message it is giving is bullshit. The code needs some kind of restructuring but I don't know how to restructure it and still work with bindgen. Things have changed a lot since I wrote this and I haven't kept up.

libresolv-sys$ cargo package
   Packaging libresolv-sys v0.4.0 (/p/zed/devel/LIBS/resolv/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

I tried to publish it. Many times now. But Cargo isn't letting me package it and the error message it is giving is bullshit. The code needs some kind of restructuring but I don't know how to restructure it and still work with bindgen. Things have changed a lot since I wrote this and I haven't kept up. ``` libresolv-sys$ cargo package Packaging libresolv-sys v0.4.0 (/p/zed/devel/LIBS/resolv/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 ```
lvkv commented 2026-04-10 08:32:15 +12:00 (Migrated from github.com)

@mikedilger I've opened a PR for this over at https://github.com/mikedilger/resolv-rs/pull/13. Starting with libresolv-sys for now. Would you be able to take a look? More than happy to make edits.

@mikedilger I've opened a PR for this over at https://github.com/mikedilger/resolv-rs/pull/13. Starting with `libresolv-sys` for now. Would you be able to take a look? More than happy to make edits.
lvkv commented 2026-04-17 02:47:28 +12:00 (Migrated from github.com)

@mikedilger thanks for merging #13. Per your update at https://github.com/mikedilger/resolv-rs/pull/13#issuecomment-4230840738, I've received and accepted your maintainer requests on crates.io and published the 0.4 versions of both libresolv-sys and resolv. Thank you for being so responsive!

@mikedilger thanks for merging #13. Per your update at https://github.com/mikedilger/resolv-rs/pull/13#issuecomment-4230840738, I've received and accepted your maintainer requests on crates.io and published the 0.4 versions of both [libresolv-sys](https://crates.io/crates/libresolv-sys) and [resolv](https://crates.io/crates/resolv). Thank you for being so responsive!
Sign in to join this conversation.
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#11
No description provided.