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

"Copyright The Closure Library Authors" always shows up as the first comment even in code that is ultimately not Apache 2.0 licensed #4133

Closed
kohlschuetter opened this issue Nov 17, 2023 · 2 comments

Comments

@kohlschuetter
Copy link

kohlschuetter commented Nov 17, 2023

When building code that depends on closure-library (or generally, any code that generates important comments, e.g., via @license annotations), these comments show up first in the generated code, even if the license of the final product is different.

The problem is that dependency ordering (certainly with --compilation_level=ADVANCED) reorders JavaScript files such that even the entry point JavaScript file can only trigger a comment section below the "important comments" of its dependencies.

This can ultimately be a legal problem, as users of the file may regard the file as copyrighted/licensed in a clearly wrong way.

I encountered this when using j2cl, which internally uses closure (also see google/j2cl#80). The header of the output shows

/*

 Copyright The Closure Library Authors.
 SPDX-License-Identifier: Apache-2.0
*/

It would be very helpful if there was a simple way to always prepend the Javascript output file with a customizable comment.

That way, you can have a human-readable message (and possibly a SPDX-License-Identifier) that clearly indicates that not everything in the file is licensed as Apache-2.0.

Even better, there should be a way to forcibly suppress all comments in the output, even if @license statements were declared in some dependencies. The output clearly isn't source code anymore, so it doesn't have to carry the license statements.

@niloc132
Copy link
Contributor

See also #3551.

@h-joo
Copy link

h-joo commented Nov 22, 2023

For now, we suggest to use a workaround to use the --output_wrapper flag to print the valid license on top of the file.

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

No branches or pull requests

3 participants