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 actions fail #773

Closed
bfloch opened this issue Oct 24, 2019 · 12 comments
Closed

Windows actions fail #773

bfloch opened this issue Oct 24, 2019 · 12 comments
Assignees

Comments

@bfloch
Copy link
Contributor

bfloch commented Oct 24, 2019

Our actions fail on windows. Only the cmake test is supposed to fail
But it was skipped in #772 so we should actually pass.

In reality we fail additional 4 tests:

  1. test_build_custom (powershell) - Usually is not being run due to a dependency on g++ and make, which is kindly provided by the github actions instance. We have to probably deal with it or try to skip it no matter what (assuming that mingw is not a supported path)

  2. test_build_whack (pwsh) - Something wrong with the environment!?

  3. test_command (cmd) - I assume that python is not the default application for .py and hence the PATHEXT variable has not effect.

  4. test_command_returncode (cmd) Same as before

Logs as seen on https://github.com/nerdvegas/rez/runs/272706733

2019-10-24T04:36:52.0179972Z ======================================================================
2019-10-24T04:36:52.0180850Z SOLVE #6 (2 fails so far)...
2019-10-24T04:36:52.0200508Z ERROR: test_build_custom (rez.tests.test_build.TestBuild)
2019-10-24T04:36:52.0200671Z SUCCESS
2019-10-24T04:36:52.0201957Z Test a make-based package that uses the custom_build attribute.
2019-10-24T04:36:52.0208387Z checking that permutations also succeed...
2019-10-24T04:36:52.0235668Z ----------------------------------------------------------------------
2019-10-24T04:36:52.0237804Z SOLVE #1 (0 fails so far)...
2019-10-24T04:36:52.0238380Z Traceback (most recent call last):
2019-10-24T04:36:52.0238470Z SOLVE #2 (0 fails so far)...
2019-10-24T04:36:52.0240808Z   File "d:\a\rez\rez\build\lib\site-packages\rez\tests\util.py", line 158, in wrapper
2019-10-24T04:36:52.0240999Z SOLVE #3 (1 fails so far)...
2019-10-24T04:36:52.0241903Z     return func(self, *args, **kwargs)
2019-10-24T04:36:52.0242041Z SOLVE #4 (1 fails so far)...
2019-10-24T04:36:52.0244123Z   File "d:\a\rez\rez\build\lib\site-packages\rez\tests\test_build.py", line 177, in test_build_custom
2019-10-24T04:36:52.0244302Z SOLVE #5 (2 fails so far)...
2019-10-24T04:36:52.0244720Z     proc = context.execute_command(['hai'], stdout=PIPE)
2019-10-24T04:36:52.0244851Z SOLVE #6 (2 fails so far)...
2019-10-24T04:36:52.0245201Z   File "d:\a\rez\rez\build\lib\site-packages\rez\resolved_context.py", line 877, in _check
2019-10-24T04:36:52.0245363Z SUCCESS
2019-10-24T04:36:52.0249590Z     return fn(self, *nargs, **kwargs)
2019-10-24T04:36:52.0269789Z   File "d:\a\rez\rez\build\lib\site-packages\rez\resolved_context.py", line 1129, in execute_command
2019-10-24T04:36:52.0270324Z     return interpreter.subprocess(args, **Popen_args)
2019-10-24T04:36:52.0270692Z   File "d:\a\rez\rez\build\lib\site-packages\rez\rex.py", line 641, in subprocess
2019-10-24T04:36:52.0270983Z     **subproc_kwargs)
2019-10-24T04:36:52.0271281Z   File "d:\a\rez\rez\build\lib\site-packages\rez\utils\execution.py", line 70, in __init__
2019-10-24T04:36:52.0271572Z     super(Popen, self).__init__(args, **kwargs)
2019-10-24T04:36:52.0272111Z   File "C:\hostedtoolcache\windows\Python\2.7.16\x64\Lib\subprocess.py", line 394, in __init__
2019-10-24T04:36:52.0272514Z     errread, errwrite)
2019-10-24T04:36:52.0273084Z   File "C:\hostedtoolcache\windows\Python\2.7.16\x64\Lib\subprocess.py", line 644, in _execute_child
2019-10-24T04:36:52.0273510Z     startupinfo)
2019-10-24T04:36:52.0273783Z WindowsError: [Error 2] The system cannot find the file specified
2019-10-24T04:36:52.0273992Z 
2019-10-24T04:36:52.0274246Z ======================================================================
2019-10-24T04:36:52.0274507Z FAIL: test_build_whack (rez.tests.test_build.TestBuild)
2019-10-24T04:36:52.0274742Z Test that a broken build fails correctly.
2019-10-24T04:36:52.0275000Z ----------------------------------------------------------------------
2019-10-24T04:36:52.0275259Z Traceback (most recent call last):
2019-10-24T04:36:52.0275848Z   File "d:\a\rez\rez\build\lib\site-packages\rez\tests\util.py", line 185, in wrapper
2019-10-24T04:36:52.0276522Z     func(self, *args, **kwargs)
2019-10-24T04:36:52.0277181Z   File "d:\a\rez\rez\build\lib\site-packages\rez\tests\util.py", line 208, in wrapper
2019-10-24T04:36:52.0277494Z     return func(self, *args, **kwargs)
2019-10-24T04:36:52.0278025Z   File "d:\a\rez\rez\build\lib\site-packages\rez\tests\test_build.py", line 136, in test_build_whack
2019-10-24T04:36:52.0278333Z     self.assertRaises(BuildError, builder.build, clean=True)
2019-10-24T04:36:52.0278608Z AssertionError: Could not find rez binary, this is a bug (in shell 'powershell')
2019-10-24T04:36:52.0278834Z 
2019-10-24T04:36:52.0279051Z ======================================================================
2019-10-24T04:36:52.0279628Z FAIL: test_builds (rez.tests.test_build.TestBuild)
2019-10-24T04:36:52.0279925Z Test an interdependent set of builds.
2019-10-24T04:36:52.0280169Z ----------------------------------------------------------------------
2019-10-24T04:36:52.0280699Z Traceback (most recent call last):
2019-10-24T04:36:52.0281000Z   File "d:\a\rez\rez\build\lib\site-packages\rez\tests\util.py", line 185, in wrapper
2019-10-24T04:36:52.0281264Z     func(self, *args, **kwargs)
2019-10-24T04:36:52.0281557Z   File "d:\a\rez\rez\build\lib\site-packages\rez\tests\util.py", line 208, in wrapper
2019-10-24T04:36:52.0281835Z     return func(self, *args, **kwargs)
2019-10-24T04:36:52.0282256Z   File "d:\a\rez\rez\build\lib\site-packages\rez\tests\test_build.py", line 142, in test_builds
2019-10-24T04:36:52.0282567Z     self._test_build_build_util()
2019-10-24T04:36:52.0283178Z   File "d:\a\rez\rez\build\lib\site-packages\rez\tests\test_build.py", line 72, in _test_build_build_util
2019-10-24T04:36:52.0283461Z     self._test_build("build_util", "1")
2019-10-24T04:36:52.0283990Z   File "d:\a\rez\rez\build\lib\site-packages\rez\tests\test_build.py", line 63, in _test_build
2019-10-24T04:36:52.0284348Z     builder.build(clean=True)
2019-10-24T04:36:52.0284646Z   File "d:\a\rez\rez\build\lib\site-packages\rezplugins\build_process\local.py", line 41, in build
2019-10-24T04:36:52.0284910Z     install=install)
2019-10-24T04:36:52.0285206Z   File "d:\a\rez\rez\build\lib\site-packages\rez\build_process_.py", line 199, in visit_variants
2019-10-24T04:36:52.0285471Z     result = func(variant, **kwargs)
2019-10-24T04:36:52.0285812Z   File "d:\a\rez\rez\build\lib\site-packages\rezplugins\build_process\local.py", line 285, in _build_variant
2019-10-24T04:36:52.0286347Z     install=install)
2019-10-24T04:36:52.0286984Z   File "d:\a\rez\rez\build\lib\site-packages\rezplugins\build_process\local.py", line 223, in _build_variant_base
2019-10-24T04:36:52.0287280Z     build_type=build_type)
2019-10-24T04:36:52.0287868Z   File "d:\a\rez\rez\build\lib\site-packages\rezplugins\build_system\bez.py", line 100, in build
2019-10-24T04:36:52.0288178Z     actions_callback=callback)
2019-10-24T04:36:52.0288472Z   File "d:\a\rez\rez\build\lib\site-packages\rez\resolved_context.py", line 877, in _check
2019-10-24T04:36:52.0288733Z     return fn(self, *nargs, **kwargs)
2019-10-24T04:36:52.0289034Z   File "d:\a\rez\rez\build\lib\site-packages\rez\resolved_context.py", line 1251, in execute_shell
2019-10-24T04:36:52.0289297Z     self._execute(executor)
2019-10-24T04:36:52.0289701Z   File "d:\a\rez\rez\build\lib\site-packages\rez\utils\memcached.py", line 254, in wrapper
2019-10-24T04:36:52.2383622Z     return func(*nargs, **kwargs)
2019-10-24T04:36:52.2384466Z   File "d:\a\rez\rez\build\lib\site-packages\rez\resolved_context.py", line 1697, in _execute
2019-10-24T04:36:52.2384737Z     executor.append_system_paths()
2019-10-24T04:36:52.2385012Z   File "d:\a\rez\rez\build\lib\site-packages\rez\rex.py", line 1152, in append_system_paths
2019-10-24T04:36:52.2385244Z     paths = sh.get_syspaths()
2019-10-24T04:36:52.2385503Z   File "d:\a\rez\rez\build\lib\site-packages\rezplugins\shell\pwsh.py", line 21, in get_syspaths
2019-10-24T04:36:52.2385739Z     return super(PowerShellCore, cls).get_syspaths()
2019-10-24T04:36:52.2385998Z   File "d:\a\rez\rez\build\lib\site-packages\rezplugins\shell\_utils\powershell_base.py", line 126, in get_syspaths
2019-10-24T04:36:52.2386381Z     assert exe, "Could not find rez binary, this is a bug"
2019-10-24T04:36:52.2387429Z AssertionError: Could not find rez binary, this is a bug (in shell 'pwsh')
2019-10-24T04:36:52.2387897Z 
2019-10-24T04:36:52.2388112Z ======================================================================
2019-10-24T04:36:52.2388344Z FAIL: test_command (rez.tests.test_shells.TestShells)
2019-10-24T04:36:52.2388573Z ----------------------------------------------------------------------
2019-10-24T04:36:52.2388792Z Traceback (most recent call last):
2019-10-24T04:36:52.2389069Z   File "d:\a\rez\rez\build\lib\site-packages\rez\tests\util.py", line 185, in wrapper
2019-10-24T04:36:52.2389309Z     func(self, *args, **kwargs)
2019-10-24T04:36:52.2389605Z   File "d:\a\rez\rez\build\lib\site-packages\rez\tests\test_shells.py", line 126, in test_command
2019-10-24T04:36:52.2389829Z     self.assertEqual(_stdout(p), "Hello Rez World!")
2019-10-24T04:36:52.2390276Z AssertionError: '' != 'Hello Rez World!' (in shell 'cmd')
2019-10-24T04:36:52.2390444Z 
2019-10-24T04:36:52.2390621Z ======================================================================
2019-10-24T04:36:52.2390848Z FAIL: test_command_returncode (rez.tests.test_shells.TestShells)
2019-10-24T04:36:52.2391165Z ----------------------------------------------------------------------
2019-10-24T04:36:52.2391408Z Traceback (most recent call last):
2019-10-24T04:36:52.2391661Z   File "d:\a\rez\rez\build\lib\site-packages\rez\tests\util.py", line 185, in wrapper
2019-10-24T04:36:52.2391886Z     func(self, *args, **kwargs)
2019-10-24T04:36:52.2392155Z   File "d:\a\rez\rez\build\lib\site-packages\rez\tests\test_shells.py", line 140, in test_command_returncode
2019-10-24T04:36:52.2392365Z     self.assertEqual(p.returncode, 66)
2019-10-24T04:36:52.2392559Z AssertionError: 0 != 66 (in shell 'cmd')
@bfloch bfloch self-assigned this Oct 24, 2019
@bfloch
Copy link
Contributor Author

bfloch commented Oct 24, 2019

I could verify the the python default application is set, so that is crossed out as possible problem.

@bfloch
Copy link
Contributor Author

bfloch commented Oct 24, 2019

I printed out the command that fails on the test_command and can't find anything weird:

2019-10-24T18:41:50.3028784Z set REZ_ENV_PROMPT=%REZ_ENV_PROMPT%$G
2019-10-24T18:41:50.3028990Z echo %PATHEXT%|C:\Windows\System32\findstr.exe /i /c:".PY">nul || set PATHEXT=%PATHEXT%;.PY
2019-10-24T18:41:50.3029703Z (call )
2019-10-24T18:41:50.3029945Z call c:\users\runner~1\appdata\local\temp\rez_context_heitqc\context.bat
2019-10-24T18:41:50.3030161Z set REZ_STORED_PROMPT_CMD=
2019-10-24T18:41:50.3030382Z set PROMPT=%REZ_ENV_PROMPT% 
2019-10-24T18:41:50.3030603Z hello_world
2019-10-24T18:41:50.3030821Z exit %errorlevel%
2019-10-24T18:41:50.3030980Z 
2019-10-24T18:41:50.3031461Z ['c:\\windows\\system32\\cmd.exe', '/Q', '/C', 'call c:\\users\\runner~1\\appdata\\local\\temp\\rez_context_heitqc\\rez-shell.bat']

I verified that findstr.exe is available at the given location on the instance.

@bfloch
Copy link
Contributor Author

bfloch commented Oct 24, 2019

A couple of tests I ray (temporarily) that passed:

      - name: Verify findstr
        run: |
          findstr /?
          C:\Windows\System32\findstr.exe /?

      - name: Test python execution
        run: |
          mkdir exec
          $ENV:PATH += ";$PWD\exec"
          New-Item "$PWD\exec\hello.py"
          Set-Content "$PWD\exec\hello.py" 'print("Hello from python")'
          hello

@bfloch
Copy link
Contributor Author

bfloch commented Oct 24, 2019

I was under the impression that the PATH limit is exceeded in cmd so I tried this:

      - name: Reduce PATH variables
        run: |
          echo "PATH Length: " ${ENV:PATH}.Length
          cmd /c setx /m PATH "C:\Program Files\PowerShell\6\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\"
          ${ENV:PATH} = "C:\Program Files\PowerShell\6\;${ENV:SystemRoot}\system32;${ENV:SystemRoot};${ENV:SystemRoot}\System32\Wbem;${ENV:SYSTEMROOT}\System32\WindowsPowerShell\v1.0\"
          echo "PATH Length: " ${ENV:PATH}.Length

No luck.

@bfloch
Copy link
Contributor Author

bfloch commented Oct 24, 2019

The above does not clear it yet.
This does but it can't find rez at all:

      - name: Run Rez Tests
        run: |
             Start-Process -FilePath .\build\Scripts\rez\rez-selftest.exe -UseNewEnvironment -Wait

So I am trying to use the new env: workflow syntax as seen on tv:
https://github.community/t5/GitHub-Actions/Support-global-environment-variables/m-p/30488#M445

@bfloch
Copy link
Contributor Author

bfloch commented Oct 24, 2019

env: did not work either.
Although the variables were set in the running environment I still saw the full paths in the executor.

@bfloch
Copy link
Contributor Author

bfloch commented Oct 24, 2019

Also tried windows-2016. Same result.

@bfloch
Copy link
Contributor Author

bfloch commented Oct 25, 2019

Trying a different route by using a clean docker windows image the installs the needed dependencies from scratch.

@bfloch
Copy link
Contributor Author

bfloch commented Oct 25, 2019

Getting somewhere.
The cmd related problems are fixed on a clean docker image.
Working on the remaining tests.

@bfloch
Copy link
Contributor Author

bfloch commented Oct 25, 2019

@bfloch
Copy link
Contributor Author

bfloch commented Oct 30, 2019

Working PR at #781

@nerdvegas
Copy link
Contributor

Closing as windows tests are now passing in docker-based workflow.

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