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

Add windows support #104

Merged
merged 12 commits into from
Jan 26, 2017
Merged

Add windows support #104

merged 12 commits into from
Jan 26, 2017

Conversation

ethankhall
Copy link
Contributor

I took a swing at Windows support with some inspiration from the chats in #95.

Here we need to have an exe to run on windows, since golang is easier to
build on multiple platforms than rust, I chose it. I'm checking in the
exe's since we need them to be able to run without having to install
golang everywhere. We could put them up into artifactory so they aren't
checked in but it's only 1.6M each. This is something we can discuss
before merging.

Here I also took the OperatingSystem mostly intact from Gradle. The one
change that I did was to remove the extension stipping, since everything
shouldn't have one if possible.

I split the PythonDetailsTest into PythonDetailsUnixTest and
PythonDetailsWindowsTest to make sure that everything can be tested on
different platforms.

Things left:

Make the tests actually work. Right now it looks like the exec can
run, but windows doesn't honor the shebang line so we have to make the
pex's end with .py so they can run :-(
Drinking.
This change has a lot in it, mostly because removed the
VirtualEnvExecutableHelper file and replaced it with the
VirtualEnvironment. The former required a PythonDetails to do anything,
so instead of doing that now you just call into details and ask for the
venv. All of the methods that were static no longer are, and life is
better :-)

Supersedes #103

@@ -0,0 +1,384 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised this isn't provided by an apache commons library... did you look?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't. But I haven't seen something like this before either.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nooo. Don't do it like that. The gradle developers I have been working with on another project recommend:

+import org.apache.tools.ant.taskdefs.condition.Os

You can look at my PR for examples on use. I reached a stopping point at my pay job today and was going to pick this up again in the morn. I'll take a look at what you did here a bit closer.

@sholsapp
Copy link
Contributor

Here we need to have an exe to run on windows, since golang is easier to
build on multiple platforms than rust, I chose it. I'm checking in the
exe's since we need them to be able to run without having to install
golang everywhere. We could put them up into artifactory so they aren't
checked in but it's only 1.6M each. This is something we can discuss
before merging.

This seems really strange to me. I would prefer to build an extremely simple hello world C/C++ application than to depend on Golang just for a test case. Seems based on https://msdn.microsoft.com/en-us/library/ms235639.aspx that it should be pretty easy to do, assuming it is easy to open a developer console.

@ethankhall
Copy link
Contributor Author

I thought about using C/C++ but the reason I didn't was because I didn't have a env to build it. I figured that anyone could update dummy exe's in go since the go compiler can cross target to windows with just some ENV args. We don't build the exe's as part of the build, they are (currently) checked in so the only regular use of golang is when we need to update the exes.

@lorencarvalho
Copy link
Contributor

+1 on the Go executables seeming strange - they seem to just spit out a string (the version of Python requests). Can you elaborate on their actual purpose?

@ethankhall
Copy link
Contributor Author

ethankhall commented Jan 17, 2017

On *nix boxes we can just echo out "Python x.y" but on windows we need a real exe. Since windows uses the extension to decide how to execute it, an exe must really be an exe not just a CMD script (tried that first). We could use C/C++ to do this, but then when ever we need to update/add to this, we'll have to have very good docs on how to build the environment to do this. Either way we'll need to compile a binary to use for testing.

@lorencarvalho
Copy link
Contributor

Can't we do C:\path\to\python.exe -V ?

@ethankhall
Copy link
Contributor Author

We do that, the though here was that instead of having to rely on the user's setup, we can just drop some stub exec's that just respond with the version number.

@scphantm
Copy link

I'm getting test errors i am about to dig into when i do a clean build, but off the hand, you're python.exe doesn't reflect reality very well. You have your mock exe's as

shim/python26.exe
shim/python27.exe
shim/python35.exe

i haven't seen a windows machine yet that versions the exe like this. Primarily since these backwards machines don't have symlinks. (well, it does have mklink, but it requires admin access, which means, we don't have symlinks) This is the way its done everywhere i've ever seen

shim/python26/python.exe
shim/python27/python.exe
shim/python35/python.exe

And then the version used by default when you type python is the first one it encounters in the path. If you want specifically 3.5, you would have to type shim/python35/python.exe ?

@ethankhall
Copy link
Contributor Author

@scphantm the test copies then out to disk using the pattern /python{version}/Scripts/python{, major, mayor.minor}.exe. we then prefix those search paths.

@ethankhall
Copy link
Contributor Author

What test failure are you getting? The integ tests don't work yet

@scphantm
Copy link

9:50:54 AM: Executing external task 'build'...
Parallel execution with configuration on demand is an incubating feature.
:buildSrc:compileJava UP-TO-DATE
:buildSrc:compileGroovy UP-TO-DATE
:buildSrc:pluginDescriptors UP-TO-DATE
:buildSrc:processResources UP-TO-DATE
:buildSrc:classes UP-TO-DATE
:buildSrc:jar UP-TO-DATE
:buildSrc:assemble UP-TO-DATE
:buildSrc:pluginUnderTestMetadata UP-TO-DATE
:buildSrc:compileTestJava UP-TO-DATE
:buildSrc:compileTestGroovy UP-TO-DATE
:buildSrc:processTestResources UP-TO-DATE
:buildSrc:testClasses UP-TO-DATE
:buildSrc:test UP-TO-DATE
:buildSrc:validateTaskProperties UP-TO-DATE
:buildSrc:check UP-TO-DATE
:buildSrc:build UP-TO-DATE
Building using version 0.4.1-SNAPSHOT
:pivy-importer:compileJava UP-TO-DATE
:pygradle-plugin:compileJava UP-TO-DATE
:pivy-importer:compileGroovy
:pygradle-plugin:compileGroovy
:pivy-importer:compileGroovy UP-TO-DATE
:pivy-importer:processResources UP-TO-DATE
:pivy-importer:classes UP-TO-DATE
:pivy-importer:jar
:pygradle-plugin:compileGroovy UP-TO-DATE
:pygradle-plugin:pluginDescriptors UP-TO-DATE
:pygradle-plugin:processResources UP-TO-DATE
:pygradle-plugin:classes UP-TO-DATE
:pygradle-plugin:jar
:pivy-importer:startScripts
:pivy-importer:distTar
:pygradle-plugin:groovydoc
:pivy-importer:distZip
:pivy-importer:groovydoc
Trying to override old definition of task fileScanner
Trying to override old definition of task fileScanner
Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
[ant:groovydoc] line 69:57: unexpected token: >
[ant:groovydoc] line 48:44: unexpected token: >
[ant:groovydoc] line 51:52: unexpected token: >
[ant:groovydoc] line 52:13: unexpected token: PythonExtension
[ant:groovydoc] line 53:13: unexpected token: PythonDetails
[ant:groovydoc] line 54:13: unexpected token: String
[ant:groovydoc] line 57:12: unexpected token: List
[ant:groovydoc] line 60:12: unexpected token: FileCollection
[ant:groovydoc] line 81:27: expecting SEMI, found ','
[ant:groovydoc] line 81:47: unexpected token: >
[ant:groovydoc] line 34:43: unexpected token: >
[ant:groovydoc] line 66:23: expecting SEMI, found ','
:pivy-importer:javadocJar
:pivy-importer:sourceJar
:pivy-importer:assemble
:pivy-importer:checkstyleMain
:pivy-importer:compileTestJava UP-TO-DATE
:pivy-importer:compileTestGroovy UP-TO-DATE
:pivy-importer:processTestResources UP-TO-DATE
:pivy-importer:testClasses UP-TO-DATE
:pivy-importer:checkstyleTest UP-TO-DATE
:pivy-importer:codenarcMain
:pygradle-plugin:javadocJar
:pygradle-plugin:sourceJar
:pygradle-plugin:assemble
:pygradle-plugin:compileIntegTestJava UP-TO-DATE
:pygradle-plugin:compileIntegTestGroovy
:pygradle-plugin:processIntegTestResources
:pygradle-plugin:integTestClasses
:pygradle-plugin:checkstyleIntegTest UP-TO-DATE
:pygradle-plugin:checkstyleMain
:pygradle-plugin:compileTestJava UP-TO-DATE
:pygradle-plugin:compileTestGroovy UP-TO-DATE
:pygradle-plugin:processTestResources UP-TO-DATE
:pygradle-plugin:testClasses UP-TO-DATE
:pygradle-plugin:checkstyleTest UP-TO-DATE
:pygradle-plugin:codenarcIntegTest
CodeNarc completed: (p1=0; p2=0; p3=0) 3152ms
:pivy-importer:codenarcTest UP-TO-DATE
:pivy-importer:licenseMain
:pygradle-plugin:codenarcMain
:pivy-importer:licenseMain UP-TO-DATE
:pivy-importer:licenseTest UP-TO-DATE
:pivy-importer:license UP-TO-DATE
:pivy-importer:test UP-TO-DATE
:pivy-importer:check
:pivy-importer:shadowJar
CodeNarc completed: (p1=0; p2=0; p3=0) 2558ms
:pygradle-plugin:codenarcTest
CodeNarc completed: (p1=0; p2=0; p3=0) 1546ms
:pivy-importer:build
:pivy-importer:importRequiredDependencies
:pygradle-plugin:test UP-TO-DATE
:pygradle-plugin:pluginUnderTestMetadata
:pygradle-plugin:licenseIntegTest UP-TO-DATE
:pygradle-plugin:licenseMain UP-TO-DATE
:pygradle-plugin:licenseTest
Unknown file extension: pygradle-plugin\src\test\resources\windows\python\shim\python26.exe
Unknown file extension: pygradle-plugin\src\test\resources\windows\python\shim\python27.exe
Unknown file extension: pygradle-plugin\src\test\resources\windows\python\shim\python35.exe
:pygradle-plugin:licenseTest UP-TO-DATE
:pygradle-plugin:license UP-TO-DATE
:pygradle-plugin:validateTaskProperties
alabaster:0.7=alabaster:0.7.1
pytz:0a=pytz:2016.4
Babel:0.8=Babel:1.0
sphinx_rtd_theme:0.1=sphinx_rtd_theme:0.1.1
chardet:2.2=chardet:2.3.0
setuptools:0.6a2=setuptools:19.1.1
idna:2.0.0=idna:2.0
docutils:0.12
09:51:29.003 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in virtualenv:15.0.1
Task property validation finished with warnings:
  - Warning: Task type 'com.linkedin.gradle.python.tasks.BuildPexTask' declares property that is not annotated: 'reason'.
  - Warning: Task type 'com.linkedin.gradle.python.tasks.InstallVirtualEnvironmentTask' declares property that is not annotated: 'container'.
  - Warning: Task type 'com.linkedin.gradle.python.tasks.InstallVirtualEnvironmentTask' declares property that is not annotated: 'pythonDetails'.
  - Warning: Task type 'com.linkedin.gradle.python.tasks.InstallVirtualEnvironmentTask' declares property that is not annotated: 'reason'.
  - Warning: Task type 'com.linkedin.gradle.python.tasks.PipInstallTask' declares property that is not annotated: 'configurationFiles'.
  - Warning: Task type 'com.linkedin.gradle.python.tasks.PipInstallTask' declares property that is not annotated: 'reason'.
  - Warning: Task type 'com.linkedin.gradle.python.tasks.PyCoverageTask' declares property that is not annotated: 'extraArgs'.
  - Warning: Task type 'com.linkedin.gradle.python.tasks.PyCoverageTask' declares property that is not annotated: 'outputStream'.
  - Warning: Task type 'com.linkedin.gradle.python.tasks.PyCoverageTask' declares property that is not annotated: 'specificFileGiven'.
  - Warning: Task type 'com.linkedin.gradle.python.tasks.PyTestTask' declares property that is not annotated: 'extraArgs'.
  - Warning: Task type 'com.linkedin.gradle.python.tasks.PyTestTask' declares property that is not annotated: 'specificFileGiven'.
  - Warning: Task type 'com.linkedin.gradle.python.tasks.SourceDistTask' declares property that is not annotated: 'distDir'.
09:51:35.757 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pip:7.1.2
09:51:40.033 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pytest:3.0.5
09:51:43.329 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in virtualenv:1.10
09:51:46.691 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in scripttest:1.3
09:51:46.810 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in mock:2.0.0
09:51:48.762 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in py:1.4.29
09:51:48.842 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in argparse:1.4.0
09:51:49.888 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in colorama:0.3.7
09:51:49.919 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pbr:0.11.0
09:51:50.061 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in six:1.9.0
09:51:50.093 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in funcsigs:1.0.0
09:51:50.147 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in Sphinx:1.5.1
09:52:06.463 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in Jinja2:2.7
09:52:07.636 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in Pygments:2.0
09:52:15.801 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in Sphinx:1.3
09:52:26.541 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in unittest2:1.1.0
09:52:26.607 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pip:9.0.1
09:52:29.950 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in ordereddict:1.1
09:52:29.973 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in six:1.5.0
09:52:30.092 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in Jinja2:2.3
09:52:32.293 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in docutils:0.12
09:52:37.148 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in snowballstemmer:1.1.0
09:52:37.287 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in Babel:1.3
09:52:48.528 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in alabaster:0.7.1
09:52:48.641 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in imagesize:0.7.1
09:52:48.663 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in requests:2.12.5
09:52:54.674 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in colorama:0.3.5
09:52:54.700 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in nose:1.3.7
09:52:56.195 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in simplejson:3.10.0
09:52:56.245 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in html5lib:1.0b10
09:52:59.706 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in SQLAlchemy:0.9.0
09:53:14.588 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in Whoosh:2.0.0
09:53:17.747 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in MarkupSafe:0.23
09:53:17.791 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in Babel:1.0
09:53:27.878 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in six:1.4.0
09:53:27.906 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in sphinx_rtd_theme:0.1.1
09:53:28.024 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in traceback2:1.4.0
09:53:28.064 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pretend:1.0.8
09:53:28.089 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pytz:2016.4
09:53:28.560 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pyOpenSSL:0.14
09:53:28.619 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in cryptography:1.3.4
09:53:34.374 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in idna:2.0
09:53:34.433 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in PySocks:1.5.6
09:53:34.457 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in six:1.10.0
09:53:34.484 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in webencodings:0.5
09:53:34.509 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in setuptools:18.5
09:53:36.928 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in Genshi:0.7
09:53:38.083 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in chardet:2.3.0
09:53:38.142 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in datrie:0.7.1
09:53:39.604 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in lxml:3.7.2
09:53:52.152 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pytz:2016.10
09:53:53.329 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in Sphinx:1.1
09:54:02.555 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in linecache2:1.0.0
09:54:02.579 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in cryptography:0.2.1
09:54:45.847 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in six:1.5.2
09:54:45.874 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pyasn1:0.1.8
09:54:45.915 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in six:1.4.1
09:54:45.939 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in setuptools:11.3
09:54:47.292 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in enum34:1.1.6
09:54:47.324 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in ipaddress:1.0.18
09:54:48.358 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in cffi:1.4.1
09:54:48.502 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in doc8:0.7.0
09:54:48.606 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pyenchant:1.6.8
09:54:49.644 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in readme_renderer:16.0
09:54:49.856 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in sphinx_rtd_theme:0.1.10a0
09:54:51.024 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in sphinxcontrib-spelling:2.3.0
09:54:52.322 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in flake8:3.2.1
09:54:52.459 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in flake8-import-order:0.11
09:54:52.487 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pep8-naming:0.4.1
09:54:52.512 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in iso8601:0.1.11
09:54:52.541 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pyasn1-modules:0.0.8
09:54:52.596 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in hypothesis:1.11.4
09:54:54.079 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in certifi:2015.04.28
09:54:55.202 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in wincertstore:0.2
09:54:56.245 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in setuptools:19.1.1
09:54:57.409 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in Cython:0.20
09:55:05.509 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in cssselect:0.7
09:55:05.633 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in beautifulsoup4:4.5.3
09:55:05.709 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in Pygments:1.2
09:55:08.985 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in cffi:0.8
09:55:10.040 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in certifi:1.0.1
09:55:10.101 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pycparser:2.17
09:55:11.175 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in restructuredtext_lint:0.7.0
09:55:11.315 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in stevedore:1.20.0
09:55:12.645 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in bleach:1.5.0
09:55:12.675 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in Pygments:2.1.3
09:55:21.851 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pyenchant:1.6.5
09:55:21.888 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in Sphinx:0.6
09:55:27.174 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pyflakes:0.8.1
09:55:27.205 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pycodestyle:2.0.0
09:55:27.249 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in mccabe:0.5.0
09:55:27.284 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pycodestyle:2.2.0
09:55:27.325 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in importlib:1.0.4
09:55:27.353 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in Counter:1.0.0
09:55:27.384 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in fake-factory:0.5.2
09:55:28.510 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in Django:1.7
09:55:52.539 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in numpy:1.9.0
09:56:04.049 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pytest:2.7.0
09:56:05.803 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in certifi:2015.11.20
09:56:06.903 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pbr:1.8.0
09:56:06.944 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in html5lib:0.999
09:56:09.372 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in Pygments:0.8
09:56:11.864 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in Jinja2:2.1
09:56:13.185 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in py:1.4.25
09:56:14.456 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in setuptools-git:1.1
09:56:14.499 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in flake8:2.4.0
09:56:14.631 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pep8:1.5.7
09:56:14.673 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in mccabe:0.2.1
09:56:14.694 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in flake8:2.5.4
09:56:15.864 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pytest:2.9.1
09:56:18.141 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pytest-cov:2.2.1
09:56:21.599 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pytest:2.6.0
09:56:24.404 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in coverage:3.7.1
09:56:25.491 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in py:1.4.22
09:56:25.569 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pytest-xdist:1.14
09:56:26.638 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in wheel:0.26.0
09:56:26.775 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in ed25519ll:0.6
09:56:26.814 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in keyring:10.2
09:56:26.895 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pyxdg:0.25
09:56:26.933 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in SecretStorage:2.3.1
09:56:30.327 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pywin32-ctypes:0.0.1
09:56:30.352 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in cryptography:1.7.1
09:56:40.070 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in dbus-python:1.2.4
09:56:42.362 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pytest:2.9.0
09:56:44.801 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in Sphinx:1.4.1
09:57:00.301 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pex:1.1.4
09:57:04.045 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in setuptools:2.2
09:57:06.720 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in wincertstore:0.1
09:57:06.751 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in certifi:0.0.8
09:57:06.809 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in requests:2.10.0
09:57:09.098 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pyOpenSSL:0.13
09:57:10.402 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in ndg-httpsclient:0.4.2
09:57:10.495 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pyasn1:0.1.9
09:57:10.537 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in pyOpenSSL:16.2.0
09:57:12.731 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in Flask:0.11.1
09:57:15.203 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in Werkzeug:0.7
09:57:18.496 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in Jinja2:2.4
09:57:20.896 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in itsdangerous:0.21
09:57:20.924 INFO  c.l.p.i.deps.DependencyDownloader - Pulling in click:2.0
09:57:20.958 INFO  c.l.python.importer.ImporterCLI - Execution Finished!
:pygradle-plugin:integTest

com.linkedin.gradle.python.plugin.PexIntegrationTest > can build thin pex FAILED
    org.gradle.testkit.runner.UnexpectedBuildFailure at PexIntegrationTest.groovy:43

com.linkedin.gradle.python.plugin.PexIntegrationTest > can build fat pex FAILED
    org.gradle.testkit.runner.UnexpectedBuildFailure at PexIntegrationTest.groovy:102

com.linkedin.gradle.python.plugin.PipIntegrationTest > will write out pinned.txt FAILED
    org.gradle.testkit.runner.UnexpectedBuildFailure at PipIntegrationTest.groovy:46

com.linkedin.gradle.python.plugin.PythonPluginIntegrationTest > can build library FAILED
    org.gradle.testkit.runner.UnexpectedBuildFailure at PythonPluginIntegrationTest.groovy:39

com.linkedin.gradle.python.plugin.PythonPluginIntegrationTest > can use external library FAILED
    org.gradle.testkit.runner.UnexpectedBuildFailure at PythonPluginIntegrationTest.groovy:88

com.linkedin.gradle.python.plugin.PythonWebApplicationPluginIntegrationTest > can build web-app FAILED
    org.gradle.testkit.runner.UnexpectedBuildFailure at PythonWebApplicationPluginIntegrationTest.groovy:43
Task :pygradle-plugin:integTest results: FAILURE (6 tests, 0 successes, 6 failures, 0 skipped)

6 tests completed, 6 failed
:pygradle-plugin:integTest FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':pygradle-plugin:integTest'.
> There were failing tests. See the report at: file:///C:/Apps/Willie/code/SDA/pygradle/build/pygradle-plugin/reports/integration-test/index.html

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 11 mins 23.911 secs
There were failing tests. See the report at: file:///C:/Apps/Willie/code/SDA/pygradle/build/pygradle-plugin/reports/integration-test/index.html
10:02:19 AM: External task execution finished 'build'.

i tracked down the pex thin, its right, the file really isn't there

FileNotFoundError: [WinError 3] The system cannot find the path specified: 'c:\\users\\me\\appdata\\local\\temp\\1\\junit8518805287579601148\\foo\\build\\venv\\lib\\site-packages\\pip\\_vendor\\requests\\packages\\urllib3\\packages\\ssl_match_hostname\\__pycache__\\_implementation.cpython-35.pyc' -> 'C:\\Users\\me\\AppData\\Local\\Temp\\1\\pip-woxn624_-uninstall\\users\\me\\appdata\\local\\temp\\1\\junit8518805287579601148\\foo\\build\\venv\\lib\\site-packages\\pip\\_vendor\\requests\\packages\\urllib3\\packages\\ssl_match_hostname\\__pycache__\\_implementation.cpython-35.pyc'

theres an init cpython-35.pyc in the folder but not an _implementation.cpython-35.pyc

@scphantm
Copy link

those are the only six, not bad for a first run. not bad at all. Im digging deeper, but im kinda digging how you did this.

@ethankhall
Copy link
Contributor Author

Thanks. I know the integ tests were't working on my VM due to a few things that need to be fixed:

  • Pex's should be .py on windows boxs so that windows will use the registered Python exe to run them (tested it locally, and it worked)
  • The bash script thats used for thin pex's should be replaced with a python script, and on windows end in .py so they will run

I have't seen your missing file issue before. @sholsapp @sixninetynine @zvezdan have you guys?

@scphantm
Copy link

I wish i could attach the test result, but with the info thats recorded in it, my auditors would have a stroke.

@scphantm
Copy link

7:55:36 PM: Executing external task 'installLinks --stacktrace'...
Adding keystore file to JVM: C:\Users\me\.gradle\wrapper\dists\gradle-3.1-all\ejgglywf033yp6s4x8ahmgm74\gradle-3.1\init.d\sec\hmhs-gradle.keystore
:pinRequirements UP-TO-DATE
:createVirtualEnvironment UP-TO-DATE
:installLinks FAILED
:autoLintGradle

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':installLinks'.
> C:\Apps\Willie\code\SDA\syzygy\activate.bat

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':installLinks'.
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
	at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
	at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
	at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
	at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
	at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:233)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:215)
	at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:74)
	at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:55)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:32)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:113)
	at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
	at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
	at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
	at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
	at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
	at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
	at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
	at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:186)
	at org.gradle.internal.Factories$1.create(Factories.java:22)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
	at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:183)
	at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:33)
	at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:112)
	at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:106)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
	at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)
	at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:92)
	at org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:66)
	at org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:46)
	at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
	at org.gradle.tooling.internal.provider.runner.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:58)
	at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
	at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:79)
	at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:51)
	at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:59)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
	at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:47)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
	at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
	at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
	at org.gradle.util.Swapper.swap(Swapper.java:38)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
	at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
	at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
	at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
	at org.gradle.launcher.daemon.server.exec.HintGCAfterBuild.execute(HintGCAfterBuild.java:44)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
	at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
	at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:293)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
	at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
Caused by: java.nio.file.FileAlreadyExistsException: C:\Apps\Willie\code\SDA\syzygy\activate.bat
	at com.linkedin.gradle.python.util.FileSystemUtils.makeSymLink(FileSystemUtils.java:49)
	at com.linkedin.gradle.python.util.FileSystemUtils$makeSymLink.call(Unknown Source)
	at com.linkedin.gradle.python.plugin.PythonPlugin$_apply_closure3$_closure16.doCall(PythonPlugin.groovy:162)
	at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:587)
	at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:568)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
	... 70 more


BUILD FAILED

Total time: 2.023 secs
C:\Apps\Willie\code\SDA\syzygy\activate.bat
7:55:39 PM: External task execution finished 'installLinks --stacktrace'.

deleting the activate file moves me forward again

@scphantm
Copy link

8:08:20 PM: Executing external task 'buildDocsHtml'...
Highmark SSL Keystore not found
:pinRequirements UP-TO-DATE
:createVirtualEnvironment UP-TO-DATE
:installLinks UP-TO-DATE
:installSetupRequirements
Install setuptools-19.1.1 ........................................... [STARTING]
Install (0:07.489 s) ................................................ [FINISHED]
Install wheel-0.26.0 ................................................ [STARTING]
Install (0:05.955 s) ................................................ [FINISHED]
Install pip-7.1.2 ................................................... [STARTING]
Install (0:15.769 s) ................................................ [FINISHED]
Install setuptools-git-1.1 .......................................... [STARTING]
Install (0:04.352 s) ................................................ [FINISHED]
Install pbr-1.8.0 ................................................... [STARTING]
Install (0:07.283 s) ................................................ [FINISHED]
Install argparse-1.4.0 .............................................. [STARTING]
Install (0:04.010 s) ................................................ [FINISHED]
:installBuildRequirements
Install alabaster-0.7.1 ............................................. [STARTING]
Install (0:04.056 s) ................................................ [FINISHED]
Install Babel-1.3 ................................................... [STARTING]
Install (0:25.756 s) ................................................ [FINISHED]
Install colorama-0.3.5 .............................................. [STARTING]
Install (0:04.195 s) ................................................ [FINISHED]
Install docutils-0.11 ............................................... [STARTING]
Install (1:12.805 s) ................................................ [FINISHED]
Install flake8-2.5.4 ................................................ [STARTING]
Install (0:05.513 s) ................................................ [FINISHED]
Install imagesize-0.7.1 ............................................. [STARTING]
Install (0:03.940 s) ................................................ [FINISHED]
Install Jinja2-2.3 .................................................. [STARTING]
Install (0:12.662 s) ................................................ [FINISHED]
Install mccabe-0.2.1 ................................................ [STARTING]
Install (0:03.955 s) ................................................ [FINISHED]
Install pep8-1.5.7 .................................................. [STARTING]
Install (0:04.034 s) ................................................ [FINISHED]
Install pyflakes-0.8.1 .............................................. [STARTING]
Install (0:04.478 s) ................................................ [FINISHED]
Install Pygments-2.0 ................................................ [STARTING]
Install (0:16.406 s) ................................................ [FINISHED]
Install pytz-2016.4 ................................................. [STARTING]
Install (0:28.311 s) ................................................ [FINISHED]
Install six-1.10.0 .................................................. [STARTING]
Install (0:05.274 s) ................................................ [FINISHED]
Install snowballstemmer-1.1.0 ....................................... [STARTING]
Install (0:05.982 s) ................................................ [FINISHED]
Install Sphinx-1.4.1 ................................................ [STARTING]
Install (0:28.833 s) ................................................ [FINISHED]
:installPythonRequirements
:installTestRequirements
Install argparse-1.4.0 .............................................. [STARTING]
Install (0:04.507 s) ................................................ [FINISHED]
Install colorama-0.3.7 .............................................. [STARTING]
Install (0:04.872 s) ................................................ [FINISHED]
Install coverage-3.7.1 .............................................. [STARTING]
Install (0:05.982 s) ................................................ [FINISHED]
Install py-1.4.29 ................................................... [STARTING]
Install (0:04.479 s) ................................................ [FINISHED]
Install pytest-cov-2.2.1 ............................................ [STARTING]
Install (0:03.847 s) ................................................ [FINISHED]
Install pytest-xdist-1.14 ........................................... [STARTING]
Install (0:05.041 s) ................................................ [FINISHED]
Install pytest-2.9.1 ................................................ [STARTING]
Install (0:05.257 s) ................................................ [FINISHED]
:installProject
Install syzygy ...................................................... [STARTING]
Install (0:08.954 s) ................................................ [FINISHED]
:buildDocsHtml
Running Sphinx v1.4.1
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 9 source files that are out of date
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
preparing documents... done

generating indices... genindex
writing additional pages... search

copying static files... done
copying extra files... done
dumping search index in English (code: en) ... done
dumping object inventory... done
build succeeded.
:autoLintGradle

BUILD SUCCESSFUL

Total time: 5 mins 29.027 secs
8:13:50 PM: External task execution finished 'buildDocsHtml'.

Ok, got things compiling sphinx docs on windows (WHOOHOO!!). Now, the next problem. Look at this log. 5:30 to compile documentation is unusable. And this log is the second time i compiled the doc. I can understand doing all the installs into the venv the first time, but is it really necessary subsequent times? What can we do to cut this time down to something reasonable for editing code?

Also, i deleted the activate.bat file and ran things again and the vm started, after creating a new activate.bat. It appears that its recording somewhere if it created it or not, and if the two locations don't jive, it errors. but thats a guess. Great progress, thank you. With this i can keep testing and see if i an convince others that this will work. Thanks

@ethankhall
Copy link
Contributor Author

@scphantm I've updated the PR to fix your activate problem. Wow those install times are long. PyGradle should cache the installs so the next time it should be really fast.

@scphantm
Copy link

thanks, ill pull it and give it a shot. i can run it with --debug if you want, i just need a private spot to put the file, i can't post that publicly, shows too much of my machine config.

@ethankhall
Copy link
Contributor Author

ethankhall commented Jan 19, 2017

Debug is a little much, info should be good enough. You can try a private gist? Or I can give you my email and you can email the file.

@scphantm
Copy link

i emailed them to the address on your profile

@ethankhall
Copy link
Contributor Author

Ok, It looked like no caching took place at all. Did you clean up build dir before you ran the second time?

Something that's kinda strange is how long it's taking to do the installs. Would you be able to print out the directory tree of the built venv? Maybe the path has changes slightly and we need to fix that.

@scphantm
Copy link

i did nothing between the command, just one right after the other just

gradlew -b pygradle.gradle buildDocsHtml --info
gradlew -b pygradle.gradle buildDocsHtml --info

the different gradle file is because while this is being worked out, i don't want it effecting the main project.

contents of that pygradle are

buildscript {
    dependencies {
        classpath "com.linkedin.pygradle:pygradle-plugin:0.+"
    }
}

apply plugin: 'com.linkedin.python-sdist'

repositories {
    pyGradlePyPi()
    mavenLocal()
}

@ethankhall
Copy link
Contributor Author

@scphantm looks like Windows FileSystem is slower than the *nix ones. From a quick google search https://stackoverflow.com/questions/1842798/python-performance-on-windows . I don't know if it's true but it's what I found that could explain it.

@scphantm
Copy link

yea, NTFS is many orders of magnitude slower than EXT or HPFS. But thats not the part that bothers me. The part that bothers me is why does it install the dependency libraries into the VENV each time you run it? The whole gradle'esk way of doing things is if it didn't change, skip it. This piece installs these modules when they didn't change.

@zvezdan
Copy link
Member

zvezdan commented Jan 21, 2017

@scphantm
When built on Unix, the packages are installed in venv only the first time.
After that it should show [SKIPPING] when trying to build them and the whole "build" should happen really fast. If you don't see that in your builds on Windows, then something else is going on and I'm sure that @ethankhall will figure it out if that's the case.

@scphantm
Copy link

and thats exactly whats happening. its not skipping for some reason. the logs i sent him show that. I don't mind taking 4 or 5 min for the first run, i can live with that. but not each run, somethings wrong there.

@ethankhall
Copy link
Contributor Author

I think I found the issue(s). We are doing

File egg = new File(pythonDetails.virtualEnv, "lib/python${pyVersion}/site-packages/${sanitizedName}-${packageInfo.version}-py${pyVersion}.egg-info")
File dist = new File(pythonDetails.virtualEnv, "lib/python${pyVersion}/site-packages/${sanitizedName}-${packageInfo.version}.dist-info")

Well on Windows the path is Lib\site-packages so we were just wrong where we were looking. Fixing it locally, will push when it's working.

@ethankhall ethankhall force-pushed the add-windows-support branch 3 times, most recently from a4a8a06 to 373e60f Compare January 21, 2017 04:11
@ethankhall
Copy link
Contributor Author

Ok the tests all work properly now, and we have Windows CI.. If this works the PR should be good to go.

@scphantm
Copy link

went from 5 minutes to 16 seconds. Looks like the integration tests still fail, at least they do on my machine.

The only other optimization point i can see is this

:installProject
Install syzygy ...................................................... [STARTING]
Install (0:04.370 s) ................................................ [FINISHED]
:buildDocsHtml

Not exactly sure what it does here, but if its possible to do the whole "if nothing changed, skip it" then great.

Otherwise, great job!!

@ethankhall
Copy link
Contributor Author

@zvezdan @sholsapp do you guys know how to cache that install?

The tests pass on AppVeyor, what is the error on your box?

@scphantm
Copy link

i emailed you the report.

@ethankhall
Copy link
Contributor Author

Thanks, I have no idea. I'll pass it onto one of the team members that should be able to help better on Monday.

@scphantm
Copy link

There are actually a few dependencies that are installing each time, this colorama seems to be the worst offender tho.

