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

feat(free-bsd): first-class support for FreeBSD #50

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

surban
Copy link
Contributor

@surban surban commented Feb 27, 2024

Add support for FreeBSD and other BSDs.
Testing was only done using FreeBSD.

Fixes #49.

Add support for FreeBSD and other BSDs.
Testing was only done using FreeBSD.
@surban surban marked this pull request as draft February 27, 2024 07:39
@surban surban marked this pull request as ready for review February 27, 2024 07:42
@surban
Copy link
Contributor Author

surban commented Feb 27, 2024

The clippy failure seems to be unrelated to the performed changes.

@surban
Copy link
Contributor Author

surban commented Mar 25, 2024

Anything I can do to help get this merged?

@EstebanBorai EstebanBorai changed the title Add FreeBSD support. feat(free-bsd): first-class support for FreeBSD Mar 25, 2024
Copy link
Owner

@EstebanBorai EstebanBorai left a comment

Choose a reason for hiding this comment

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

LGTM @surban! Thank you so much! I think I can help with clippy issues!

@EstebanBorai EstebanBorai merged commit 4984f64 into EstebanBorai:main Mar 25, 2024
9 of 12 checks passed
@EstebanBorai
Copy link
Owner

Hi @surban! Thanks for the support!
A release is already drafted here: https://crates.io/crates/network-interface/1.1.2

Please reach on any issues!

@cmspam
Copy link

cmspam commented Mar 28, 2024

Some issues compiling on FreeBSD/aarch64:

error[E0308]: mismatched types
   --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/network-interface-1.1.2/src/target/unix/mod.rs:75:31
    |
75  |     let len = unsafe { strlen(data as *const i8) };
    |                        ------ ^^^^^^^^^^^^^^^^^ expected `*const u8`, found `*const i8`
    |                        |
    |                        arguments to this function are incorrect
    |
    = note: expected raw pointer `*const u8`
               found raw pointer `*const i8`
note: function defined here
   --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.153/src/unix/mod.rs:541:12
    |
541 |     pub fn strlen(cs: *const c_char) -> size_t;
    |            ^^^^^^

For more information about this error, try `rustc --explain E0308`.
error: could not compile `network-interface` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

@EstebanBorai
Copy link
Owner

Some issues compiling on FreeBSD/aarch64:


error[E0308]: mismatched types

   --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/network-interface-1.1.2/src/target/unix/mod.rs:75:31

    |

75  |     let len = unsafe { strlen(data as *const i8) };

    |                        ------ ^^^^^^^^^^^^^^^^^ expected `*const u8`, found `*const i8`

    |                        |

    |                        arguments to this function are incorrect

    |

    = note: expected raw pointer `*const u8`

               found raw pointer `*const i8`

note: function defined here

   --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.153/src/unix/mod.rs:541:12

    |

541 |     pub fn strlen(cs: *const c_char) -> size_t;

    |            ^^^^^^



For more information about this error, try `rustc --explain E0308`.

error: could not compile `network-interface` (lib) due to 1 previous error

warning: build failed, waiting for other jobs to finish...

Thanks for sharing @cmspam!
What do you think @surban? Does it happens to you as well?

@surban
Copy link
Contributor Author

surban commented Apr 2, 2024

Not on x86_64. I don't have easy access to FreeBSD on aarch64. Do you have working CI support for that platform for your other projects?

It might be enough to change as *const i8 into as *const _.

@EstebanBorai
Copy link
Owner

Not on x86_64. I don't have easy access to FreeBSD on aarch64. Do you have working CI support for that platform for your other projects?

It might be enough to change as *const i8 into as *const _.

Gotcha! If the change works for you, and if you think that will fix the issue. Are you willing to open a PR?

@surban
Copy link
Contributor Author

surban commented Apr 3, 2024

Gotcha! If the change works for you, and if you think that will fix the issue. Are you willing to open a PR?

See #52

@EstebanBorai
Copy link
Owner

Thank you so much @surban!
@cmspam a new version has been released with @surban fix!

You can see it here: https://crates.io/crates/network-interface/1.1.3

Let us know any issues please!

@cmspam
Copy link

cmspam commented Apr 4, 2024

Many thanks to all involved! I won't have a chance to test on arm64 for a little bit, but I will let you know when I can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FreeBSD support
3 participants