Code Monkey home page Code Monkey logo

Comments (11)

keeperofdakeys avatar keeperofdakeys commented on June 21, 2024 1

Interesting, I didn't realise the libc bindings were so variable. I'll remove the uncommon ones and rely on Other for those then.

Edit: And somehow it took me this long to realise that ai_protocol is not Protocol Family, but another kind of Protocol.

from dns-lookup.

keeperofdakeys avatar keeperofdakeys commented on June 21, 2024

The net2-rs crate creates (then drops) a UDP socket on a high port, so Rust initialises the Windows socket library. I should probably do something similar.

From what I can see, OSX should just work if unix does (besides res_init not being thread-safe in OSX).

from dns-lookup.

NfNitLoop avatar NfNitLoop commented on June 21, 2024

OSX support is unknown.

It doesn't seem to work on my OSX laptop. Building gives these errors (and many more along the same lines):

> cargo build
   Compiling dns-lookup v0.4.0
error[E0531]: cannot find unit struct/variant or constant `AF_AX25` in module `c`
   --> /Users/codycasterline/.cargo/registry/src/github.com-1ecc6299db9ec823/dns-lookup-0.4.0/src/types.rs:162:10
    |
162 |       c::AF_AX25 => AddrFamily::Ax25,
    |          ^^^^^^^ not found in `c`

error[E0531]: cannot find unit struct/variant or constant `AF_NETROM` in module `c`
   --> /Users/codycasterline/.cargo/registry/src/github.com-1ecc6299db9ec823/dns-lookup-0.4.0/src/types.rs:165:10
    |
165 |       c::AF_NETROM => AddrFamily::Netrom,
    |          ^^^^^^^^^ did you mean `AF_NATM`?

error[E0531]: cannot find unit struct/variant or constant `AF_BRIDGE` in module `c`
   --> /Users/codycasterline/.cargo/registry/src/github.com-1ecc6299db9ec823/dns-lookup-0.4.0/src/types.rs:166:10
    |
166 |       c::AF_BRIDGE => AddrFamily::Bridge,
    |          ^^^^^^^^^ not found in `c`

from dns-lookup.

keeperofdakeys avatar keeperofdakeys commented on June 21, 2024

I've pushed a fix for this, give it a go.

from dns-lookup.

keeperofdakeys avatar keeperofdakeys commented on June 21, 2024

@NfNitLoop Could you give this another try on OSX? A cargo test should be enough.

from dns-lookup.

NfNitLoop avatar NfNitLoop commented on June 21, 2024

Many fewer errors now:

> cargo build
    Updating registry `https://github.com/rust-lang/crates.io-index`
 Downloading libc v0.2.31
   Compiling libc v0.2.31
   Compiling dns-lookup v1.0.0 (file:///Users/codycasterline/src/dns-lookup)
error[E0531]: cannot find unit struct/variant or constant `AF_PACKET` in module `c`
  --> src/types.rs:97:10
   |
97 |       c::AF_PACKET => AddrFamily::Packet,
   |          ^^^^^^^^^ not found in `c`

error[E0425]: cannot find value `AF_PACKET` in module `c`
   --> src/types.rs:112:32
    |
112 |       AddrFamily::Packet => c::AF_PACKET,
    |                                ^^^^^^^^^ not found in `c`

error[E0063]: missing field `sin6_len` in initializer of `libc::sockaddr_in6`
   --> src/addr.rs:139:14
    |
139 |       inner: c::sockaddr_in6 {
    |              ^^^^^^^^^^^^^^^ missing `sin6_len`

error: aborting due to 3 previous errors

error: Could not compile `dns-lookup`.

from dns-lookup.

NfNitLoop avatar NfNitLoop commented on June 21, 2024

that was on this version, btw:

commit d3c5ff65294564c16ef4a91d8c4da7c59644ab59 (HEAD -> master, origin/master, origin/HEAD)
Author: Josh Driver <[email protected]>
Date:   Thu Sep 21 21:21:36 2017 +0930

    Version bump + doc updates

from dns-lookup.

keeperofdakeys avatar keeperofdakeys commented on June 21, 2024

Thanks for that I appreciate the help. While I'm heading in the right direction, it's obvious that I should get access get access to test systems for OSX and windows.

from dns-lookup.

DominoTree avatar DominoTree commented on June 21, 2024

Commenting out lines 79, 99, and 114 of types.rs takes care of AF_PACKET not existing in OS X, and adding a sin6_len field to MySocketAddrV6.new() in addr.rs adds an additional value that's required in libc on OS X.

These changes allow the library to build on OS X, haven't done much testing yet but I'll try to get some in tomorrow.

from dns-lookup.

keeperofdakeys avatar keeperofdakeys commented on June 21, 2024

I just pushed a new version that does away with the enums in types.rs, it was proving to be too hard to be portable in its current form. I'll re-implement something similar, but more lightweight in the near future.

from dns-lookup.

keeperofdakeys avatar keeperofdakeys commented on June 21, 2024

This is now building on all platforms, and travis/appveyor are now tracking OSX and Windows support going forward.

from dns-lookup.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.