Installing setuptools, pip, wheel...done.
:installLinks
:installSetupRequirements
Install setuptools-19.1.1 ........................................... [SKIPPING]
Install wheel-0.26.0 ................................................ [SKIPPING]
Install pip-7.1.2 ................................................... [SKIPPING]
Install setuptools-git-1.1 .......................................... [SKIPPING]
Install pbr-1.8.0 ................................................... [SKIPPING]
Install argparse-1.4.0 .............................................. [SKIPPING]
:installBuildRequirements
Install alabaster-0.7.1 ............................................. [SKIPPING]
Install Babel-1.3 ................................................... [SKIPPING]
Install colorama-0.3.5 .............................................. [STARTING]
Install (0:04.133 s) ................................................ [FINISHED]
Install docutils-0.11 ............................................... [SKIPPING]
Install flake8-2.5.4 ................................................ [SKIPPING]
Install imagesize-0.7.1 ............................................. [SKIPPING]
Install Jinja2-2.3 .................................................. [SKIPPING]
Install mccabe-0.2.1 ................................................ [SKIPPING]
Install pep8-1.5.7 .................................................. [SKIPPING]
Install pyflakes-0.8.1 .............................................. [SKIPPING]
Install Pygments-2.0 ................................................ [SKIPPING]
Install pytz-2016.4 ................................................. [SKIPPING]
Install six-1.10.0 .................................................. [SKIPPING]
Install snowballstemmer-1.1.0 ....................................... [SKIPPING]
Install Sphinx-1.4.1 ................................................ [SKIPPING]
:installPythonRequirements
:installTestRequirements
Install argparse-1.4.0 .............................................. [SKIPPING]
Install colorama-0.3.7 .............................................. [STARTING]
Install (0:03.957 s) ................................................ [FINISHED]
Install coverage-3.7.1 .............................................. [SKIPPING]
Install py-1.4.29 ................................................... [SKIPPING]
Install pytest-cov-2.2.1 ............................................ [SKIPPING]
Install pytest-xdist-1.14 ........................................... [SKIPPING]
Install pytest-2.9.1 ................................................ [SKIPPING]
:installProject
Install syzygy ...................................................... [STARTING]
Install (0:04.600 s) ................................................ [FINISHED]
:buildDocsHtml
Running Sphinx v1.4.1
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 0 source files that are out of date
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
no targets are out of date.
build succeeded.
:buildDocsJson
Running Sphinx v1.4.1
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [json]: targets for 0 source files that are out of date
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
no targets are out of date.
build succeeded.
:buildDocs

import org.gradle.api.Project;


public class PexExtension {

private File pexCache;
private boolean fatPex = false;
private boolean fatPex = OperatingSystem.current() == OperatingSystem.WINDOWS; //Defaulting to fat pex's on windows
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use isWindows instead of comparison for equality.

}

public static String getPythonApplicationDirectory() {
return OperatingSystem.current() == OperatingSystem.WINDOWS ? "Scripts" : "bin";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace with isWindows again ...

*/
project.tasks.create(TASK_SETUP_LINKS) {
dependsOn project.tasks.getByName(TASK_VENV_CREATE)
outputs.file(settings.getDetails().activateLink)

doLast {
def activateLinkSource = VirtualEnvExecutableHelper.getExecutable(settings, "bin/activate")
def activateLinkSource = settings.getDetails().virtualEnvironment.getScript( "activate")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove space after open paren.

@@ -40,8 +41,14 @@ public static void makeSymLink(File target, File destination) throws IOException
* Check if the file exists because the link checking logic in Gradle differs
* between Linux and OS X machines.
*/
if (!Files.exists(destination.toPath())) {
Files.createSymbolicLink(destination.toPath(), target.toPath());
if (OperatingSystem.current() == OperatingSystem.UNIX) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace with isUnix

String osName = os.toLowerCase();
if (osName.contains("windows")) {
return WINDOWS;
} else if (osName.contains("mac os x") || osName.contains("darwin") || osName.contains("osx")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you check is macOS Sierra still returns mac os x here or something else.

@@ -154,4 +154,19 @@ class PexFileUtil {
return configNames
}

public static String createThinPexFilename(String name) {
if (OperatingSystem.current() == OperatingSystem.WINDOWS) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace with isWindows here and below

ethankhall and others added 12 commits January 25, 2017 16:12
Here we need to have an exe to run on windows, since golang is easier to
build on multiple platforms than rust, I chose it. I'm checking in the
exe's since we need them to be able to run without having to install
golang everywhere. We could put them up into artifactory so they aren't
checked in but it's only 1.6M each. This is something we can discuss
before merging.

Here I also took the OperatingSystem mostly intact from Gradle. The one
change that I did was to remove the extension stipping, since everything
shouldn't have one if possible.

I split the PythonDetailsTest into PythonDetailsUnixTest and
PythonDetailsWindowsTest to make sure that everything can be tested on
different platforms.
Things left:
- Make the tests actually work. Right now it looks like the exec can
run, but windows doesn't honor the shebang line so we have to make the
pex's end with .py so they can run :-(
- Drinking.

This change has a lot in it, mostly because removed the
VirtualEnvExecutableHelper file and replaced it with the
VirtualEnvironment. The former required a PythonDetails to do anything,
so instead of doing that now you just call into details and ask for the
venv. All of the methods that were static no loger are, and life is
better :-)
If the file exists, we shouldn't copy it again.
Project isn't serializable so we're making sure it doesn't get included
in the serialized object.
- Updated the README.md to mention that pex doesn't offically support
Windows, Python needs to be in your PATH, and pex's are renamed to .py
- Deleted files that are now done by the OperatingSystem class
- Added the thin/fat pex renaming into PexFileUtils.
- Renamed some tests so they follow the nameing convetnion <CLASS>Test
- Adding appvryor into the CI pipeline, so we can make sure windows
  continues to work.
- Making our path checking to see if we need to install a dep so it
  handels the windows python dist
- Making it where test exec work on windows
@zvezdan zvezdan merged commit e84a766 into linkedin:master Jan 26, 2017
@ethankhall ethankhall mentioned this pull request Feb 1, 2017
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

Successfully merging this pull request may close these issues.

5 participants