Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fork error on tvOS and watchOS #3334

Closed
paulocoutinhox opened this issue Jun 29, 2021 · 2 comments
Closed

Fork error on tvOS and watchOS #3334

paulocoutinhox opened this issue Jun 29, 2021 · 2 comments
Assignees

Comments

@paulocoutinhox
Copy link

paulocoutinhox commented Jun 29, 2021

Hi,

When i try build version 1.10.1 for tvOS i get this error:

In file included from /Users/paulo/.conan/data/poco/1.10.1/_/_/build/38267c8c71293c0f1dfff4a217e3a33b60e9b7fd/source_subfolder/Foundation/src/Process.cpp:59:
/Users/paulo/.conan/data/poco/1.10.1/_/_/build/38267c8c71293c0f1dfff4a217e3a33b60e9b7fd/source_subfolder/Foundation/src/Process_UNIX.cpp:190:12: error: 'fork' is unavailable: not available on tvOS
        int pid = fork();
                  ^
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS14.5.sdk/usr/include/unistd.h:447:8: note: 'fork' has been explicitly marked unavailable here
pid_t    fork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
         ^
In file included from /Users/paulo/.conan/data/poco/1.10.1/_/_/build/38267c8c71293c0f1dfff4a217e3a33b60e9b7fd/source_subfolder/Foundation/src/Process.cpp:59:
/Users/paulo/.conan/data/poco/1.10.1/_/_/build/38267c8c71293c0f1dfff4a217e3a33b60e9b7fd/source_subfolder/Foundation/src/Process_UNIX.cpp:231:3: error: 'execvp' is unavailable: not available on tvOS
                execvp(argv[0], &argv[0]);
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS14.5.sdk/usr/include/unistd.h:446:6: note: 'execvp' has been explicitly marked unavailable here
int      execvp(const char * __file, char * const * __argv) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
      

I see that is in this line:
https://github.com/pocoproject/poco/blob/poco-1.10.1/Foundation/src/Process_UNIX.cpp#L190

And a define is checked is this line:
https://github.com/pocoproject/poco/blob/poco-1.10.1/Foundation/src/Process_UNIX.cpp#L175

I need add in conan a variable to pass this directive, correct?

Thanks.

@obiltschnig
Copy link
Member

Assuming this is built via CMake, then the -DPOCO_NO_FORK_EXEC must be added to the compiler options when compiling Foundation for watchOS/tvOS. Since there does not seem to be a standard way of detecting watchOS/tvOS builds in CMake, this should probably be handled via an extra configuration variable passed to the build externally.

@obiltschnig obiltschnig added this to the Release 1.11.1 milestone Jun 30, 2021
@obiltschnig obiltschnig self-assigned this Jun 30, 2021
@obiltschnig
Copy link
Member

See #3347

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants