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

call to unavailable function 'fork': not available on tvOS #39918

Open
lesnitsky opened this issue Dec 24, 2019 · 15 comments
Open

call to unavailable function 'fork': not available on tvOS #39918

lesnitsky opened this issue Dec 24, 2019 · 15 comments
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. type-enhancement A request for a change that isn't a bug

Comments

@lesnitsky
Copy link

I'm trying to build Flutter.framework for tvOS and getting this error. Is there a way to workaround this issue?

@lesnitsky
Copy link
Author

@devoncarew
Copy link
Member

devoncarew commented Dec 28, 2019

I'm not sure that tvOS is a supported iOS target for Flutter; will move this issue to the flutter repo.

@ghost ghost deleted a comment from devoncarew Dec 28, 2019
@ghost
Copy link

ghost commented Dec 28, 2019

This issue was moved by devoncarew to flutter/flutter#47928.

@ghost ghost closed this as completed Dec 28, 2019
@jmagman
Copy link

jmagman commented Dec 30, 2019

I don't think this should have been moved.

HOST_OS_IOS is 1 if TARGET_OS_IPHONE, so watchOS, tvOS, Catalyst, etc. But it looks like HOST_OS_IOS is synonymous in dart-lang with iOS-only.

           TARGET_OS_IPHONE          - Generated code for firmware, devices, or simulator
              TARGET_OS_IOS             - Generated code will run under iOS 
              TARGET_OS_TV              - Generated code will run under Apple TV OS
              TARGET_OS_WATCH           - Generated code will run under Apple Watch OS
              TARGET_OS_BRIDGE          - Generated code will run under Bridge devices
              TARGET_OS_MACCATALYST     - Generated code will run under macOS

I believe @lesnitsky is asking for "sdk/runtime/bin/process_macos.cc" and friends to handle TARGET_OS_TV functions.
https://github.com/dart-lang/sdk/blob/master/runtime/bin/process_macos.cc#L164

@devoncarew can you re-open? I don't have permissions.

@devoncarew
Copy link
Member

Sure, will re-open.

@devoncarew devoncarew reopened this Dec 31, 2019
@devoncarew
Copy link
Member

See also:

@devoncarew devoncarew added the area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. label Dec 31, 2019
@a-siva a-siva added the type-enhancement A request for a change that isn't a bug label Jan 2, 2020
@mkustermann
Copy link
Member

/cc @a-siva Since it's not allowed to fork() on iOS anyways, we could exclude dart:ios Process.spawn related functionality in the runtime via if/def and reduce AOT code size. wdyt?

@manhluong
Copy link

manhluong commented Jan 15, 2021

Hi, are there updates about this issue?

I would be interested in running Dart (and not Flutter) in tvOS.

@lesnitsky
Copy link
Author

our team was able to run a flutter app on tvOS, submit it to the testflight and get it working on a real device
I'm no longer involved in that project, so I am not sure what is the state of things currently. Last time when I checked the approach was still very messy to make it available for public usage (a lot of quirks in engine code). Everything basically boils down to getting rid of iOS-specific APIs which are not available on tvOS and tricking the flutter tool in a way it is not aware about tvOS as a target, but actually builds a tvOS app

@manhluong
Copy link

I see @lesnitsky, thank you!

I guess is the same line of thoughts for Dart only (instead of Flutter)...

@lesnitsky
Copy link
Author

@manhluong as far as I can remember, we didn't make many changes to dart itself (if any at all). I believe we've just used different build config and those methods calling fork were stripped out (but my memories are very fuzzy)

@manhluong
Copy link

manhluong commented Jan 15, 2021

This sounds very promising @lesnitsky !

I will give it a try when I can and I will report back here.

For Dart only as this is my use case for now: no need to drag in whole of Flutter, for me, for now.

Thank you for answering me!

@lodmfjord
Copy link

Any news on this? What way did you go @manhluong ?

@a-siva
Copy link
Contributor

a-siva commented Mar 24, 2021

/cc @a-siva Since it's not allowed to fork() on iOS anyways, we could exclude dart:ios Process.spawn related functionality in the runtime via if/def and reduce AOT code size. wdyt?
created #45452 to track this.

@manhluong
Copy link

@lodmfjord I switched to another project so didn't have time to try this yet.

@a-siva thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

7 participants