I am not experienced on the topic of software licenses. After lot of research I understand that acknowledging copyright and licenses is in general a really complicated topic and can bring you potentially in big trouble if doing it wrong.
Sadly even narrowing the question down to the rust ecosystem I am unsure how to do it propperly. I even have doubts that it's done propperly.
I really would love to see like a guideline how to do it in the cargo book eg.
My understanding is that there are probably three different scenarios to considder, maybe only two:
Case 1 publishing a library package, case 2 publishing a binary package or a library package with example binaries, case 3 publishing the binary. (Maybe there is no difference between Case 1 and 2).
I think that in case 1 I am only referencing the code and not publishing it. So I can license my code quite independently and don't need to acknowledge the copyright of the dependencies.
In case 2 I guess I am doing in principle the same as in case 1. Because putting the code together is done during compile and so I don't ship the dependencies. What probably has to be acknowledged though (and I never saw that) if builder scripts, like build.rs for embedded or .cargo/config.toml is coppied from the respective templates. Of course there might be some modifications, but actually the boilerplate in there was licensed in the repo and actually one would need to mention that. Probably one has then also to differ the license for the actual lib and for the example. I don't know whether this works. Reuse could be a good solution to manage that.
Case 3 would definitly require one to publish all license text with all copyright notices etc. together. Leading to probsblydozens or hundreds of filled out Appache and/or MIT licenses. I don't know if one needs to provide this in the source code, in the documentation or including them in the binary. Or all of it.
I found here a topic on technical solutions for it: Missing good tools for bundling third party licenses
And apparently there seems not to be one. But despite how to automate it, I am unsure how to manage that topic propperly even manually.
Although probably nobody will care about my hobby projects, I am still really hesitated to publish something because I don't want to mess up that copyright topic.