-
Notifications
You must be signed in to change notification settings - Fork 23
Description
In late 2020 I checked out version 2918c48 of this repo on my Mac, put some patches in PatchSource, and started. It worked great and I was a happy developer.
This week I checked out 38448cc on my Windows machine (same as 0d6c6f2 for purposes of the following bugs; somehow I accidentally checked out the feature/dsp-updates branch at first instead of master or develop) and started trying to build my own patches. I eventually got everything working, but I ran into a series of problems. Some were just annoying but some lost me a great deal of time trying to debug. Overall the experience of developing patches locally with OwlProgram+FirmwareSender is definitely worse than it used to be. The Mac and Windows machines are running the same arm-none-eabi-gcc (gcc version 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599]) so this is due to changes in the repo.
What I encountered:
-
Problem 1:
make libsrequired nowWhen I run
make patchon a new checkout, it fails saying that two .a files are not found. This is documented in the README but it is still a little nonobvious.Suggestion:
make libsshould be a dependency ofmake patch, so that the libs are built automatically when you build the patch.If that is hard, an easier suggestion would be to detect specifically that the .a files are missing at the start of
make patchand print a clear error message saying something like "x not found: must runmake libs. See README". -
Problem 2:
make libsfails without emscriptenWhen I run make libs it runs for a long time then fails saying "emcc" is not found. This also is documented in the README but again it is nonobvious and the error message is nonobvious (I had to google what "emcc" was). The idea of an "expected failure" on a make command is also very problematic because it means you cannot use normal UNIX idioms with
make libssuch asmake libs && make patch.Suggestion: There should be separate
make libsandmake weblibstargets.make patchshould depend onmake libsbut notmake weblibs, andmake libsshould work without emscripten. (Or if you like, something likemake patchlibsfor the .a files,make weblibsfor the emscripten stuff, andmake libsthat triggers both of them.) -
Problem 3: Badly misleading errors when incorrect PLATFORM specified*
When I started making patches this week I was working off my notes from 2020. So the way I built was:
make patch TOOLROOT= PATCHNAME=Silence PLATFORM=Magus. However, the platform names have changed, it is now OWL2 not Magus. This would be okay except that if you run with a non-empty but unrecognized PLATFORM, it fails with a highly misleading error:/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: cannot open linker script file -fsingle-precision-constant: No such file or directoryI wasted a lot of time trying to debug this, I assumed at first that a GCC-only argument was being passed to the linker... in fact the problem was the line
LDFLAGS += -T$(LDSCRIPT) $(ARCH_FLAGS), if the platform is unrecognized LDSCRIPT is empty.Suggestion: PR Print error message when platform not recognized #111
-
Problem 4:
make cleanrequired every timeIn my testing with 38448cc and 0d6c6f2 , if I build and run my ScreenSaver patch, then run
(cd .. && make patch TOOLROOT= PATCHNAME=ScreenSaver PLATFORM=OWL2 && ../FirmwareSender/Builds/VisualStudio2015/Win32/Release/ConsoleApp/FirmwareSender.exe -in Build/patch.bin -out OWL-MAGUS -run), then make a change to ScreenSaver, then repeat the build and install, nothing changes. Themake patchhas no effect. I have tomake cleanevery time.The README does say: "Make sure to do a
make cleanbefore compiling a new patch, or addcleanto your make target (e.g.make clean patch), otherwise the previous patch name will be retained." This is how things used to work, but now contrary to the README it appears clean is required even when building the same patch over.I lost a pretty long time on this last night thinking I was using the new screen features wrong when in fact my changes were simply not being deployed to the device.
Suggestion: Obviously it would be nice if
make patchunderstood changes andmake cleanwere not required. Having tomake cleanevery time you switch patches is annoying and easy to forget, but tolerable. Having tomake cleanevery time is livable, but with large patches this will start to get a bit slow..!If this is hard to fix, then either
make patchshould simply triggermake cleanautomatically, or at least the README should be changed to warnmake cleanis required every time.
I think all of these are "papercuts" except (3), so I made a PR for that one.