Skip to content
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

Add support for Monorepos #332

Closed
wants to merge 1 commit into from
Closed

Conversation

ypid
Copy link

@ypid ypid commented Mar 14, 2021

Imaging a monorepo like this:

monorepo-example
├── project_a
│   ├── README.md
│   └── .reuse
│       └── dep5
├── project_b
│   ├── README.md
│   └── .reuse
│       └── dep5
└── README.md

Without this change, reuse is confused that at the root of the project, there is no .reuse directory structure.

This PR probably needs discussion before it can be merged. I just went ahead and provided this POC implementation so that we have some code to talk about. At the very least, a test will need to be added. Refer to https://github.com/ypid/latex-packages for a real life (mono)repo for testing.

Imaging a [monorepo] like this:

```
monorepo-example
├── project_a
│   ├── README.md
│   └── .reuse
│       └── dep5
├── project_b
│   ├── README.md
│   └── .reuse
│       └── dep5
└── README.md
```

Without this change, `reuse` is confused that at the root of the project, there
is no `.reuse` directory structure.

[monorepo]: https://en.wikipedia.org/wiki/Monorepo
@ypid ypid changed the title .reuse dir overwrites project root to support Monorepos Add support for Monorepos Mar 14, 2021
@mxmehl
Copy link
Member

mxmehl commented Mar 29, 2021

Phew, thanks for bringing that up. However, I am a bit afraid of adding this as it would complicate the spec and also the tool. In our spec, we only allow for one .reuse directory: https://reuse.software/spec/#dep5

However, we're working on supporting more flexible files for bulk-licensing stuff that shall soft-deprecate the DEP5 files. See more details here: spdx/spdx-spec#502

If we introduced that, it should solve your issue, and we can dep5 deprecate slowly. What do you think?

@ypid
Copy link
Author

ypid commented Mar 29, 2021

The proposal from https://lists.fsfe.org/pipermail/reuse/2020q3/000085.html sounds good. It would address it. You can close this if you want.

@mxmehl
Copy link
Member

mxmehl commented Mar 30, 2021

Thanks for the info. I hope we'll have this implemented soon :)

@mxmehl mxmehl closed this Mar 30, 2021
@adisbladis
Copy link

adisbladis commented Sep 6, 2022

I struggled with adopting reuse for a monorepo I am hacking on with quite a complex set of licenses and ended up writing a tool that invokes reuse addheader ... and generates a dep5 file.

Quoting myself from my commit message:

Writing reuse dependency files is not a fun excercise in a complex repository with multiple
sub packages with a complex set of different licenses and sometimes even different licenses
within the same directory.

For example we license Nix expressions under MIT no matter where in the tree they live
so that they can freely be copy-pasted into nixpkgs and other third party repos
while the most important bits are all GPL-3.0-only.

This script provides a way to express our rules and outputs a reuse compatible dep5 file

It's quite a different approach to licensing management, instead of checking that files have licensing attached it declaratively manages the entire repository licensing.

@mxmehl Would you be interested in integrating something like this into reuse itself?
I would be happy to re-license my code if it's interesting to the reuse project.

Btw, just to clarify: Of course I'm not suggesting that users should write rules in Python, it was just the lowest mental overhead approach while I was hacking on it.
A more suitable format for a more generally useful tool would be something like TOML.

ypid added a commit to ypid/latex-packages that referenced this pull request Feb 18, 2023
--root existed even back when I opened
fsfe/reuse-tool#332. I just missed that it is
enough to fix my use case.
@ypid
Copy link
Author

ypid commented Feb 19, 2023

I just noticed that the use case I initially opened this PR for does not need code changes. Using --root for example reuse --root . lint in project_a works nicely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants