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

USBGuard doesn't compile with pegtl 3.0 #441

Closed
xelaseer opened this issue Dec 12, 2020 · 2 comments · Fixed by #453
Closed

USBGuard doesn't compile with pegtl 3.0 #441

xelaseer opened this issue Dec 12, 2020 · 2 comments · Fixed by #453

Comments

@xelaseer
Copy link

As per the title.

USBGuard 0.7.8 fails with the following errors while building:

checking tao/pegtl.hpp presence... yes
configure: WARNING: tao/pegtl.hpp: present but cannot be compiled
configure: WARNING: tao/pegtl.hpp:     check for missing prerequisite headers?
configure: WARNING: tao/pegtl.hpp: see the Autoconf documentation
configure: WARNING: tao/pegtl.hpp:     section "Present But Cannot Be Compiled"
configure: WARNING: tao/pegtl.hpp: proceeding with the compiler's result
configure: WARNING:     ## ------------------------------------ ##
configure: WARNING:     ## Report this to usbguard@usbguard.org ##
configure: WARNING:     ## ------------------------------------ ##
checking for tao/pegtl.hpp... no
configure: error: in `/var/tmp/portage/sys-apps/usbguard-0.7.8/work/usbguard-0.7.8':
configure: error: PEGTL header file not found or not usable. Re-run with --with-bundled-pegtl to use the bundled library.

Pegtl 3.0 fixes some errors with -werror-type-limits, which were causing build failures on my computer with 2.8.3, so USBGuard support for the newer Pegtl 3.0 would be much appreciated.

@b1rger
Copy link
Contributor

b1rger commented Dec 31, 2020

Hi, I did some research and there are a couple of changes that have to be made for usbguard to work with pegt 3.x. The first thing to do is to bump the supported C++ standard to C++17 in configure.ac. Then the file tao/pegtl/contrib/tracer.hpp has been dropped and replaced by tao/pegtl/contrib/trace.hpp - this affects src/Library/UEventParser.cpp, src/Library/UMockdevDeviceDefinition.cpp, src/Library/public/usbguard/RuleParser.cpp, src/Tests/Fuzzers/fuzzer-rules.cpp and src/Tests/Fuzzers/fuzzer-uevent.cpp. Following that the call to tao::pegtl::parse in those files has to be updated, but thats where I'm stuck - I don't have enough C++ skills to know how to update that 😕

@hartwork
Copy link
Contributor

hartwork commented Jan 31, 2021

This is causing trouble in Gentoo with pegtl 3.2.0 as well. I'd want to not use the bundled pegtl for (potential) security reasons and keeping users in the past, i.e. usbguard blocks users from upgrading their system wide installation of pegtl to version 3.2.0. So please take my vote for supporting pegtl 3.2.0. Many thanks! 🙏

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

Successfully merging a pull request may close this issue.

3 participants