Re: Changing Oolite...
Posted: Sat Jan 08, 2022 4:36 pm
I believe Oolite can be checked out anywhere. As long as you cd to the oolite root checkout folder before executing the make command, you should be good to go.
For information and discussion about Oolite.
https://bb.oolite.space/
Code: Select all
$workspace = $env:GITHUB_WORKSPACE
Invoke-Command -FilePath "$(workspace)\DevelopmentEnvironment\gcc\Msys_x2\1.0\msys.bat"
Code: Select all
& "$env:GITHUB_WORKSPACE\DevelopmentEnvironment\gcc\Msys_x2\1.0\msys.bat"
I was just about to give up when I saw your hint. It is active now...another_commander wrote: ↑Sat Jan 08, 2022 8:04 pm@hiran: I see you are attempting to execute msys.bat from within Powershell. Instead of this:do this:Code: Select all
$workspace = $env:GITHUB_WORKSPACE Invoke-Command -FilePath "$(workspace)\DevelopmentEnvironment\gcc\Msys_x2\1.0\msys.bat"
Note the ampersand at the beginning of the command.Code: Select all
& "$env:GITHUB_WORKSPACE\DevelopmentEnvironment\gcc\Msys_x2\1.0\msys.bat"
I'd back off from hardcoding that command in theanother_commander wrote: ↑Sat Jan 08, 2022 9:18 pmIt does not do much because running msys.bat on its own just opens up a shell. You need to actually execute the make command mentioned earlier and the best way to do this is to add it at the end of the etc/profile file.
Oh, and make sure that when checking out oolite the project submodules are also checked out.
Code: Select all
oolite-windows-build-env
Or maybe read an environment variable in profile and, if set, execute the make command? I believe you can initialize such an env var at the start of the build workflow.hiran wrote: ↑Sat Jan 08, 2022 9:24 pmHow about we change the batch file such that it allows one parameter. If that is not set, it behaves the same way it does now. But when set, it would just run this command, similarly as if it were the last line of the profile command.
It would leave more flexibility in using that stuff. What do you think?
Code: Select all
if [ ! -z "$GITHUB_WORKFLOW" ]; then
cd "$GITHUB_WORKSPACE"
make -fMakefile pkg-win-snapshot
fi
I managed to get the submodules.another_commander wrote: ↑Sat Jan 08, 2022 11:06 pmYou can actually read the already existing GITHUB_WORKFLOW environment variable.
Just add this to the end of etc/profile:If someone wants to use the dev environment to build and debug or develop the game further, they can do it just fine. But when run from a github action, the above will execute an automatic build.Code: Select all
if [ ! -z "$GITHUB_WORKFLOW" ]; then cd "$GITHUB_WORKSPACE" make -fMakefile pkg-win-snapshot fi
Now, if the build starts but you get errors after that, then this will probably mean that the submodules were not checked out. I am not sure how github actions ensure that any eventual submodules can be checked out together with the main project repository. This will be left as an exercise for the reader.
Code: Select all
Run & "$env:GITHUB_WORKSPACE\DevelopmentEnvironment\gcc\Msys_x2\1.0\msys.bat"
& "$env:GITHUB_WORKSPACE\DevelopmentEnvironment\gcc\Msys_x2\1.0\msys.bat"
shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
Hmm... Please try substituting the linehiran wrote: ↑Sun Jan 09, 2022 5:28 pmMy gut feeling is that the compile step should generate more output than it actually does...
Code: Select all
Run & "$env:GITHUB_WORKSPACE\DevelopmentEnvironment\gcc\Msys_x2\1.0\msys.bat" & "$env:GITHUB_WORKSPACE\DevelopmentEnvironment\gcc\Msys_x2\1.0\msys.bat" shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
Code: Select all
& "$env:GITHUB_WORKSPACE\DevelopmentEnvironment\gcc\Msys_x2\1.0\msys.bat"
Code: Select all
%GITHUB_WORKSPACE%\DevelopmentEnvironment\gcc\Msys_x2\1.0\msys.bat
Code: Select all
D:\a\oolite\oolite\DevelopmentEnvironment\gcc\Msys_x2\1.0\msys.bat
shell: cmd
in the run section of the compile action like this:
Code: Select all
- run: |
...
shell: cmd
another_commander wrote: ↑Sun Jan 09, 2022 6:15 pmHmm... Please try substituting the lineinside build-windows.yml, withCode: Select all
& "$env:GITHUB_WORKSPACE\DevelopmentEnvironment\gcc\Msys_x2\1.0\msys.bat"
I hope this will make it work.Code: Select all
%GITHUB_WORKSPACE%\DevelopmentEnvironment\gcc\Msys_x2\1.0\msys.bat
Code: Select all
2022-01-09T18:49:18.4927847Z ##[group]Run %GITHUB_WORKSPACE%\DevelopmentEnvironment\gcc\Msys_x2\1.0\msys.bat
2022-01-09T18:49:18.4929236Z [36;1m%GITHUB_WORKSPACE%\DevelopmentEnvironment\gcc\Msys_x2\1.0\msys.bat[0m
2022-01-09T18:49:18.5004768Z shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
2022-01-09T18:49:18.5005411Z ##[endgroup]
2022-01-09T18:49:20.5103692Z [91m%GITHUB_WORKSPACE%\DevelopmentEnvironment\gcc\Msys_x2\1.0\msys.bat: [0mD:\a\_temp\33675a18-99bb-4fef-8c14-c8dc77a583e5.ps1:2
2022-01-09T18:49:20.5106209Z [96mLine |
2022-01-09T18:49:20.5107715Z [96m 2 | [0m [96m%GITHUB_WORKSPACE%\DevelopmentEnvironment\gcc\Msys_x2\1.0\msys.bat[0m
Code: Select all
2022-01-09T19:13:33.9797715Z ##[group]Run %GITHUB_WORKSPACE%\DevelopmentEnvironment\gcc\Msys_x2\1.0\msys.bat
2022-01-09T19:13:33.9799446Z [36;1m%GITHUB_WORKSPACE%\DevelopmentEnvironment\gcc\Msys_x2\1.0\msys.bat[0m
2022-01-09T19:13:33.9850708Z shell: C:\Windows\system32\cmd.EXE /D /E:ON /V:OFF /S /C "CALL "{0}""
2022-01-09T19:13:33.9851313Z ##[endgroup]
Code: Select all
D:\a\oolite\oolite\DevelopmentEnvironment\gcc\Msys_x2\1.0\msys.bat
Build running....another_commander wrote: ↑Sun Jan 09, 2022 7:29 pmJust as a test, please hard-code the full path for the compile command:Code: Select all
D:\a\oolite\oolite\DevelopmentEnvironment\gcc\Msys_x2\1.0\msys.bat
same result as it seemshiran wrote: ↑Sun Jan 09, 2022 7:38 pmBuild running....another_commander wrote: ↑Sun Jan 09, 2022 7:29 pmJust as a test, please hard-code the full path for the compile command:Code: Select all
D:\a\oolite\oolite\DevelopmentEnvironment\gcc\Msys_x2\1.0\msys.bat