bloombloombloom / Bloom

A debug interface for AVR-based embedded systems development on GNU/Linux.
https://bloom.oscillate.io/
Other
64 stars 3 forks source link

Fixed missing includes #76

Closed ShyneTurtle closed 1 year ago

ShyneTurtle commented 1 year ago

Hello, I've tried installing bloom on my system (Manjaro Linux) and the installation failed due to multiple compilation errors caused by missing includes.

I tracked it down to 2missing headers (optional & cstddef) and managed to completely resolve the issue and compile. This fix shouldn't impact already working builds and might fix this issue for others.

The errors i was getting were:

  1. "optional" in namespace "std" does not name a template type All over the src/Logger/Logger.cpp and src/ProjectConfig.hpp files, since Logger.hpp included ProjectConfig.hpp i decided to import optional here.

  2. "size_t" does not name a type In the file src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/AvrEvent.hpp:32:23 I figured that this might happen in other files in the EDBG collection so i decided to add the include cstddef in the common header src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/Edbg.hpp. This header satisfies the size_t type while having a small overhead (only 7 types specified).

Feel free to make changes you feel necessary or contact me if you have any questions.

Sincerely, Shyne.

navnavnav commented 1 year ago

Hey Shyne,

Thanks for taking the time to look at this.

IIRC, this issue has already been addressed, with the fix currently residing in the develop branch.

The develop branch will be merged into master when I'm ready to push a new release. In the meantime, those who wish to build Bloom from source should use that branch. See the following discussion for more: https://github.com/bloombloombloom/Bloom/discussions/69

Out of curiosity, what made you decide to build Bloom from source? Did you face issues with the Arch Linux package hosted on the Downloads page?

ShyneTurtle commented 1 year ago

I used the AUR package bloom-git, and i saw the discussion thing after making this PR ^^', this is a pretty unusual branch config. I'm going to try to download the package from the downloads page as the source compiled version doesn't generate the Mapping.json file which is required at runtime.

navnavnav commented 1 year ago

What's unusual about the branch config? The master branch holds the stable release version. It's only updated (and tagged) upon a new release.

ShyneTurtle commented 1 year ago

Well the fact that you should compile from the dev branch since the master branch is unstable is pretty unusual, although i can see why it is needed

navnavnav commented 1 year ago

Stable doesn't mean "bug free" or "forwards-compatible". Stable means that it's less likely for someone to push any changes that will break things. The issue you faced is not a result of any changes being pushed to the master branch after the release.

The master branch currently hosts version 0.11.1, which was released almost 7 months ago. IIRC, that version was built with GCC 10, and I'm sure it still builds just fine with that version of GCC. The issue you faced was a result of using a newer, incompatible compiler to build Bloom from source.

Using a stable branch doesn't mean you won't face any compatibility issues with newer build tools.

I tend to only update my compiler when I want something that is offered by a newer version, which is why I only recently moved from GCC 10 to 12. This practice is not uncommon - some developers are still using GCC 5. Using the latest (or even fairly recent) build tools sometimes comes at the price of compatibility issues.

ShyneTurtle commented 1 year ago

Hey,

I've tried using the package available on the downloads page and it seems to work better than my compiled version. Haven't had the chance to test it fully yet.

Concerning the PR it is up to you if you want to fix this issue (even though this branch is not supported) or wait till the dev branch gets merged.

Have a great day.