<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 21 Sept 2021 at 03:06, Ralph Versteegen <<a href="mailto:teeemcee@gmail.com">teeemcee@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 20 Sept 2021 at 23:08, James Paige <<a href="mailto:Bob@hamsterrepublic.com" target="_blank">Bob@hamsterrepublic.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun., Sep. 19, 2021, 8:56 p.m. Ralph Versteegen, <<a href="mailto:teeemcee@gmail.com" target="_blank">teeemcee@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 20 Sept 2021 at 07:06, James Paige <<a href="mailto:Bob@hamsterrepublic.com" rel="noreferrer" target="_blank">Bob@hamsterrepublic.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div><br></div><div>I made a bunch of fixes, and now <b>wine scons</b> gets further.</div><div><br></div><div>Switching to 32 bit compiler packages instead of 64 bit helped a lot.</div><div><br></div><div>Also, I did manage to get reloadbasic.py running with just "python3" and not needing the whole path (The base image I am using sets up the PATH environment variable inside wine incorrectly for python). I have not made the change in the SConscript yet because i still need to upgrade from python2 to python3 on the Windows nightly build machine</div></div></div></blockquote><div><br></div><div>Did you try just 'python'? Works for me, and python is python 2.7 on my system.</div></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">That would work on windows, but it breaks on modern Debian where python doesn't exist anymore, only python2 and python3</div></div></blockquote><div><br></div><div>Debian too? :(  I thought it was just ArchLinux that would do something so... hipster!<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div><br></div><div>Right now the current error I am bumping into is:</div><div><br></div><div><b>windres --input gicon.rc --output build\gicon.o<br>windres: can't popen `gcc -E -xc -DRC_INVOKED  gicon.rc': Bad file descriptor</b></div><div><br></div><div>I searched around for that error message, and found people suggesting to add the <b>windres.exe </b>argument <b>--use-temp-file</b> but that didn't help, it just changed the failure</div><div><br></div><div><b>windres --use-temp-file --input gicon.rc --output build\gicon.o<br>windres: can't redirect stdout: `C:\users\root\Temp\cca00360.irc': Bad file descriptor</b></div></div></div></blockquote><div><br></div><div>I could not find any search results at all for those errors while running windres under wine, though I did see them for running windres.exe on Windows. So I have no idea how to fix them other than not use windres.exe at all.</div><div>You could use a linux build of windres instead of windres.exe.</div><div>I also note the following comment in SConscript:</div><div><br></div><div># windres is part of mingw, and this is only used with linkgcc anyway.<br># FB includes GoRC.exe, but finding that file is too much trouble...</div><div><br></div><div>The part about linkgcc is wrong (though we could avoid explicitly calling windres when using linkgcc=0, but it would be better not to do that anyway), but GoRC could be an option.<br></div><div><br></div><div>If you spend much time trying to force wine into the build system then it would be easier to cross-compile to Windows with mxe, plus builds are as fast as they are on Unix. I can't imagine wine being very fast.<br></div></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Hmm! That is a possibility too. I had ignored mxe because it wasn't going to work for euphoria, so I expected to need whine anyway for hspeak... But maybe I actually can use the combination of both?</div></div></blockquote><div><br></div><div>Using wine just for compiling/binding hspeak would certainly be possible.</div><div>Also, it turns out that euphoria 4.1 *can* crosscompile, it is just missing a copy of the runtime eu.a library for Windows. (Eu 4.0.3, which I still usually use, also takes a -plat argument for cross-compiling, but I ran into several problems with it.) By downloading a Windows build of Eu 4.1, taking the eu.a from that, and telling a 64-bit linux euc build to use it I was able to get a working hspeak.exe!</div><div>Unlike, FB, Euphoria seems to have no convention for where to store the library for each target, instead you need to manually pass in the path to the right runtime. But it's actually pretty painless, since the entire runtime is a single .a file, compared with FB which needs a whole folder of libraries and variants.</div><div>I've added support to scons. Note that only euc works, not eubind (I haven't looked into whether that's possible), but scons calls eubind instead in debug builds, which needs to be overridden.</div><div><br></div><div>To cross-compile hspeak.exe with mxe I did:</div><div><br></div><div>export EUDIR=/home/ralph/local/euphoria-4.1.0-Linux-x64/<br>export EUC=$EUDIR/bin/euc<br>export PATH=/mnt/common/src/mxe/usr/bin:$PATH<br>scons target=i686-w64-mingw32.static hspeak release=1 eulib=tmp/euphoria-4.1.0-Windows-x86/bin/eu.a</div></div></div></blockquote><div><br></div><div>Maybe a EULIB envvar would be more convenient? <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div><br></div><div>(The first two lines aren't necessary if Euphoria is installed globally)<br></div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div dir="auto"><br></div><div dir="auto">Wine does not seem slow. Probably not as fast as native, but not slow at all, as far as I can tell</div></div></blockquote></div></div></blockquote><div><br></div><div>The reason I consider wine slow is mainly the painful start time of ~7s or more I see when running it for the first time, though warmed up it is <1s. But surprisingly I need to run it several times in a row on my (overloaded) desktop to fully warm it up, and if I wait just 5 seconds and then run it again, it takes several seconds again! Something is bizarrely wrong there, I have GBs of free/cache memory.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div><br></div><div><br></div><div>Too much fun :D</div><div><br></div><div>I am also thinking ahead about how to do a docker build for Mac. Running darwin in Docker is apparently possible, but sounds impractical. An actual OSX inside KVM inside Docker is also apparently possible, but I feel like that defeats the point of dockerizing it. I guess i'll look at OSXcross more later.</div><div><br></div></div><div>Of course, the real goal I am working towards is not Dockerizing all the builds, it is really making Jenkins do all the builds-- so if dockerizing a build is more work than setting up an always-on VM with a Jenkins agent installed in it, then I just switch my approach :D</div><div><br></div><div>---</div><div>James<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Sep 18, 2021 at 11:09 PM Ralph Versteegen <<a href="mailto:teeemcee@gmail.com" rel="noreferrer" target="_blank">teeemcee@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 19 Sept 2021 at 12:56, James Paige <<a href="mailto:Bob@hamsterrepublic.com" rel="noreferrer" target="_blank">Bob@hamsterrepublic.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>So now not only does fbc work in the wine docker container, so does mingw64 and euphoria</div><div><br></div><div> <b>wine scons hspeak</b> actually works, and produces a working hspeak.exe (tested with <b>wine hspeak</b>)</div><div><br></div><div>compiling game and custom fails though. I see two problems so far.</div><div><br></div><div>First, when scons executes reloadbasic/reloadbasic.py on Windows, this relies on the .py file type being associated with python, so scons seems to be directly invoking <b>reloadbasic/reloadbasic.py</b> and this works on Real windows because the filetype is associated with python.exe but on Wine, this type of file association does not seem to work, even when I make sure the association is set up with regedit.</div><div><br></div><div>Editing the constructor for the rbasic_builder in Sconscript to <b>Builder (action = ["C:\Python39\python.exe", [File('reloadbasic/reloadbasic.py'), ...</b> does work and fixes the problem, so I just need to work out a clean way to do that without breaking other platforms.</div></div></blockquote><div><br></div><div>Can't you just invoke python or python3 instead of C:\Python39\python.exe?</div><div>(I'm not sure whether we dropped python 2 support when you switched all the #! lines to python3; maybe python2 would still work if invoked explicitly, or maybe python3 will be called somewhere whether installed or not)<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>The other error is this:</div><div><br></div><div>os_windows.bas(107) error 20: Type mismatch, before ')' in 'dim fd as integer = _open_osfhandle(cast(integer, fhandle), 0)'<br>os_windows.bas(714) warning 35(1): Mixing signed/unsigned operands<br>os_windows.bas(784) warning 35(1): Mixing signed/unsigned operands</div><div><br></div><div>Which makes me think I might have a mismatch in my FreeBasic/mingw64 versions, but I don't really know yet, just a wild guess.</div></div></blockquote><div><br></div><div>This error is thrown by fbc, so the mingw version isn't related.</div><div>I suspect that maybe you're trying to compile for win64/x86_64? If fbc itself is a win64 .exe then it probably also defaults to win64 builds. If it has 32-bit libraries then it can compile for x86 with scons arch=32, and we should make that the default.<br></div><div>[Note: win64 informally is used to mean 64-bit windows, but win32 does not mean 32-bit Windows, it means not-16-bit, and for example compilers such as FB define __FB_WIN32__ (or equivalent in C) on 64-bit Windows]</div><div><br></div><div>I also see that you're downloading a 6-bit version of Euphoria for Windows, that should be 32-bit instead (I assume Euphoria can't crosscompile on Windows, just as it can't on Unix).<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>---</div><div>James</div><div><br></div><div><br></div><div><br></div><div><br></div><div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Sep 18, 2021 at 6:55 PM <<a href="mailto:subversion@hamsterrepublic.com" rel="noreferrer" target="_blank">subversion@hamsterrepublic.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">james<br>
2021-09-18 15:55:34 -0700 (Sat, 18 Sep 2021)<br>
60<br>
Docker: ohrrpgce-build-env-wine now has mingw64 and euphoria<br>
---<br>
U   wip/docker/ohrrpgce-build-env-wine/Dockerfile<br>
<br>
_______________________________________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org" rel="noreferrer" target="_blank">ohrrpgce@lists.motherhamster.org</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer noreferrer" target="_blank">http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org</a><br>
</blockquote></div>
_______________________________________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org" rel="noreferrer" target="_blank">ohrrpgce@lists.motherhamster.org</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer noreferrer" target="_blank">http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org</a><br>
</blockquote></div></div>
_______________________________________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org" rel="noreferrer" target="_blank">ohrrpgce@lists.motherhamster.org</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer noreferrer" target="_blank">http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org</a><br>
</blockquote></div></div>
_______________________________________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org" rel="noreferrer" target="_blank">ohrrpgce@lists.motherhamster.org</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer noreferrer" target="_blank">http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org</a><br>
</blockquote></div></div>
_______________________________________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org" rel="noreferrer" target="_blank">ohrrpgce@lists.motherhamster.org</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer noreferrer" target="_blank">http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org</a><br>
</blockquote></div></div></div>
_______________________________________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org" target="_blank">ohrrpgce@lists.motherhamster.org</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer" target="_blank">http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org</a><br>
</blockquote></div></div>
</blockquote></div></div>