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

Windows support? #59

Closed
chrizzFTD opened this issue Mar 5, 2019 · 9 comments · Fixed by #82
Closed

Windows support? #59

chrizzFTD opened this issue Mar 5, 2019 · 9 comments · Fixed by #82
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested

Comments

@chrizzFTD
Copy link
Collaborator

Hi, this looks like a great project!

I wanted to give it a try but after installing via pip install git+git://github.com/tgoodlet/tractor.git, importing tractor fails because forkserver seems to not be available on my os (windows10):

Python 3.7.2 (default, Feb 21 2019, 17:35:59) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tractor
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\ProgramData\Miniconda3\envs\tractor19030502\lib\site-packages\tractor\__init__.py", line 18, in <module>
    from ._trionics import open_nursery
  File "C:\ProgramData\Miniconda3\envs\tractor19030502\lib\site-packages\tractor\_trionics.py", line 21, in <module>
    ctx = mp.get_context("forkserver")
  File "C:\ProgramData\Miniconda3\envs\tractor19030502\lib\multiprocessing\context.py", line 238, in get_context
    return super().get_context(method)
  File "C:\ProgramData\Miniconda3\envs\tractor19030502\lib\multiprocessing\context.py", line 192, in get_context
    raise ValueError('cannot find context for %r' % method) from None
ValueError: cannot find context for 'forkserver'
>>>

Any plan on adding windows support in the future?

@goodboy goodboy added enhancement New feature or request help wanted Extra attention is needed question Further information is requested labels Mar 5, 2019
@goodboy
Copy link
Owner

goodboy commented Mar 5, 2019

Hey @chrizzFTD thanks for attempting to give it a try 😄

Yes, unfortunately no Windows support yet 😢
I don't really use windows at all but I definitely do want to add support!

It should be possible to use the spawn method from multiprocessing.
I've been meaning to try this out since it should work on linux as well.

You're very welcome to try and add it yourself though I have no idea it will work out of the box.
If you're not interested I could definitely use your help testing!

I've made #60 for that specific task and then hopefully adding it solves this 👍

@goodboy
Copy link
Owner

goodboy commented Mar 6, 2019

@chrizzFTD mind trying out #61's branch to see if it works for you on windows?

@chrizzFTD
Copy link
Collaborator Author

Yes, thank you so much for taking a look so quickly @tgoodlet 😃

I've left some updates on #61 (comment), but in short, the only issue I'm seeing is (because of the same windows deal):

trio.MultiError: AttributeError("module 'trio.hazmat' has no attribute 'wait_readable'"), AttributeError("module 'trio.hazmat' has no attribute 'wait_readable'")

I'm keen on helping testing as much as possible!

@goodboy
Copy link
Owner

goodboy commented Mar 6, 2019

I'm keen on helping testing as much as possible!

@chrizzFTD awesome!

because of the same windows deal

Indeed. I'll coordinate with you on #61.

goodboy pushed a commit that referenced this issue Mar 6, 2019
This is very hacky and pokes around in `trio` internals but it *should
work* as it piggy backs on the new cross platform subprocess support.

Relates to #59
goodboy pushed a commit that referenced this issue Mar 6, 2019
This is very hacky and pokes around in `trio` internals but it *should
work* as it piggy backs on the new cross platform subprocess support.

Relates to #59
@goodboy
Copy link
Owner

goodboy commented Mar 6, 2019

Hmm I wonder if part of solving this should be adding a CI job too.
Looks like travis started supporting it late last year!

Oof but no python support yet....

@goodboy
Copy link
Owner

goodboy commented Mar 7, 2019

@njsmith tipped me to free vms from microsoft for testing purposes as well.

goodboy pushed a commit that referenced this issue Mar 7, 2019
This pokes around a little in `trio` hazmat but it *should
work* as it piggy backs on the new cross platform subprocess support.

Relates to #59
@goodboy goodboy mentioned this issue Mar 9, 2019
@goodboy
Copy link
Owner

goodboy commented Oct 15, 2019

Just an update, as of #61 and #62 we do have working windows support both verified in manual testing by @chrizzFTD and now in travisCI.

There's still some kinks to work out (unreliable CI builds it seems) as well as some more documentation needed to get windows users working well with multiprocessing gotchas.

@goodboy
Copy link
Owner

goodboy commented Oct 15, 2019

The unreliable CI builds seem to be either a race condition in determining the "arbiter" actor or some weird issue with being unable to find the pip module?

I want to get #79 docs complete before considering this done as well.

@goodboy
Copy link
Owner

goodboy commented Oct 15, 2019

Also need to update the listed OS support in setup.py.

goodboy added a commit that referenced this issue Oct 16, 2019
Fill out with the solution from #79 and move the section further down.
This should hopefully suffice what's left to fulfil for #59

Resolves #79
goodboy added a commit that referenced this issue Oct 16, 2019
Fill out with the solution from #79 and move the section further down.
This should hopefully suffice what's left to fulfil for #59

Resolves #79
goodboy added a commit that referenced this issue Oct 16, 2019
Fill out with the solution from #79 and move the section further down.
This should hopefully suffice what's left to fulfil for #59

Resolves #79
goodboy added a commit that referenced this issue Jan 29, 2020
Thanks to @salotz for pointing out that the first example in the docs
was broken. Though it's somewhat embarrassing this might also explain
the problem in #79 and certain issues in #59...

The solution here is to import the target RPC module using the its
unique basename and absolute filepath in the sub-actor that requires it.
Special handling for `__main__` and `__mp_main__` is needed since the
spawned subprocess will have no knowledge about these parent-
-state-specific module variables. Solution: map the modules name to the
respective module file basename in the child process since the module
variables will of course have different values in children.
goodboy added a commit that referenced this issue Jan 29, 2020
Thanks to @salotz for pointing out that the first example in the docs
was broken. Though it's somewhat embarrassing this might also explain
the problem in #79 and certain issues in #59...

The solution here is to import the target RPC module using the its
unique basename and absolute filepath in the sub-actor that requires it.
Special handling for `__main__` and `__mp_main__` is needed since the
spawned subprocess will have no knowledge about these parent-
-state-specific module variables. Solution: map the modules name to the
respective module file basename in the child process since the module
variables will of course have different values in children.
goodboy added a commit that referenced this issue Jan 29, 2020
Thanks to @salotz for pointing out that the first example in the docs
was broken. Though it's somewhat embarrassing this might also explain
the problem in #79 and certain issues in #59...

The solution here is to import the target RPC module using the its
unique basename and absolute filepath in the sub-actor that requires it.
Special handling for `__main__` and `__mp_main__` is needed since the
spawned subprocess will have no knowledge about these parent-
-state-specific module variables. Solution: map the modules name to the
respective module file basename in the child process since the module
variables will of course have different values in children.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants