Skip to content

fix(install): install LICENSE and NOTICE with the compiler - #250

Merged
SizzleUnrlsd merged 6 commits into
mainfrom
fix/install-license-notice
Nov 9, 2026
Merged

SizzleUnrlsd merged 6 commits into
mainfrom
fix/install-license-notice

Conversation

@SizzleUnrlsd

@SizzleUnrlsd SizzleUnrlsd commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Refs #249

Summary

cmake --install installed bin/cc, the libraries in lib/ and include/, but neither LICENSE nor NOTICE. Apache-2.0 sets two conditions on redistribution:

  • Section 4(a): recipients must be given a copy of the License.
  • Section 4(d): Derivative Works must carry the attribution notices of NOTICE.

An install prefix copied or packaged as it is carried neither file.

Change

  • CMakeLists.txt: install(FILES LICENSE NOTICE DESTINATION share/doc/coretrace-compiler COMPONENT licenses). A plain cmake --install installs every component, these files included. The licenses component lets a test install them alone, without building anything.
  • README: its Install section lists the two files.

Test

Install.ShipsLicenseAndNotice (test/unit/check_installed_licenses.cmake) installs the licenses component of the build tree into a temporary prefix. It passes --config when a multi-config generator built the tree. It then fails unless share/doc/coretrace-compiler/LICENSE and NOTICE exist and match the sources byte for byte.

The test lands first as an expected failure (WILL_FAIL), which the fix removes. Run locally on macOS, on a configured build tree with nothing built:

Result
Before the install rule (script run directly) cmake --install succeeds and installs nothing; the test fails on not installed: share/doc/coretrace-compiler/LICENSE
After passes; the prefix holds LICENSE and NOTICE
A NOTICE in the sources that differs from the installed one fails on differs from NOTICE of the sources

In CI at aa57784, which merges main after #248, the test passes in the 18 jobs that run the test suite:

It passed in the same jobs at 28ea589, before that merge (42394558228, 42394558175).

The ThreadSanitizer job runs the runtime's tests only, and the Docker job is skipped on pull requests. test/examples/test_install_layout.py, which installs everything, passes too. clang-format, license-compliance and the commit conventions pass.

Not covered

  • CoreTrace/coretrace's install: it fetches this project through its analyzers, and installs this project's LICENSE and NOTICE from the sources itself. Whether its cmake --install now also gets share/doc/coretrace-compiler/ was not checked.
  • The license-compliance check: it still does not check NOTICE.

The test installs the `licenses` component of the build tree into a
temporary prefix, which builds nothing, and compares LICENSE and
NOTICE in share/doc/coretrace-compiler with the sources. No install
rule carries them yet: the install succeeds, the files are missing,
and the test is marked as an expected failure until they are.

Refs #249
Apache-2.0 asks redistributions to give recipients a copy of the
License (section 4(a)) and Derivative Works to carry the attribution
notices of NOTICE (section 4(d)). cmake --install now puts both files
in share/doc/coretrace-compiler, in a component of their own, and the
install test no longer expects a failure.

Refs #249
@SizzleUnrlsd SizzleUnrlsd added the bug Something isn't working label Nov 7, 2026
@SizzleUnrlsd SizzleUnrlsd self-assigned this Nov 7, 2026
@SizzleUnrlsd
SizzleUnrlsd marked this pull request as ready for review November 9, 2026 03:32
@SizzleUnrlsd
SizzleUnrlsd merged commit bbc446e into main Nov 9, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant