Changing Oolite...
Moderators: winston, another_commander
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
Re: Changing Oolite...
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.
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
Re: Changing Oolite...
@hiran: I see you are attempting to execute msys.bat from within Powershell. Instead of this:
do this:
Note the ampersand at the beginning of the command.
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"
- hiran
- Theorethicist
- Posts: 2403
- Joined: Fri Mar 26, 2021 1:39 pm
- Location: a parallel world I created for myself. Some call it a singularity...
Re: Changing Oolite...
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"
... but does not do much?
I am unfamiliar to Powershell, thus I was fighting with simple stuff that I cannot try out elsewhere.
But it seems we are still not getting forward. Something is missing.
Sunshine - Moonlight - Good Times - Oolite
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
Re: Changing Oolite...
It 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.
Oh, and make sure that when checking out oolite the project submodules are also checked out.
- hiran
- Theorethicist
- Posts: 2403
- Joined: Fri Mar 26, 2021 1:39 pm
- Location: a parallel world I created for myself. Some call it a singularity...
Re: Changing Oolite...
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
Yet we have to change something to remove the need for interactivity.
How 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?
Regarding the submodules: How do I ensure they get checked out as well?
Sunshine - Moonlight - Good Times - Oolite
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
Re: Changing Oolite...
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?
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
Re: Changing Oolite...
You 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.
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.
Just add this to the end of etc/profile:
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.
- hiran
- Theorethicist
- Posts: 2403
- Joined: Fri Mar 26, 2021 1:39 pm
- Location: a parallel world I created for myself. Some call it a singularity...
Re: Changing Oolite...
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.
A added your suggestion to the profile script.
My 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}'"
Sunshine - Moonlight - Good Times - Oolite
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
Re: Changing Oolite...
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
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
Re: Changing Oolite...
It failed...
Can you try one thing please? Just hard-code the path in the run command for the compile. Like this:
Can't think of a way to translate that GITHUB_WORKSPACE to D:\a\oolite\oolite. Just try this to see if it works.
Edit: You can also try addingto try to avoid the powershell shenanigans.
Can you try one thing please? Just hard-code the path in the run command for the compile. Like this:
Code: Select all
D:\a\oolite\oolite\DevelopmentEnvironment\gcc\Msys_x2\1.0\msys.bat
Edit: You can also try adding
shell: cmd
in the run section of the compile action like this:
Code: Select all
- run: |
...
shell: cmd
- hiran
- Theorethicist
- Posts: 2403
- Joined: Fri Mar 26, 2021 1:39 pm
- Location: a parallel world I created for myself. Some call it a singularity...
Re: Changing Oolite...
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
https://docs.github.com/en/actions/lear ... stepsshell
How about cmd.exe?
Edit: I'm afraid that did not help either.
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]
Sunshine - Moonlight - Good Times - Oolite
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
Re: Changing Oolite...
Just 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
- hiran
- Theorethicist
- Posts: 2403
- Joined: Fri Mar 26, 2021 1:39 pm
- Location: a parallel world I created for myself. Some call it a singularity...
Re: Changing Oolite...
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
Sunshine - Moonlight - Good Times - Oolite
- hiran
- Theorethicist
- Posts: 2403
- Joined: Fri Mar 26, 2021 1:39 pm
- Location: a parallel world I created for myself. Some call it a singularity...
Re: Changing Oolite...
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
Sunshine - Moonlight - Good Times - Oolite
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
Re: Changing Oolite...
I think the environment does run, but we don't get to see its output. Probably the build fails at some point and therefore no resulting artifact files are generated. Not sure what to do here, I'm afraid.
The only suggestion I have at this poibt is to remove the path:oolite line from the Checkout Oolite job. It seems to result in the subnodules getting installed in D:\a\oolite\oolite\oolite, which is not right (they should go in D:\a\oolite\oolite, like everything else). Maybe this is why the build might be failing. Give it a try.
The only suggestion I have at this poibt is to remove the path:oolite line from the Checkout Oolite job. It seems to result in the subnodules getting installed in D:\a\oolite\oolite\oolite, which is not right (they should go in D:\a\oolite\oolite, like everything else). Maybe this is why the build might be failing. Give it a try.