-
Notifications
You must be signed in to change notification settings - Fork 2k
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
boards: move shared code to boards/common/xx #8058
Conversation
Do we want to make the common boards in a separate group for the documentation, like If it is wanted, I can try something after this PR is merged. |
Yes, I think this would be a great idea. I intentionally did not touch any doxygen grouping with this PR, so adding that on top would be my preferred approach. |
Is it required to write commits so that every commits work? Or at least that we try to. I ask because right now, And also, things will be broken before the last fix commits. |
We have the (unwritten) rule that commits must work on PR merge commit level. So, if some commits within one PR don't build unless some other commits of the same PR get merged, that's fine. |
@@ -1,3 +1,3 @@ | |||
MODULE = arduino-mkr-common |
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.
next time use "git mv" ;)
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.
Git does not handle renames. git mv
just calls git rm
, mv
and git add
. This is likely a glitch from gits magic rename detection code that tries to guess if files were renamed while looking at a changeset.
+1 |
Thinking of it, I would also add a What do you think ? |
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.
While I agree with the idea in general, I don't like the approach taken here. Major issue/concern I have with it is, that it moves related code into different levels of subdirectories which should (semantically) reside on the same.
What I mean is as follows, with this approach we'll get something like:
boards/arduino-mega2560
boards/arduino-nano
boards/arduino-uno
...
boards/common/arduino-atmega
...
boards/common/msba2
boards/common/nucleo
...
boards/common/wsn430
...
boards/nucleo-f411
While the (semantically) better approach (I suggest) would be, to group similar boards into one subdirectory which would have a common
folder, i.e., the above would like:
boards/arduino-atmega/common
boards/arduino-atmega/arduino-mega2560
boards/arduino-atmega/arduino-nano
boards/arduino-atmega/arduino-uno
...
boards/msba2/common
...
boards/nucleo/common
boards/nucleo/nucleo-f411
...
boards/wsn430/common
Though I know this might be more difficult to coop with our make/build system, it is IMHO more logical.
I really don't like that proposal. I think it is really nice that you basically can get all supported boards by doing ls boards/ | grep -v "common" and the current proposal makes that even easier, since you can basically ditch the With your proposal that would be more complicated: ls boards/*/ | grep -v "common" I don't think it's more or less logical logical than the one @haukepetersen proposed. Your suggestion implies that all stuff is at its next higher hierarchy (both common and specific), @haukepetersen's approach implies that all common things are in one place, ordered by the next higher hierarchy. |
@smlng I don't agree for multiple reasons:
So looking at
compared to
I'd am strongly for the second, flat, and simple structure! On top, keeping the structure flat and simple, it means that we can easily create 'vertical' shared modules, that don't fit in the context of a certain board or cpu family. So for example we could easily add a module like |
Or in less words -> 'What @miri64 said` :-) |
I like this proposal. Especially being able to create common clock configurations for all boards sharing a single CPU will reduce code duplication a lot. |
Not really -- @miri64 mainly complained that my suggested approach would make it harder to use For the former: my idea wasn't to introduce an arbitrarily deep directory structure for boards, but rather group those boards that already have a Anyhow, I agree with you that simplicity is key, nevertheless in the long run a little structure might also help. My points is, that we should not hastily restructure boards without considering and discussing alternatives - hence my suggestion, to show there are other possibilities. |
I also spoke about the hierarchical implications. And I said that with this approach I won't even need grep ;-). |
so you think searching in a flat hierarchy is faster than traversing a (shallow) tree 😉 Assuming you have a random Though I admit, getting an overview over all boards is a bit more complicated as @miri64 showed above - you have to use |
I intend to introduce a kinetis directory for the kinetis clock configuration which will be shared between all Kinetis boards. My previous proposal was to put it in cpu, but you suggested that it should not be in cpu but under boards, so with this method in combination with the same ideas in #8044 we can reduce code duplication. |
Nope, far to complicated :P I would just use |
I would merge it yes. But as @kaspar030 said "We should give a change of this magnitude a little more time". It could also be an occasion to write the hierarchy in the documentation. @gebart would that give you time to review it ? do you agree to merge it without your review or do you want a bit more time ? |
I agree with merging even without my review as long as at least one other person has reviewed it |
Three days passed |
needs rebase, my ACK holds |
and only 5 new conflicts... As stated before, waiting with this kind of PR is no fun for the author :-) |
It's no fun either for authors of PRs introducing new boards ;) |
Nope, neither the hen nor the eggs have fun :-) |
4e4ef6a
to
a1d5e0f
Compare
rebased |
Murdock is happy, no one complained. |
awesome, thanks everyone. |
As discussed/proposed in #8044: this PR puts all shared board code under
/boards/common/xx/
instead of using shared folders as inboards/xx-common/
.Quote: