Is there a rule that every MIT/APACHE repo always uses MIT/APACHE subrepos?

Can I use a MIT/APACHE repo and not worry about the subrepos's licenses?

I assume by subrepos you mean dependencies.

You can license the code you write however you want. However, the combined product, when compiled with dependencies (e.g. a compiled executable) must respect your dependencies' licenses. You can't ignore them, you can't override their licenses. This always applies, whether you get dependencies from crates-io, or git URLs, or copy-paste code.

See cargo-license to check what other licenses your project may be subject to.

2 Likes

It is an unfortunate situation, but one to be aware of, that there are a number of Rust crates which advertise themselves as available under permissive licenses like MIT/Apache, however they depend on FFI (typically C) code which is LGPL or GPL, meaning that those crates are actually available only under the terms of those "viral" licenses.

It's something you should be aware of when distributing a project with dependancies that the details of licensing may not be apparent simply from crate metadata.

In the case of dependencies that are under GPL, the GNU's FAQ is very helpful.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.