Closed Anti-Distinctlyminty closed 1 year ago
Hi! Yes, on build it compiles in the current code revision. I build Afanasy on Windows periodically, it never hungs. But mey be there is some bug that can appear in some special environment case.
(just now i've tried to build again from master - everything is ok)
As a temprorary solution, just to avoid this issue, you can set CGRU_REVISION to any string.
Ok, I'm trying that. Currently trying to sort out the following Could not find a package configuration file provided by "Qt5Core"...
.
Is there a list of prerequisites somewhere that I missed?
Latest cmake, python, qt5 - that is all, nothing special. And postgresql if you need afserver with statistics on windows.
Ok, I managed to circumvent that issue. Now win_build_msvc.cmd
seems to be running successfully, but I see no build products.
My apologies as I'm not really familiar with cmake, but is it the case that all I need to do is run win_build_msvc.cmd
? No loading any of the vcxproj files or anything?
I also noticed that the CMAKE_GENERATOR
is set to "Visual Studio 16 2019", however the Qt installer only provides options for MSVC 2015 64-bit and MSVC 2019 64-bit. I don't know if this effects anything.
Visual Studio 16 2019 - is a current version to compile the project, may be newer versions can, but not tested.
Also Qt and Python should be compiles with the same (or compatible?) msvc versions.
CMake just generates a Visual Studio project files afanasy.sln
and otherts.
Later afanasy.sln
should be opened in Visual Studio and build.
The Visual Studio project builds successfully, but the generated executables fail to run due to missing dll files as there is no cgru/dll
folder.
I included the output from the win_build_msvc.cmd
in case it is useful.
Qt and Python dlls needed, also they can need other dlls too.
You can get all needed dlls from the latest CGRU windows release. If you used some updated libraries, replace that dlls with new.
I completely started over, compiled with MSVC 2019, copied the dll folder (after checking that the DLLs were the same as the ones found in C:\Qt\5.15.2\msvc2019_64
and my Python 3.9.13 installations).
Calling _afserver.cmd
, 50.afstarter.cmd
and 99.render.cmd
all appear to work. But 10.afwatch.cmd
still fails with the error
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.`
The dll/plugins/platform/qwindows.dll
is definitely present
It supposeed that you run Keeper first. Keeper is a python + pyside small tray menu to run CGRU tools. OnwWindows it perfoms this on start: https://github.com/CGRU/cgru/blob/master/utilities/keeper/keeper.py#L13
That did it! Thank you @timurhai. All now appears to be working :)
Ok, I'm re-opening this as it is still causing problems and I've managed to track down the cause.
If I make a fresh clone of the repo. and run win_build_msvc.cmd
located in afanasy\src\project.cmake\
.
This will call setup.cmd
in the root, which adds %CGRU_LOCATION%\bin
to path, and I believe this is the cause of the hang, because in here there is a bash script named python
.
So later in win_build_msvc.cmd, when
call getrevision.cmd %folder%` is called, this line:
For /F "Tokens=*" %%I in ('python getrevision.py %folder%') Do Set CGRU_REVISION=%%I
Is trying to invoke a bash script, as by that point %CGRU_LOCATION%\bin
will take precedence over previous values in %PATH%
. E.g. If I open a fresh cmd prompt and do the following
CD C:\Users\luke\AppData\Local\Temp\cgru
CALL setup.cmd
WHERE python
C:\Users\luke\AppData\Local\Temp\cgru\bin\python
C:\Users\luke\AppData\Local\Temp\cgru\bin\python.cmd
C:\Program Files\Python39\python.exe
The first reported python
file is the bash script, so any invoking of python
after calling setup.cmd
will hang.
Hi! I see, there can be some mess with python command.But I have not faced it.I copy some Python installations into the cgru/python folder.This makes cgru and cmake use Python that is in the cgru/python folder.Later I create an CGRU Windows release archives with that Python and CGRU works on the machines w/o any Python installation.setuppython.cmd setup.cmd calls any setup*.cmd files in the CGRU root folder:https://github.com/CGRU/cgru/blob/master/setup.cmd#L28
And it calls setup_python.cmd: https://github.com/CGRU/cgru/blob/master/setup_python.cmd
So I have:
C:\Users\timurhai>cd /cgru
C:\cgru>call setup.cmd
CGRU_VERSION 3.3.1
"Using CGRU Python: C:\cgru\python"
C:\cgru>where python
C:\cgru\python\python.exe
C:\cgru\bin\python
C:\cgru\bin\python.cmd
C:\Python396\python.exe
C:\Users\timurhai\AppData\Local\Microsoft\WindowsApps\python.exe
C:\cgru>python
Python 3.9.6 (tags/v3.9.6:db3ff76, Jun 28 2021, 15:26:21) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys; print(sys.prefix)
C:\cgru\python
Indeed, copying python to the cgru root folder does indeed solve this problem. Thank you again @timurhai
Trying to build afanasy on Windows for the first time. I'm assuming that I need to have Microsoft build tools installed and then run
afanasy/src/project.cmake/win_build_msvc.cmd
? In any case the cmd file eventually calls/utilities/getrevision.cmd
which never progresses past this line:https://github.com/CGRU/cgru/blob/540d5088cb7638d804383952b7f869bb9fbaa7a7/utilities/getrevision.cmd#L4I then need to hit Ctrl-C a few times whereupon the message
The process tried to write to a nonexistent pipe.
appears.I have tried running
chcp 65001
to change the terminal encoding to UTF-8.