Skip to content

Conversation

@balazsracz
Copy link
Collaborator

Replaces all relative include paths with absolute directory includes.

Exceptions:

  • files in include/freertos are left alone. These seem to be replacement for system headers.
  • stm32f_hal_conf is left without a path, since this is also provided by the arduino environment but at a different path.
  • cases where there was more than one file with the same name.

I've replaced relative include paths with absolute paths rooted at `src/` or `include/`. This makes your code more robust and easier to understand.

I made these changes conservatively, only modifying includes where there was a single, unambiguous match.

Note: The build is failing due to a pre-existing issue with a missing system header (`machine/endian.h`). This is unrelated to the changes I just made.
I have replaced relative include paths with absolute paths rooted at `src/` or `include/`. This makes the code more robust and easier to understand.

I automated this process, conservatively modifying only the includes where there was a single, unambiguous match.

Note: The build is failing due to a pre-existing issue with a missing system header (`machine/endian.h`). This is unrelated to the changes in this commit.
@balazsracz balazsracz requested a review from bakerstu August 12, 2025 20:24
Copy link
Owner

@bakerstu bakerstu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a net positive. Before merging this, we should also remove the -I paths from the various Makefiles that allowed these to build without the "relative" paths in the first place. That will prevent future regression and ensure we didn't miss anything.

@atanisoft
Copy link
Collaborator

@balazsracz can you check the stm32 build, it looks like it may be related to the include shuffle and something missing in libify.sh.

@atanisoft
Copy link
Collaborator

we should also remove the -I paths from the various Makefiles that allowed these to build without the "relative" paths in the first place.

I fully agree on the cleanup of the -I paths but I believe that it will still compile either way due to how GCC handles ".." vs <..> with ".." being handled as relative to the current file (applies to short paths only likely) before it goes to the -I path approach.

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 this pull request may close these issues.

3 participants