Compiler warning "gethostuuid() is disabled" building SQLite for iOS

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Compiler warning "gethostuuid() is disabled" building SQLite for iOS

Jens Alfke-2
When compiling sqlite3.c for the iOS platform, the compiler emits a custom warning "gethostuuid() is disabled”, triggered by a #warn directive (see code below.)

I understand why gethostuuid() isn’t available: the iOS platform intentionally blocks 3rd party apps from accessing device-specific UUIDs, to avoid privacy problems caused by ad networks that try to correlate a user’s activity across apps or across reinstalls of an app.

What I don’t understand is why SQLite would want to call gethostuuid(), or what functionality might be lost by its absence.

Also, usually a compiler warning means the developer is doing something questionable or dangerous; but in this case the warning is triggered simply by the presence of a target platform, which isn’t something the developer has any control over. So it doesn’t seem useful to produce this warning when there’s nothing that can be done about it.

—Jens

PS: The code that triggers the warning is:

#if defined(__APPLE__) && ((__MAC_OS_X_VERSION_MIN_REQUIRED > 1050) || \
                           (__IPHONE_OS_VERSION_MIN_REQUIRED > 2000))
#  if (!defined(TARGET_OS_EMBEDDED) || (TARGET_OS_EMBEDDED==0)) \
       && (!defined(TARGET_IPHONE_SIMULATOR) || (TARGET_IPHONE_SIMULATOR==0))
#    define HAVE_GETHOSTUUID 1
#  else
#    warning "gethostuuid() is disabled."
#  endif
#endif

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Compiler warning "gethostuuid() is disabled" building SQLite for iOS

Richard Hipp-3
On 8/16/17, Jens Alfke <[hidden email]> wrote:
>
> What I don’t understand is why SQLite would want to call gethostuuid(),

The gethostuuid() system call is used only by the OS-X "proxy locking"
VFS, which provides better performance across network filesystems.
This VFS that was written at Apple and contributed to the SQLite
source tree.  (We have copyright releases signed by Apple lawyers in
our firesafe.)  The proxy-locking VFS is important for OS-X, we are
told, because many applications store SQLite databases in the user's
home directory, and many OS-X users like to have their home
directories NSF-mounted.

--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Compiler warning "gethostuuid() is disabled" building SQLite for iOS

Jens Alfke-2

> On Aug 16, 2017, at 1:42 PM, Richard Hipp <[hidden email]> wrote:
>
> The proxy-locking VFS is important for OS-X, we are
> told, because many applications store SQLite databases in the user's
> home directory, and many OS-X users like to have their home
> directories NSF-mounted.

It was certainly the case that a lot of *Apple engineers* used NFS-mounted home directories, at least in the early days of Mac OS X. (I was an engineer at Apple at the time.) This made any problems with that configuration very prominent when testing the OS. I’ve never seen network home directories in the wild, but I believe it may be used in educational settings for centralized administration.

Anyway, it’s very unlikely that any *iOS* apps are accessing SQLite databases over NFS, considering that they aren’t allowed to access files outside their sandbox. :) So may I request taking out this #warn directive?

Thanks,

—Jens
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Compiler warning "gethostuuid() is disabled" building SQLite for iOS

Simon Slavin-3


On 17 Aug 2017, at 12:55am, Jens Alfke <[hidden email]> wrote:

> I’ve never seen network home directories in the wild, but I believe it may be used in educational settings for centralized administration.

I worked at a university and we used network home directories.  But they weren’t done using NFS.  We used SMB or CIF or AFP depending on which part of the university ran the servers.  Our techies didn’t like NFS.

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Compiler warning "gethostuuid() is disabled" building SQLite for iOS

Richard Hipp-3
In reply to this post by Jens Alfke-2
On 8/16/17, Jens Alfke <[hidden email]> wrote:
>  So may I request taking out this #warn directive?
>

You can probably make the warning go away if you compile with
-DSQLITE_ENABLE_LOCKING_STYLE=0

--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Compiler warning "gethostuuid() is disabled" building SQLite for iOS

Richard Hipp-3
In reply to this post by Simon Slavin-3
On 8/16/17, Simon Slavin <[hidden email]> wrote:
>
> I worked at a university and we used network home directories.

<sarc>
Why use the local disk when you can instead use a network filesystem
that is less reliable and about 100x slower?
</sarc>

--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Compiler warning "gethostuuid() is disabled" building SQLite for iOS

Jens Alfke-2

> On Aug 16, 2017, at 5:04 PM, Richard Hipp <[hidden email]> wrote:
>
> <sarc>
> Why use the local disk when you can instead use a network filesystem
> that is less reliable and about 100x slower?
> </sarc>

That was pretty much my conclusion! After I realized that most of the OS's sluggishness was attributable to filesystem latency, I switched to a local home directory sometime in 2001. But a lot of Apple engineers found it useful to log into their account from any computer, and to have their home directory unaffected by erasing disks and reinstalling operating systems, which happens several times a week during OS development.

—Jens
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Compiler warning "gethostuuid() is disabled" building SQLite for iOS

Simon Slavin-3
In reply to this post by Richard Hipp-3
On 17 Aug 2017, at 1:04am, Richard Hipp <[hidden email]> wrote:

> On 8/16/17, Simon Slavin <[hidden email]> wrote:
>
>> I worked at a university and we used network home directories.
>
> <sarc>
> Why use the local disk when you can instead use a network filesystem
> that is less reliable and about 100x slower?
> </sarc>

Because our students can’t use local disk.  They may use any of over 700 computers on campus, maintained by different departments.  And they expect their files to appear magically wherever they sit down.  Also, they expect their files to get backed up.

It isn’t really a problem for the students who were clever with computers.  But once you have computers which can be used by any student in the university you have to cater for the lowest level of geekery.

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Compiler warning "gethostuuid() is disabled" building SQLite for iOS

jose isaias cabrera-3

Simon Slavin wrote...

> to cater for the lowest level of geekery.

I think that is the first time I have seen this statement... :-)  I know a
few folks with that description.

josé

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Compiler warning "gethostuuid() is disabled" building SQLite for iOS

Bob Friesenhahn
In reply to this post by Richard Hipp-3
On Wed, 16 Aug 2017, Richard Hipp wrote:

> On 8/16/17, Simon Slavin <[hidden email]> wrote:
>>
>> I worked at a university and we used network home directories.
>
> <sarc>
> Why use the local disk when you can instead use a network filesystem
> that is less reliable and about 100x slower?
> </sarc>

It is not necessarily the case that a network filesystem is less
reliable or 100x slower.  The server may have much better storage
reliability (RAID) and performance characteristics (faster storage
devices and more much more RAM) and accessing server-based storage may
actually have much better latency than local disk on a typical
computer.  Files on the server are more readily backed up than files
distributed across many hosts.

I did use NFS for accessing user files while I had an Apple OS X
system in active use here.  The OS X NFS seemed to be slower than
normal compared to the NFS provided by other operating systems.

I am still using NFS mounted home directories across all systems here
(since 1993).  No significant problems have been encountered during
that time.

Bob
--
Bob Friesenhahn
[hidden email], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users