Comments (11)
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.
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.
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.
I've pushed a fix for this, give it a go.
from dns-lookup.
@NfNitLoop Could you give this another try on OSX? A cargo test
should be enough.
from dns-lookup.
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.
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.
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.
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.
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.
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)
- please make LookupErrorKind public HOT 4
- 1.0.2 broke freebsd HOT 8
- Remove dependency on libresolv for MacOS and IOS HOT 3
- Update to 1.0.4 fails with ' error: expected an item keyword' HOT 3
- Expand API HOT 2
- Type safety, family HOT 2
- dns-lookup are failed to compile on Windows HOT 6
- Specific dns server and retrieve an array of buffer
- Clarifications about `lookup_addr()` HOT 1
- Arm compatibility issues HOT 4
- Alpine issues with dns-lookup 2 HOT 5
- Implement `FusedIterator` for `AddrInfoIter`. HOT 3
- `failed to lookup address information: nodename nor servname provided, or not known` HOT 2
- Why is the IP address obtained not a private address? HOT 1
- push 0.2.1 to github please HOT 2
- NXDOMAIN vs SERVFAIL HOT 3
- Add gethostname()? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dns-lookup.