Skip to content

Using licensed-notice-deduplicate to reduce NOTICE size#442

Open
cmaglie wants to merge 3 commits into
mainfrom
license-compact
Open

Using licensed-notice-deduplicate to reduce NOTICE size#442
cmaglie wants to merge 3 commits into
mainfrom
license-compact

Conversation

@cmaglie

@cmaglie cmaglie commented Jun 10, 2026

Copy link
Copy Markdown
Member

Motivation

I've made a tool to reduce the license duplications in the NOTICE file.

Change description

This PR includes the resulting NOTICE file to help assess the impact.

When two or more packages share the same license (exact match), they will be grouped as follows:

 *****
-github.com/AlecAivazis/survey/v2@v2.3.7
-
-MIT License
-
-Copyright (c) 2018 Alec Aivazis
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
-*****
-github.com/AlecAivazis/survey/v2/core@v2.3.7
+License for the following packages:
+  github.com/AlecAivazis/survey/v2@v2.3.7
+  github.com/AlecAivazis/survey/v2/core@v2.3.7
 
 MIT License
 
 Copyright (c) 2018 Alec Aivazis
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal

Turns out that this method is quite effective for the golang + licensed combo, for the following reasons:

  • licensed generates a NOTICE for each main package and for all sub-packages of the main package, even if they share the same license in 99.9% of the cases.
  • Even different main packages, in some cases, share the same license; this is the case, for example, for all the golang.org/x/ packages or the grpc library.

In our case, the size reduction is remarkable, since we go from 13.8MB to 1.3MB (~90% reduction), while keeping the file perfectly readable.

Additional Notes

Reviewer checklist

  • PR addresses a single concern.
  • PR title and description are properly filled.
  • Changes will be merged in main.
  • Changes are covered by tests.
  • Logging is meaningful in case of troubleshooting.
@cmaglie cmaglie marked this pull request as draft June 10, 2026 18:59
@cmaglie cmaglie marked this pull request as ready for review June 15, 2026 14:23
@cmaglie cmaglie self-assigned this Jun 15, 2026
@cmaglie cmaglie requested a review from a team June 16, 2026 14:12

@Xayton Xayton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the copyright file (debian/arduino-app-cli/usr/share/doc/arduino-app-cli/copyright) does not contain the full list of licenses. We probably removed it when the file became too big, but it might be time to restore it now.

If I'm not wrong, the suggested format for the debian/copyright file should be DEP-5, but AFAIK we are not using it in other packages we create (like arduino-router).

See this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants