-
Guest56
hi
-
Guest56
I tried to build monero from the source code to hopefully get the code assistant to find all names in the source code.
-
Guest56
However even after installing MSYS2 and using the command:
-
Guest56
> pacman -S mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-boost mingw-w64-x86_64-openssl mingw-w64-x86_64-zeromq mingw-w64-x86_64-libsodium mingw-w64-x86_64-hidapi mingw-w64-x86_64-unbound
-
Guest56
The codeAnalysis tools on Visual Studio Code "clangd" (clangTidy) and even "C/C++" (intelliSense) can't make sense of the source code.
-
Guest56
I can't believe that monero core devs are dealing with error lens issues, so what exactly must I do so all headers are found correctly?
-
Guest56
I mean is needed so that codeAnalysis can understand the code?
-
Guest56
*what
-
sech1
Did you build the source code? Code analysis will use CMakeLists.txt or whatever build files it can find, I guess. So you need to make sure it all builds without errors.
-
Guest56
I used the command: make release-static-win64
-
sech1
and did it finish without errors?
-
Guest56
It finished with this:
-
Guest56
[100%] Linking CXX executable ../../bin/monero-blockchain-prune-known-spent-data.exe
-
Guest56
[100%] Built target blockchain_prune_known_spent_data
-
Guest56
[100%] Building CXX object src/blockchain_utilities/CMakeFiles/blockchain_prune.dir/blockchain_prune.cpp.obj
-
Guest56
[100%] Linking CXX executable ../../bin/monero-blockchain-prune.exe
-
Guest56
[100%] Built target blockchain_prune
-
Guest56
make[2]: warning: Clock skew detected. Your build may be incomplete.
-
Guest56
make[1]: Leaving directory '/h/500_WORKSPACE/monero/build/MINGW64_NT-10.0-19045/master/release'
-
Guest56
There were no errors, just warnings.
-
Guest56
And it completed with 100%
-
sech1
Then refer to the code analysis documentation or whatever you use. If it doesn't support using CMake files, you're out of luck.
-
Guest56
It does.
-
Guest56
Not sure why you assumed that there is a compatibility with CMake files.
-
Guest56
*issue
-
Guest56
Do you have a working environment?
-
sech1
I do
-
sech1
But I don't use vscode
-
sech1
and code analysis plugin or whatever it is
-
sech1
so refer to their documentation to debug why they can't find header files
-
sech1
it's probably because you're running it outside of MSYS2 environment and it can't find all header paths (my guess)
-
Guest56
How does your setup look?
-
Guest56
How can I replicate yours so that everything is found?
-
sech1
Just a standard MSYS2 installation, and following Monero build instructions
-
sech1
I don't use VSCode and code analysis plugin
-
Guest56
This is what I mean by it cannot find the headers:
-
Guest56
-
sech1
warnings.h is in contrib/epee/include folder. The include path must be somewhere in the CMake files, otherwise it wouldn't have compiled.
-
sech1
So it's a matter of your tools not picking up everything
-
Guest56
Thanks for the clarification.
-
sech1
Also, this is main.cpp in tests folder. IIRC it doesn't compile when you just run make release-static-win64
-
sech1
So there are no generated CMake files for this specific folder
-
Guest56
sech1 so how do I run main.cpp?
-
Guest56
I am aware that there are instructions on how to build the test files but this probably does not fic code analysis
-
Guest56
*fix
-
sech1
"make release-test" to build tests
-
sech1
I don't know if it will fix the code analysis, you're the first one trying this
-
Guest56
What about your code analysis? Does it mark everything as errors?
-
sech1
Monero repository uses Coverity for code analysis
-
sech1
They can't fix setup issues with every other code analysis tool under the sun
-
Guest56
No, I am asking because I am thinking about using a different environment with a compatible code analysis tool.
-
sech1
Built-in compiler warnings + Coverity reports is what I have for Monero repo. Some other tools like PVS Studio and cppcheck also work just fine, but I rarely use them with Monero repo. You're welcome to provide a patch that will enable code analysis in VSCode.
-
Guest56
I would maybe if I get it to work before loosing patience and switching environments.
-
Guest56
Why are there source files that include themselves without any other content?
-
Guest56
filename crypto-ops.c in directory crypto-ops... content: #include "crypto/crypto-ops.c"
-
Guest56
filename crypto-ops.c in directory crypto... content: "crypto/crypto-ops.c"
-
Guest56
....
-
Guest56
...
-
Guest56
...
-
Guest56
Why are there source files that include themselves without any other content?
-
Guest56
filename crypto-ops.c in directory crypto... content: #include "crypto/crypto-ops.c"
-
sech1
what? It doesn't include crypto-ops.c
-
sech1
It includes crypto-ops.h
-
Guest56
Please verify
-
Guest56
#include "crypto/crypto-ops.c"
-
Guest56
are the contents of crypto-ops.c
-
Guest56
which is in the directory crypto
-
sech1
-
sech1
Try to find #include "crypto/crypto-ops.c" there
-
Guest56
Yes it is there.
-
Guest56
I can't find: #include <boost/optional.hpp>
-
Guest56
This should have been already installed via:
-
Guest56
> pacman -S mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-boost mingw-w64-x86_64-openssl mingw-w64-x86_64-zeromq mingw-w64-x86_64-libsodium mingw-w64-x86_64-hidapi mingw-w64-x86_64-unbound
-
sech1
There is no #include "crypto/crypto-ops.c" in
github.com/monero-project/monero/blob/master/src/crypto/crypto-ops.c - do a search in the browser window for this file. Your crypto-ops.c was corrupt by something.
-
Guest56
-
Guest56
I ran this via command prompt:
-
Guest56
-
m-relay
<jbabb:cypherstack.com> Isn’t this the test importing the implementation?
-
Guest56
yes it is
-
sech1
it's just a test code
-
m-relay
<jbabb:cypherstack.com> So… it’s not importing itself. A test is importing what needs to be tested. The actual tests will lie somewhere else, check which files import that test file.
-
Guest56
#include <boost/optional.hpp> I don't have that
-
Guest56
but I installed this:
-
Guest56
> pacman -S mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-boost mingw-w64-x86_64-openssl mingw-w64-x86_64-zeromq mingw-w64-x86_64-libsodium mingw-w64-x86_64-hidapi mingw-w64-x86_64-unbound
-
sech1
Search for boost files in msys64 folder, they will be there
-
Guest56
I added this to my environment variables and it is also recognized when called via gcc --version: C:\msys64\mingw64\bin
-
Guest56
And I also have C:\msys64\mingw64\include\boost and there is also optional.cpp in it
-
Guest56
why the f is it not recognized?
-
Guest56
I'll restart my system
-
Guest56
nope still can't find boost/optional.cpp although it literally is there
-
m-relay
<preland:monero.social> Just gonna warn you because I did this and it ruined my arch setup—
-
m-relay
<preland:monero.social> Be very VERY careful if you try to change the version of boost on your system
-
m-relay
<preland:monero.social> Or try to manually build it
-
m-relay
<preland:monero.social> Basically if you mess with boost things get bad rly rly fast
-
vthor
preland: and I thought aready that boost seems like a pain in the ass
-
vthor
--extra-entropy argument for monero-wallet-rpc, will speed up the start or "only" help for better entropy?
-
hyc
manually building boost is easy enough. just don't try to install it anywhere. point the Monero build at the boost staging directory instead.
-
m-relay
<higherlearning1771:matrix.org> Hello
-
m-relay
<preland:monero.social> I tried that, and my linker literally wouldn’t listen to the cmake file
-
vthor
I'm devastated. How do I build without HIDAPI? Or better without the absolut minimum, I need only `monero-wallet-rpc` and only --offline, without zmq without libhidapi-libusb.so.0, and as static as possible on armv6, I need to build on pi zero w, I still have my build and with ccache on a microSD, what is the shortest path to get a f... build working without external dependencies? I build on PiOS, but the executable goes to a sttripped down buildroot image.
-
vthor
Any help appreciated. Thanks for reading. Need to go now first to get some fresh air.
-
vthor
And best would be realy to only build monero-wallet-rpc, and let aside all what is not needed... pi zero needs 20+ hours to compile....