Discussion: How to handle HALs, SDKs and libraries

Karel Gardas karel at functional.vision
Sat Jul 15 13:03:35 UTC 2023


On 7/15/23 14:33, oss at c-mauderer.de wrote:
>>> I like submodules because they are well-supported by the usual tools. 
>>
>> Honestly. I like submodules idea, but hate its implementation. Some 
>> reasons:
>>
>> - submodules were added as a light weight feature and during the 
>> development of git/submodule feature they accumulated some more.
>>
>> - submodules started as way to get commit id of the external project 
>> to the tree. But only master branch was supported. (not suitable for 
>> RTEMS)
>>
>> - later submodules added capability to use tag (still not suitable for 
>> RTEMS)
>>
>> - later submodules added capability to use different branch from the 
>> project, but only a head of it. (finally what RTEMS need).
> 
> I don't like using branches instead of fixed commit IDs. Otherwise, it's 
> not possible to reliable re-build a fixed version.

And this is most important detail, so let's discuss this alone.

I have a hal library, let's consider this to be 
https://github.com/karelfv/stm32h7xx_hal_driver -- just one project for now.

This is a fork of ST Micro project of the same name which is a slow 
development project. Few accumulated commits over one year let say.

This project needs few RTEMS related patches and there is a chance they 
also need to kind of adapt to the new development. So let's branch as:

- master branch -- this is fork of ST Micro
- rtems-6-branch -- this is a branch from master at one point of time 
accumulating RTEMS related changes.

Now, let's assume this was done 6 months ago and now you would like to 
update from ST Micro upstream. How would you do that? I see:

- git fetch upstream inside the master
- git push master

that's update of master in fork and now:

- pull/merge master
or
- rebase master

in the rtems-6-branch? I'm afraid rebase is dangerous in shared setup so 
probably pull/merge?

Anyway, still this is a branch based workflow. How would you do that 
workflow with just fixed commit IDs?

I'm asking since so far commit IDs on submodules were always obtain from 
master branch which is what we basically fork and does not give us 
ability to patch with RTEMS changes...

So I'm curious how would you do that?

Thanks!
Karel




More information about the devel mailing list