Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build script fails to collate the finshed files #333

Open
pepak-net opened this issue Jan 28, 2024 · 6 comments
Open

Build script fails to collate the finshed files #333

pepak-net opened this issue Jan 28, 2024 · 6 comments

Comments

@pepak-net
Copy link

I am trying to build the current version of NetBox (commit 64f2f53). 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
Copy link
Owner

Try latest commit: a1ce5b5

@pepak-net
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

@pepak-net
Copy link
Author

Building from commit 70d569c 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants