In the last weeks I worked with this repository and used the included Dockerfile and the container built from it as compiler.
The dockerfile builds an archlinux-container with an arm-none-eabi-gcc included and copies the repository into the container, before it starts building within it.
I have two minor issues with this:
Everytime something in the Makefile gets changed (e.g. including/excluding modules), the container needs to be rebuild, if the change should take effect. This is really time consuming.
The container has a size of 4GB on my system. Whereas storage (on desktop systems) is not really an issue anymore today, it would be great, if we can keep the containers size low.
Proposal
Instead of rebuilding the container everytime and copy the repo into it, it feels more straight forward to me, to build the container with the compiler only, once. Then we can mount the source code into it. This has the advantage, that every change is accessible by the compiler in the container immediately.
To realise this, it would be benefitial to restructure the repo. For example, moving the source code into a src/ directory, that can be mounted in the container more easily. In addition, it might increase the readability of the repo, by separating firmware code from helper code, like dockerfiles, scripts etc.
The container size could be reduced by roughly 600 MiB, when running the pacman commands all in the same layer and flushing the cache afterwards.
I have a rather radical PR, which implements all proposed changes, at hand. If you are okay with the proposal, I can hand it in as a draft request.
In the last weeks I worked with this repository and used the included Dockerfile and the container built from it as compiler.
The dockerfile builds an archlinux-container with an arm-none-eabi-gcc included and copies the repository into the container, before it starts building within it.
I have two minor issues with this:
Proposal
Instead of rebuilding the container everytime and copy the repo into it, it feels more straight forward to me, to build the container with the compiler only, once. Then we can mount the source code into it. This has the advantage, that every change is accessible by the compiler in the container immediately.
To realise this, it would be benefitial to restructure the repo. For example, moving the source code into a
src/
directory, that can be mounted in the container more easily. In addition, it might increase the readability of the repo, by separating firmware code from helper code, like dockerfiles, scripts etc.The container size could be reduced by roughly 600 MiB, when running the pacman commands all in the same layer and flushing the cache afterwards.
I have a rather radical PR, which implements all proposed changes, at hand. If you are okay with the proposal, I can hand it in as a draft request.