[CDRIVER-2088] Can't build libbson on tvOS / watchOS Created: 17/Mar/17  Updated: 11/Sep/19  Resolved: 17/Mar/17

Status: Closed
Project: C Driver
Component/s: libbson, packaging
Affects Version/s: 1.6.0
Fix Version/s: 1.7.0

Type: Task Priority: Minor - P4
Reporter: Paul Melnikow Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

tvOS, watchOS


Issue Links:
Related
related to PHPC-1058 Build Warnings on OSX Closed
is related to CDRIVER-1559 syscall deprecated in macOS Closed

 Description   

I maintain the CocoaPods package for libbson. The goal is to make libbson easy to integrate into Objective-C and Swift projects.

By default CocoaPods builds for iOS, OS X, tvOS, and watchOS. When running test builds on tvOS and watchOS, I get errors related to syscall not being available:

    - ERROR | [tvOS] xcodebuild:  /Users/pnm/code/libbson/src/bson/bson-context.c:53:11: error: 'syscall' is unavailable: not available on tvOS
    - NOTE  | [tvOS] xcodebuild:  /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator10.1.sdk/usr/include/unistd.h:733:6: note: 'syscall' has been explicitly marked unavailable here
    - ERROR | [watchOS] xcodebuild:  /Users/pnm/code/libbson/src/bson/bson-context.c:53:11: error: 'syscall' is unavailable: not available on watchOS
    - NOTE  | [watchOS] xcodebuild:  /Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator3.1.sdk/usr/include/unistd.h:733:6: note: 'syscall' has been explicitly marked unavailable here

The challenge is that the package has to be shared between these OS's. There's a script that runs autogen and configure at install time, though at that point the platforms it will run on are not known (and have different support).

What's the best way to handle this? Should I add more checks in bson-context.c?



 Comments   
Comment by Paul Melnikow [ 17/Mar/17 ]

Good to know. Thanks.

Comment by Hannes Magnusson [ 17/Mar/17 ]

Yes please. Each pull request needs a jira ticket for tracking purposes otherwise it's to easy to accidentally miss the pull request as they are not our primary workflow.

Good point about CDRIVER-1559, thanks!

Comment by Paul Melnikow [ 17/Mar/17 ]

Out of curiosity, would it be easier for you guys to manage if I opened tickets here for issues I find, to go along with pull requests?

Comment by Paul Melnikow [ 17/Mar/17 ]

Nice! Seems like that fix would resolve CDRIVER-1559 as well.

Comment by Githook User [ 17/Mar/17 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-2088 Can't build libbson on tvOS / watchOS
Branch: master
https://github.com/mongodb/libbson/commit/0d2f189276e4bf11f72a3830336490ef845f94b7

Comment by Paul Melnikow [ 17/Mar/17 ]

Thanks for the response. I didn't realize it was deprecated on OS X. Hmmm.

It's only used in this block:
https://github.com/mongodb/libbson/blob/master/src/bson/bson-context.c#L376-L386

Is this for OID generation?

The simplest fix which would be to #define another variable in bson-context.c, which checks BSON_HAVE_SYSCALL_TID && !tvOS && !watchOS.

That would address the immediate issue, though it wouldn't solve the deprecation issue.

Comment by A. Jesse Jiryu Davis [ 17/Mar/17 ]

Hi, we're aware that "syscall" is deprecated on macOS and unavailable on mobile Apple systems. We haven't investigated further and found an alternative yet. Do you have a proposal?

Generated at Wed Feb 07 21:14:08 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.