[ https://issues.apache.org/jira/browse/BEAM-3065?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16208706#comment-16208706 ]
ASF GitHub Bot commented on BEAM-3065: -------------------------------------- GitHub user chamikaramj opened a pull request: https://github.com/apache/beam/pull/4007 [BEAM-3065] Avoids generating proto files for Windows if grpcio-tools is not installed. Follow this checklist to help us incorporate your contribution quickly and easily: - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/projects/BEAM/issues/) filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes. - [ ] Each commit in the pull request should have a meaningful subject line and body. - [ ] Format the pull request title like `[BEAM-XXX] Fixes bug in ApproximateQuantiles`, where you replace `BEAM-XXX` with the appropriate JIRA issue. - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [ ] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). --- You can merge this pull request into a Git repository by running: $ git pull https://github.com/chamikaramj/beam avoid_proto_generation_windows Alternatively you can review and apply these changes as the patch at: https://github.com/apache/beam/pull/4007.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #4007 ---- commit 0ca6d3025c0479d7e6bd3a70bca84f651e717167 Author: chamik...@google.com <chamik...@google.com> Date: 2017-10-18T01:46:40Z Avoids generating proto files for Windows if grpcio-tools is not installed. ---- > Proto generation installation is broken for Windows > --------------------------------------------------- > > Key: BEAM-3065 > URL: https://issues.apache.org/jira/browse/BEAM-3065 > Project: Beam > Issue Type: Bug > Components: sdk-py-core > Reporter: Chamikara Jayalath > Assignee: Robert Bradshaw > > "python setup.py sdist" and "python setup.py install" raises following error > for Windows. Failure happens when running gen_protos.py. Robert, seems like > you added this script. Can you take a look ? > C:\Users\chamikara\beam_testing\windows_test_10_16_2017\beam\sdks\python\gen_protos.py:48: > UserWarning: Installing grpcio-tools is recommended for development. > warnings.warn('Installing grpcio-tools is recommended for development.') > Traceback (most recent call last): > File "<string>", line 1, in <module> > File "c:\python27\Lib\multiprocessing\forking.py", line 380, in main > prepare(preparation_data) > File "c:\python27\Lib\multiprocessing\forking.py", line 510, in prepare > '__parents_main__', file, path_name, etc > File > "C:\Users\chamikara\beam_testing\windows_test_10_16_2017\beam\sdks\python\setup.py", > line 203, in <module> > 'test': generate_protos_first(test), > File "c:\python27\Lib\distutils\core.py", line 151, in setup > dist.run_commands() > File "c:\python27\Lib\distutils\dist.py", line 953, in run_commands > self.run_command(cmd) > File "c:\python27\Lib\distutils\dist.py", line 972, in run_command > cmd_obj.run() > File > "C:\Users\chamikara\beam_testing\windows_test_10_16_2017\env1\lib\site-packages\setuptools\command\install.py", > line 67, in run > self.do_egg_install() > File > "C:\Users\chamikara\beam_testing\windows_test_10_16_2017\env1\lib\site-packages\setuptools\command\install.py", > line 109, in do_egg_install > self.run_command('bdist_egg') > File "c:\python27\Lib\distutils\cmd.py", line 326, in run_command > self.distribution.run_command(command) > File "c:\python27\Lib\distutils\dist.py", line 972, in run_command > cmd_obj.run() > File > "C:\Users\chamikara\beam_testing\windows_test_10_16_2017\env1\lib\site-packages\setuptools\command\bdist_egg.py", > line 169, in run > cmd = self.call_command('install_lib', warn_dir=0) > File > "C:\Users\chamikara\beam_testing\windows_test_10_16_2017\env1\lib\site-packages\setuptools\command\bdist_egg.py", > line 155, in call_command > self.run_command(cmdname) > File "c:\python27\Lib\distutils\cmd.py", line 326, in run_command > self.distribution.run_command(command) > File "c:\python27\Lib\distutils\dist.py", line 972, in run_command > cmd_obj.run() > File > "C:\Users\chamikara\beam_testing\windows_test_10_16_2017\env1\lib\site-packages\setuptools\command\install_lib.py", > line 11, in run > self.build() > File "c:\python27\Lib\distutils\command\install_lib.py", line 109, in build > self.run_command('build_py') > File "c:\python27\Lib\distutils\cmd.py", line 326, in run_command > self.distribution.run_command(command) > File "c:\python27\Lib\distutils\dist.py", line 972, in run_command > cmd_obj.run() > File > "C:\Users\chamikara\beam_testing\windows_test_10_16_2017\beam\sdks\python\setup.py", > line 143, in run > gen_protos.generate_proto_files() > File > "C:\Users\chamikara\beam_testing\windows_test_10_16_2017\beam\sdks\python\gen_protos.py", > line 84, in generate_proto_files > p.start() > File "c:\python27\Lib\multiprocessing\process.py", line 130, in start > self._popen = Popen(self) > File "c:\python27\Lib\multiprocessing\forking.py", line 258, in __init__ > cmd = get_command_line() + [rhandle] > File "c:\python27\Lib\multiprocessing\forking.py", line 358, in > get_command_line > is not going to be frozen to produce a Windows executable.''') > RuntimeError: > Attempt to start a new process before the current process > has finished its bootstrapping phase. > This probably means that you are on Windows and you have > forgotten to use the proper idiom in the main module: > if __name__ == '__main__': > freeze_support() > ... > The "freeze_support()" line can be omitted if the program > is not going to be frozen to produce a Windows executable. > Traceback (most recent call last): > File "setup.py", line 203, in <module> > 'test': generate_protos_first(test), > File "c:\python27\Lib\distutils\core.py", line 151, in setup > dist.run_commands() > File "c:\python27\Lib\distutils\dist.py", line 953, in run_commands > self.run_command(cmd) > File "c:\python27\Lib\distutils\dist.py", line 972, in run_command > cmd_obj.run() > File > "C:\Users\chamikara\beam_testing\windows_test_10_16_2017\env1\lib\site-packages\setuptools\command\install.py", > line 67, in run > self.do_egg_install() > File > "C:\Users\chamikara\beam_testing\windows_test_10_16_2017\env1\lib\site-packages\setuptools\command\install.py", > line 109, in do_egg_install > self.run_command('bdist_egg') > File "c:\python27\Lib\distutils\cmd.py", line 326, in run_command > self.distribution.run_command(command) > File "c:\python27\Lib\distutils\dist.py", line 972, in run_command > cmd_obj.run() > File > "C:\Users\chamikara\beam_testing\windows_test_10_16_2017\env1\lib\site-packages\setuptools\command\bdist_egg.py", > line 169, in run > cmd = self.call_command('install_lib', warn_dir=0) > File > "C:\Users\chamikara\beam_testing\windows_test_10_16_2017\env1\lib\site-packages\setuptools\command\bdist_egg.py", > line 155, in call_command > self.run_command(cmdname) > File "c:\python27\Lib\distutils\cmd.py", line 326, in run_command > self.distribution.run_command(command) > File "c:\python27\Lib\distutils\dist.py", line 972, in run_command > cmd_obj.run() > File > "C:\Users\chamikara\beam_testing\windows_test_10_16_2017\env1\lib\site-packages\setuptools\command\install_lib.py", > line 11, in run > self.build() > File "c:\python27\Lib\distutils\command\install_lib.py", line 109, in build > self.run_command('build_py') > File "c:\python27\Lib\distutils\cmd.py", line 326, in run_command > self.distribution.run_command(command) > File "c:\python27\Lib\distutils\dist.py", line 972, in run_command > cmd_obj.run() > File "setup.py", line 143, in run > gen_protos.generate_proto_files() > File > "C:\Users\chamikara\beam_testing\windows_test_10_16_2017\beam\sdks\python\gen_protos.py", > line 87, in generate_proto_files > raise ValueError("Proto generation failed (see log for details).") > ValueError: Proto generation failed (see log for details). > (env1) PS > C:\Users\chamikara\beam_testing\windows_test_10_16_2017\beam\sdks\python> -- This message was sent by Atlassian JIRA (v6.4.14#64029)