Skip to content

Conversation

@scottrigby
Copy link
Member

Most scanners including GitHub could not properly detect the previous format

  • Adds full Apache License
  • Combines notices from both files into existing NOTICE file
  • The MIT licence from LICENSE is a permissively-licensed dependency
  • Removed unneeded text. A pointer and a short summary notice is sufficient for MIT permissively-licensed dependency
  • Follows Apache example NOTICE format per https://arc.net/l/quote/deyyhvsk

@ingydotnet ingydotnet marked this pull request as draft May 12, 2025 17:04
Copy link
Member

@ingydotnet ingydotnet left a comment

Choose a reason for hiding this comment

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

@scottrigby Can you amend the commit message to use a subject 50 chars or less?

Please and Thank You!

@ingydotnet ingydotnet changed the title Consolidate LICENSE and NOTICE to follow more standard format WIP: Consolidate LICENSE and NOTICE to follow more standard format May 12, 2025
@ingydotnet ingydotnet changed the base branch from v3 to main June 2, 2025 15:25
@harryzcy
Copy link

Is there any updates to this? Thanks!

@ingydotnet ingydotnet marked this pull request as ready for review August 23, 2025 15:56
Copilot AI review requested due to automatic review settings August 23, 2025 15:56
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR consolidates the project's dual-license structure to follow a more standard format that license scanners can properly detect. The changes replace a custom LICENSE format with the full Apache License 2.0 text while moving licensing information to the NOTICE file.

  • Replaces custom dual-license format with standard Apache License 2.0 text
  • Consolidates copyright and licensing notices into the NOTICE file
  • Maintains attribution for MIT-licensed files ported from libyaml

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
LICENSE Replaced with full Apache License 2.0 text instead of custom dual-license format
NOTICE Updated to include consolidated copyright notices and MIT license attribution for specific files

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ingydotnet ingydotnet changed the title WIP: Consolidate LICENSE and NOTICE to follow more standard format Change LICENSE and NOTICE to Apache standards Aug 23, 2025
@ingydotnet
Copy link
Member

@scottrigby I can't request you as a reviewer, but could you please review my updates?

Copy link
Contributor

@ccoVeille ccoVeille left a comment

Choose a reason for hiding this comment

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

I feel like it's OK with the current project structure.

I might suggest something else later, but for now it's OK.

@ccoVeille
Copy link
Contributor

I feel like it's OK with the current project structure.

I might suggest something else later, but for now it's OK.

Here is what I meant.

Navigating the complexities of open-source licenses can be challenging, especially when combining projects with different licensing models. Fortunately, the MIT and Apache 2.0 licenses are considered compatible, and you can successfully integrate a project with an MIT license into a project with an Apache 2.0 license.
Here's a breakdown of how to structure your files and directories to ensure proper compliance:
1. Understanding the Licensing Requirements
 * MIT License: The MIT license is very permissive. Its primary requirements are that you include a copy of the original MIT license and the copyright notice in any distribution of the software. You can do almost anything you want with the code, including using it in a proprietary project.
 * Apache 2.0 License: The Apache 2.0 license is also permissive but has a few more requirements than MIT. In addition to including a copy of the license, it requires you to:
   * Include a NOTICE file that lists any copyright and attribution notices from the original project.
   * State in any modified files that you have made changes.
   * Provide a patent grant from contributors.
Since Apache 2.0's requirements do not conflict with MIT's, you can use MIT-licensed code in your Apache 2.0 project.
2. Structuring Your Project's Root Directory
Your project's root directory should contain the main license and notice files that apply to the overall project.
 * LICENSE file: This file should contain the full text of the Apache 2.0 license, as it is the primary license for your project.
 * NOTICE file: This file is crucial for compliance with the Apache 2.0 license. It should be a plain text file that contains a summary of copyright and attribution notices. This is where you will include the information for the MIT-licensed project.
   * Start with your project's copyright: Begin the NOTICE file with a copyright notice for your own work.
   * Add a section for the MIT-licensed component: Create a clear section for the imported MIT-licensed project. This section must include:
     * The name of the project.
     * The original copyright notice from the MIT-licensed project's LICENSE file.
     * A reference to the MIT license itself. You can either include the full text of the MIT license in this file or point to a separate file (see below).
3. Handling the MIT-Licensed Component's Files
There are a few ways to handle the files from the MIT-licensed project within your directory structure.
 * Keeping the original file structure: If you're importing the entire project, you can maintain its original directory structure. For example, if you're importing a library called mit-lib, you might have a directory like my-project/lib/mit-lib/.
   * Within this directory, it's a good practice to keep the original LICENSE file from the mit-lib project.
   * You can also include a separate NOTICE file within this subdirectory if the original project had one.
 * Adding notices to individual files: If you are copying individual files from the MIT-licensed project into your codebase, you must ensure that you retain the original copyright notice in each file. The MIT license text can be a bit long to put at the top of every file, so you can often summarize it and refer to the main NOTICE or LICENSE file in the root directory for the full text. The Apache 2.0 license also has a boilerplate notice that can be added to the top of your own files.
4. General Best Practices
 * Be explicit: Don't rely on assumptions. It's better to be overly explicit in your licensing and attribution than to risk non-compliance.
 * Read the licenses carefully: While this guide provides general advice, always read the full text of both the MIT and Apache 2.0 licenses to ensure you've met all obligations.
 * Consult legal counsel if needed: This is not legal advice. For commercial projects or complex licensing situations, it's always best to consult with a legal professional.
 * Transparency is key: The goal of these licenses is transparency. By clearly identifying the different licensed components in your project and providing the necessary attribution and license texts, you are respecting the original authors' work and ensuring that downstream users of your project can do the same.

I asked Gemini to write a good response for it.

@ccoVeille
Copy link
Contributor

This part is what is a bit problematic

Adding notices to individual files: If you are copying individual files from the MIT-licensed project into your codebase, you must ensure that you retain the original copyright notice in each file. The MIT license text can be a bit long to put at the top of every file, so you can often summarize it and refer to the main NOTICE or LICENSE file in the root directory for the full text. The Apache 2.0 license also has a boilerplate notice that can be added to the top of your own files.

I feel like it might be OK for now with the old files.

But I would like to consider moving MIT licensed files to a separate folder in internal/libyaml then using Go aliases to import everything that needs it.

scottrigby and others added 2 commits August 29, 2025 11:16
Most scanners including GitHub could not properly detect the previous format

- Adds full Apache License
- Combines notices from both files into existing NOTICE file
- The MIT licence from LICENSE is a permissively-licensed dependency
- Removed unneeded text. A pointer and a short summary notice is sufficient for
  MIT permissively-licensed dependency
- Follows Apache example NOTICE format per https://arc.net/l/quote/deyyhvsk

Signed-off-by: Scott Rigby <[email protected]>
@ingydotnet ingydotnet merged commit 0b3f5bd into main Aug 29, 2025
13 checks passed
@ingydotnet ingydotnet deleted the license branch August 29, 2025 18:19
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.

6 participants