-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
trezor: support c++17 and protobuf v25, libusb fix #smol #9064
Conversation
a81b638
to
381d848
Compare
381d848
to
10b275e
Compare
@jeffro256 @moneromooo-monero when you have a minute for a review, this one is small 😅 thanks! |
Oor maybe @vtnerd @rbrunner7 ? :) This PR is minimalistic, thanks! |
I will review it but didn't get to it yet. |
Hello, just checking if you have a minute for the review :) |
I'm getting linking errors with target Selection from error messages:
|
e6a190e
to
c353be9
Compare
@jeffro256 it does not seem related to this PR, can you pls try again? |
Pulled latest commit and retried compiling, got the same results. I can run |
8e3c89a
to
18879e8
Compare
looks similar to #8439 |
@jeffro256 It looks unrelated to my changes :/ Static linking for libunbound requires also libnettle, which is not linked. The following commit fixed the linking on Ubuntu 23.04 04ccc0f Or installing static unbound from sethforprivacy/simple-monerod-docker#61 may help:
or
Now checking if it passes on the CI. If everything is green, can you pls review? Thanks! Edit: still issues with static build |
f70de2c
to
18879e8
Compare
@jeffro256 ok I figured out that libunbound + nettle does not statically compile on Ubuntu 23.04 by default. I tried several combinations, nothing worked. Default nettle did not have for example After installing unbound-1.61.1 according to sethforprivacy/simple-monerod-docker#61 compilation started to work out of the box. wget https://www.nlnetlabs.nl/downloads/unbound/unbound-1.16.1.tar.gz && \
echo "2fe4762abccd564a0738d5d502f57ead273e681e92d50d7fba32d11103174e9a unbound-1.16.1.tar.gz" | sha256sum -c && \
tar -xzf unbound-1.16.1.tar.gz && \
rm unbound-1.16.1.tar.gz && \
cd unbound-1.16.1 && \
./configure --disable-shared --enable-static --without-pyunbound --with-libexpat=/usr --with-ssl=/usr --with-libevent=no --without-pythonmodule --disable-flto --with-pthreads --with-libunbound-only --with-pic && \
make -j${NPROC:-$(nproc)} && \
make -j${NPROC:-$(nproc)} install |
@selsta would you pls find a minute for a review? :) |
ooor @vtnerd 🙏 ? @moneromooo-monero 🙏 ? :) |
I will try to review it next week |
src/device_trezor/README.md
Outdated
Trezor uses [Protobuf](https://protobuf.dev/) library. As Monero is compiled with C++14, the newest Protobuf library version cannot be compiled because it requires C++17 (through its dependency Abseil library). | ||
This can result in a compilation failure. | ||
Trezor uses [Protobuf](https://protobuf.dev/) library. Monero is now compiled with C++ 17 by default. | ||
Thus, protobuf v23 and higher has to be used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is v23 a necessity? We build release binaries with v21 (https://github.com/monero-project/monero/blob/master/contrib/depends/packages/native_protobuf.mk#L2) and it compiled with Trezor support enabled according to CI in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it is not a hard requirement, it is changed now
cmake/CheckTrezor.cmake
Outdated
if (NOT Protobuf_FOUND) | ||
FIND_PACKAGE(Protobuf) | ||
endif() | ||
|
||
_trezor_protobuf_fix_vars() | ||
|
||
# Early fail for optional Trezor support | ||
if(${Protobuf_VERSION} GREATER 21) | ||
trezor_fatal_msg("Trezor: Unsupported Protobuf version ${Protobuf_VERSION}. Please, use Protobuf v21.") | ||
if(${CMAKE_CXX_STANDARD} LESS 17 AND ${Protobuf_VERSION} GREATER 21) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is no protobuf version installed, this if
fails with this CMake error
CMake Error at cmake/CheckTrezor.cmake:92 (if):
if given arguments:
"17" "LESS" "17" "AND" "GREATER" "21"
Unknown arguments specified
Call Stack (most recent call first):
CMakeLists.txt:704 (include)
-- Configuring incomplete, errors occurred!
Which aborts CMake. This is unintended behaviour for USE_DEVICE_TREZOR=ON
and USE_DEVICE_TREZOR_MANDATORY=OFF
. The issue already exists in the current code (see #9040) but it can be fixed together with this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aah you are right, I exchanged those two ifs so first protobuf is checked. it fixes it.
@selsta thanks for the review! pls when you have a minute to check again, I addressed your comments. Thanks a lot! |
src/device_trezor/README.md
Outdated
Trezor uses [Protobuf](https://protobuf.dev/) library. As Monero is compiled with C++14, the newest Protobuf library version cannot be compiled because it requires C++17 (through its dependency Abseil library). | ||
This can result in a compilation failure. | ||
Trezor uses [Protobuf](https://protobuf.dev/) library. Monero is now compiled with C++ 17 by default. | ||
Protobuf v21+ is required. Note that Protobuf v23+ requires C++ 17. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is v21 required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v21 (and greater) is the tested version. Would you prefer different wording?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, maybe reword it as something like v21+ is tested, older versions are not guaranteed to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done :)
@selsta when you have a minute, all comments should be addressed by now. thanks! :) |
@selsta ping ping :) |
@ph4r05 sorry, was busy with other things. please squash and then it can be merged |
- fix If there is no protobuf version installed, if fails - passphrase test fix, wallet keys init was missing
squashed @selsta, thank you! |
@selsta c++17 support came sooner than expected 😅 I've modified the code a bit to protobufv25 and c++17 works