-
Notifications
You must be signed in to change notification settings - Fork 143
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
[scons] Simplify Scons tooling, misc. fixes and improvements #558
[scons] Simplify Scons tooling, misc. fixes and improvements #558
Conversation
Relative debug file paths are not a build system issue, but a compiler "feature" controlled by the An example listing:
|
Found a solution to make all compiler paths relative too, should even be portable. Still have to fix CMake and tell GDB where to look for compiler sources. |
acc5338
to
4aaa478
Compare
@@ -59,6 +59,7 @@ program-bmp: build | |||
ui?=tui | |||
debug: build | |||
@python3 modm/modm_tools/gdb.py -x modm/gdbinit -x modm/openocd_gdbinit \ | |||
-ex "dir $(dir $(realpath $(dir $(realpath $(shell which arm-none-eabi-gcc)))))" \ |
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.
FYI: This Makefile will get a make over via the ::make
generator, so this is currently more of an ugly placeholder.
Which NUCLEO boards do you have @rleh @chris-durand? I want to exchange ELF files to test the relative paths for debugging. I have these:
Update: Actually, never mind, I can simply test this myself by moving the modm folder around… |
4aaa478
to
2d5c6c2
Compare
suffix = '.cpp', | ||
src_suffix = '.pbm', | ||
emitter = bitmap_emitter, | ||
single_source = True) |
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.
The reason for these changes is that env.Action()
did not resolve the COMSTR properly (just blank $SOURCE
and $TARGET
), hence the use of a function before, while using SCons.Action.Action()
(or just Action()
via import) did resolve this properly. I couldn't find this as documented behavior, perhaps it's a bug, perhaps not… who knows with SCons.
d198504
to
d3f834c
Compare
I added the |
FYI: I'm going to merge this tonight unless changes are requested. @rleh @chris-durand |
I won't be able to do a review before next week. |
Ok, then I'll wait until you've reviewed. 🧐 |
I also don't have time to review it right now. This change seems quite time-consuming to review if you haven't worked on that code before. I will have a look during the weekend. |
d3f834c
to
e59adae
Compare
I recommend going commit by commit for the reviews, since they are more nicely structured than the whole blob. |
Display relative build paths to reduce verbosity.
e59adae
to
1fc3805
Compare
%% if core.startswith("avr") | ||
env["COMPILERPREFIX"] = "avr-" | ||
%% elif core.startswith("cortex-m") | ||
env["COMPILERPREFIX"] = "arm-none-eabi-" | ||
%% endif |
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.
This won't scale well for e.g. RISC-V and/or non-GCC compilers, but is ok for now...
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.
Nice!
I got annoyed with our bloated SCons tooling and our overly verbose logging. So I changed a few things:
:platform:cortex-m
: Can be useful for regulating IRQ latency on M4/M7.firmware={GNU Build ID or path/to/filename.elf}
for relevant SCons commands (program, debug, listings etc).:build:libaries
format:-lname.a
for example won't be properly recognized by the linker.build/modm/modm/src
->build/modm/src
.scons hex
target back and clean.bin
,.hex
and.lss
targets onscons -c
cc @rleh @chris-durand