-
Notifications
You must be signed in to change notification settings - Fork 100
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
Makefile does not recompile despite dependent header file changes on MSYS2 #528
Comments
Thanks @jlj-ee, I think we're missing the inclusion of the dependency files as prerequisites for our implicit rules. I'll take a look at this |
Quick update on this ticket: The dependency files seem to be working as expected with our current gcc.mk on Linux, but are failing to work on Windows. It's getting trickier to track down the root cause of this... suspected path parsing issues on Windows, but still trying to identify the root cause. |
Thanks @Jake-Carter for the update. I am on Windows so that syncs with my experience. In the meantime I just clean before I build to be sure I get the latest. Is this the implicit rule to include the dependencies?
When I went to read about auto-dependency generation, I came across this article that uses a slightly different approach and includes an explicit rule to indicate that the object files should depend on both the source files and generated dependencies:
I do not see anything similar in the explicit rule for MSDK:
This doesn't explain why it would work on Linux but not Windows, but would there be a benefit to adding the .d files as a dependency in the explicit rule, as in the linked article? |
Yes, Since the existing setup works on Linux I initially guessed it was a path issue on Windows. In the dependency rules themselves I could see some malformed paths being generated like the ones below... C:/Users/JCarter3/repos/fork/msdk/Examples/MAX78000/Hello_World/build/board.o: \
# ...
C:/Users/JCarter3/repos/fork/msdk/Libraries/PeriphDrivers/Include/MAX78000/gpio.h \
C:/Users/JCarter3/repos/fork/msdk/Libraries/PeriphDrivers/Include/MAX78000/mxc_pins.h \
c:\users\jcarter3\repos\fork\msdk\libraries\miscdrivers\led\led.h \ #<-- malformed
c:\users\jcarter3\repos\fork\msdk\libraries\miscdrivers\pushbutton\pb.h \ #<-- malformed
C:/Users/JCarter3/repos/fork/msdk/Libraries/CMSIS/Device/Maxim/MAX78000/Include/simo_regs.h \
c:\users\jcarter3\repos\fork\msdk\libraries\miscdrivers\display\tft_ssd2119.h \ #<-- malformed
C:/Users/JCarter3/repos/fork/msdk/Libraries/PeriphDrivers/Include/MAX78000/spi.h \
C:/Users/JCarter3/repos/fork/msdk/Libraries/CMSIS/Device/Maxim/MAX78000/Include/spi_regs.h \
C:/Users/JCarter3/repos/fork/msdk/Libraries/PeriphDrivers/Include/MAX78000/mxc_assert.h \
C:/Users/JCarter3/repos/fork/msdk/Libraries/PeriphDrivers/Include/MAX78000/mxc_lock.h \
c:\users\jcarter3\repos\fork\msdk\libraries\miscdrivers\touchscreen\tsc2046.h #<-- malformed I thought the forced lower-case paths like C:/Users/JCarter3/repos/fork/msdk/Examples/MAX78000/Hello_World/build/board.o: \
# ...
C:/Users/JCarter3/repos/fork/msdk/Libraries/PeriphDrivers/Include/MAX78000/gpio.h \
C:/Users/JCarter3/repos/fork/msdk/Libraries/PeriphDrivers/Include/MAX78000/mxc_pins.h \
C:/Users/JCarter3/repos/fork/msdk/Libraries/MiscDrivers/LED/led.h \
C:/Users/JCarter3/repos/fork/msdk/Libraries/MiscDrivers/PushButton/pb.h \
C:/Users/JCarter3/repos/fork/msdk/Libraries/CMSIS/Device/Maxim/MAX78000/Include/simo_regs.h \
C:/Users/JCarter3/repos/fork/msdk/Libraries/MiscDrivers/Display/tft_ssd2119.h \
C:/Users/JCarter3/repos/fork/msdk/Libraries/PeriphDrivers/Include/MAX78000/spi.h \
C:/Users/JCarter3/repos/fork/msdk/Libraries/CMSIS/Device/Maxim/MAX78000/Include/spi_regs.h \
C:/Users/JCarter3/repos/fork/msdk/Libraries/PeriphDrivers/Include/MAX78000/mxc_assert.h \
C:/Users/JCarter3/repos/fork/msdk/Libraries/PeriphDrivers/Include/MAX78000/mxc_lock.h \
C:/Users/JCarter3/repos/fork/msdk/Libraries/MiscDrivers/Touchscreen/tsc2046.h So now I'm porting the solution in the article you shared to our system. It's at a lower priority than some of the other work for the SDK, but hopefully this week I will have it tested. The ordering and approach from the article is slightly different, so it may reveal something we're missing in our setup. I'm still not sure why Windows specifically is failing, but MSYS2 is another factor to consider. I'll keep you posted! |
@jlj-ee FYI #528 seems to (partially) resolve this issue. The behavior is as expected on native windows as of that PR. The problem seems to be the MSYS2 translation layer for path conversions. Still working on the right mix of |
Hi @Jake-Carter I have updated to the October release but still find that the build system does not detect changes if I only modify a dependent header file. Is there anything I need to change in my makefile or project.mk in order to benefit from the changes you linked a couple months ago that apparently resolved this issue on Windows? |
Hi @jlj-ee This is fixed for native Windows builds, which is an opt-in feature for this latest release. See the release notes for the Oct release: https://github.com/Analog-Devices-MSDK/msdk/releases/tag/v2023_10 I tagged this ticket to the PR in the comment above and didn't realize it auto-closed. I did not get the paths to work properly on MSYS2... |
Thanks for the clarification @Jake-Carter, I’ll rtfm and try again :) Edit: Followed the instructions in the release notes to configure for using native Windows make and it works a treat. Thanks, this is a big QoL improvement! |
I am not seeing recompilation happen if I edit a header file and then recompile.
Minimal example to repro using VS Code hello_world example.
The same behavior is seen if, instead of modifying board.h, I include a new main.h file in my copy of the example and override the CONSOLE_BAUD there.
I looked into tweaking gcc.mk to address this (e.g. using an approach like this) but I could not get it to work due to lack of experience with GNU-make. I do see that the *.d dependencies are already being generated as part of the existing MSDK build approach, but it still appears as though changes to (some?) headers do not prompt recompilation via the makefile like I would have expected.
The text was updated successfully, but these errors were encountered: