michaellukashov / Far-NetBox

SFTP/SCP/FTP/FTPS/WebDAV/S3 client for Far Manager 3 (http://farmanager.com/)
https://forum.farmanager.com/viewtopic.php?t=6317
GNU General Public License v2.0
157 stars 52 forks source link

Build script fails to collate the finshed files #333

Open pepak-net opened 7 months ago

pepak-net commented 7 months ago

I am trying to build the current version of NetBox (commit 64f2f53f9d184329db42db5111f7486bc9f8b4ef). Most of the operations go as expected, but then when everything is built, the script fails to produce a directory with the result. The sequence of commands is:

vcvars x64
git clone https://github.com/michaellukashov/Far-NetBox
cd Far-NetBox
cmake -S . -B build -DOPT_CREATE_PLUGIN_DIR=ON
cmake --build build --target all

The last command fails at 100% with:

Error copying file (if different) from "-E" to "C:\Far-NetBox\Far3_x64\Plugins\NetBox".
Error copying file (if different) from "copy_if_different" to "C:\Far-NetBox\Far3_x64\Plugins\NetBox".
NMAKE : fatal error U1077: 'C:\VS2022\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe -E copy_if_different C:/Far-NetBox/LICENSE.txt C:\Far-NetBox\Far3_x64\Plugins\NetBox C:\VS2022\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe -E copy_if_different C:/Far-NetBox/LICENSE.txt C:\Far-NetBox\Far3_x64\Plugins\NetBox' : return code '0x1'
Stop.
NMAKE : fatal error U1077: 'C:\VS2022\BuildTools\VC\Tools\MSVC\14.38.33130\bin\HostX64\x64\nmake.exe -s -f CMakeFiles\NetBox.dir\build.make /nologo -SL                 CMakeFiles\NetBox.dir\build' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'C:\VS2022\BuildTools\VC\Tools\MSVC\14.38.33130\bin\HostX64\x64\nmake.exe -s -f CMakeFiles\Makefile2 /nologo -LS                 all' : return code '0x2'
Stop.

I have a NetBox.dll file in the builddirectory, so presumably there's a problem with e.g. creating the directory for binaries or an incorrect assumption that a release has already been made before and now we are just updating its files (which don't exist on the first run). It's a minor inconvenience, but it would be nice if it was possible to build everything from scratch, without any prerequisites.

michaellukashov commented 7 months ago

Try latest commit: https://github.com/michaellukashov/Far-NetBox/commit/a1ce5b58a3edb69a4f22a84d95cb99ce727921d0

pepak-net commented 7 months ago

Unfortunately, still doesn't work for me. The error message is different though:

Error copying file (if different) from "if" to "C:\Far-NetBox\Far3_x64\Plugins\NetBox".
Error copying file (if different) from "not" to "C:\Far-NetBox\Far3_x64\Plugins\NetBox".
Error copying file (if different) from "exist" to "C:\Far-NetBox\Far3_x64\Plugins\NetBox".
Error copying file (if different) from "-E" to "C:\Far-NetBox\Far3_x64\Plugins\NetBox".
Error copying file (if different) from "make_directory" to "C:\Far-NetBox\Far3_x64\Plugins\NetBox".
NMAKE : fatal error U1077: 'C:\VS2022\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe -E copy_if_different C:/Far-NetBox/ChangeLog C:\Far-NetBox\Far3_x64\Plugins\NetBox if not exist C:\Far-NetBox\Far3_x64\Plugins\NetBox C:/VS2022/BuildTools/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe -E make_directory C:\Far-NetBox\Far3_x64\Plugins\NetBox' : return code '0x1'                 
Stop.
NMAKE : fatal error U1077: 'C:\VS2022\BuildTools\VC\Tools\MSVC\14.38.33130\bin\HostX64\x64\nmake.exe -s -f CMakeFiles\NetBox.dir\build.make /nologo -SL                 CMakeFiles\NetBox.dir\build' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'C:\VS2022\BuildTools\VC\Tools\MSVC\14.38.33130\bin\HostX64\x64\nmake.exe -s -f CMakeFiles\Makefile2 /nologo -LS                 all' : return code '0x2'
Stop.                                                                                                                    

I am using cmake version 3.27.2 from Visual Studio 2022 Build Tools version 17.8.4.

michaellukashov commented 7 months ago

Apparently something wrong with CMake generated code for -E make_directory This code is generated if option OPT_CREATE_PLUGIN_DIR is set. You may try command-line option -DOPT_CREATE_PLUGIN_DIR=OFF

pepak-net commented 7 months ago

That, of course, stops the error. But I don't really think it's a solution, I still have to hunt down the individual files in various directories to get a full NetBox set of files. I understood that's the point of OPT_CREATE_PLUGIN_DIR, to avoid that work.

michaellukashov commented 6 months ago

You may check latest build: https://nightly.link/michaellukashov/Far-NetBox/workflows/release/main?preview

pepak-net commented 6 months ago

Building from commit 70d569cc0f8695f5ff5c50d79c7909eda7932f33 using the commands from the initial post, I did not encounter any errors. However, the Far-NetBox\Far3_x64\Plugins\NetBox directory is not fully populated - in particular, the Netbox.dll file is missing. This is the list of files I get:

cacert.pem
ChangeLog
LICENSE.txt
NetBoxEng.lng
NetBoxPol.lng
NetBoxRus.lng
NetBoxSpa.lng
README.md
README.PL.md
README.RU.md

The x86 build yields the same result.