mirror of
https://github.com/fosrl/olm.git
synced 2026-07-16 19:09:54 +00:00
Add ios stub
This commit is contained in:
18
dns/sysresolver_ios.go
Normal file
18
dns/sysresolver_ios.go
Normal file
@@ -0,0 +1,18 @@
|
||||
//go:build ios
|
||||
|
||||
package dns
|
||||
|
||||
// readSystemDNS returns nil on iOS: olm cannot read the OS's DNS
|
||||
// configuration itself here, so the app must detect it and push it in
|
||||
// through the equivalent of Olm.SetSystemDNS instead.
|
||||
//
|
||||
// This is a dedicated file (rather than falling through the general
|
||||
// sysresolver_stub.go catch-all) because Go's build constraint evaluator
|
||||
// treats GOOS=ios as implicitly satisfying the "darwin" tag as well as
|
||||
// "ios". sysresolver_stub.go excludes with "!darwin", which is false for an
|
||||
// iOS build, so the stub silently stops applying and would leave
|
||||
// readSystemDNS undefined. An explicit "ios" constraint isn't affected by
|
||||
// that ambiguity.
|
||||
func readSystemDNS() []string {
|
||||
return nil
|
||||
}
|
||||
@@ -3,16 +3,21 @@
|
||||
package dns
|
||||
|
||||
// readSystemDNS returns nil on platforms where automatic DNS discovery is not
|
||||
// implemented (ios, freebsd, etc.). Callers should fall back to a
|
||||
// statically configured DNS server.
|
||||
// implemented (freebsd, etc.). Callers should fall back to a statically
|
||||
// configured DNS server.
|
||||
//
|
||||
// android is excluded from this constraint (and has its own sysresolver_android.go
|
||||
// with an explicit "android" tag) rather than falling through the "!linux" catch-all
|
||||
// here: wireguard-android's build passes "-tags linux" to share Linux netlink code
|
||||
// (a deliberate, long-standing convention, since Android's kernel is Linux), and Go's
|
||||
// build constraint evaluator can't distinguish a custom "-tags linux" from the real
|
||||
// GOOS=linux - so with that tag set, "!linux" is false even though GOOS is actually
|
||||
// android, and this file would silently stop applying, leaving readSystemDNS undefined.
|
||||
// android and ios are excluded from this constraint (and have their own
|
||||
// sysresolver_android.go / sysresolver_ios.go with an explicit "android" /
|
||||
// "ios" tag) rather than falling through the "!linux" / "!darwin" catch-all
|
||||
// here:
|
||||
// - wireguard-android's build passes "-tags linux" to share Linux netlink code
|
||||
// (a deliberate, long-standing convention, since Android's kernel is Linux), and Go's
|
||||
// build constraint evaluator can't distinguish a custom "-tags linux" from the real
|
||||
// GOOS=linux - so with that tag set, "!linux" is false even though GOOS is actually
|
||||
// android, and this file would silently stop applying, leaving readSystemDNS undefined.
|
||||
// - Go's build constraint evaluator treats GOOS=ios as implicitly satisfying the
|
||||
// "darwin" tag as well as "ios", so "!darwin" is false on an iOS build too, which
|
||||
// would otherwise leave readSystemDNS undefined there as well.
|
||||
func readSystemDNS() []string {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user