Skip to content

Add default GPL license if not specified in the program - #110

Merged
r41k0u merged 3 commits into
masterfrom
fix/default-gpl-license
Oct 8, 2026
Merged

r41k0u merged 3 commits into
masterfrom
fix/default-gpl-license

Conversation

@r41k0u

@r41k0u r41k0u commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

r41k0u and others added 2 commits October 9, 2026 03:01
Without a LICENSE, @llvm.compiler.used still named one, and opt stopped on
"use of undefined value @license". A program with no LICENSE now gets "GPL",
the kernel's own license, and a warning that says so; an explicit LICENSE
is emitted as written.

The old failing license test becomes passing_tests/license_default.py: it
calls print, which lowers to the GPL-only bpf_trace_printk, so the verifier
accepts it only if the default reaches the kernel. license_non_gpl.py is
the counterpart, a verifier-level negative fixture pinned to the kernel's
GPL rejection, and test_license_ir.py checks both license sections and the
warning.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 8, 2026 22:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Remaining user-guide documentation still incorrectly states that an explicit license is required.

1 open finding
What changed in this PR

Adds automatic GPL licensing for programs without an explicit LICENSE.

Changes:

  • Emits a default "GPL" license and warning.
  • Adds IR and verifier coverage.
  • Updates license documentation and fixtures.
File Description
pythonbpf/​license_pass.py Implements default license emission.
tests/​test_license_ir.py Tests explicit and default license IR.
tests/​test_config.toml Configures non-GPL verifier failure.
tests/​passing_tests/​license_default.py Adds default-GPL fixture.
tests/​failing_tests/​license.py Removes obsolete fixture.
tests/​failing_tests/​license_non_gpl.py Adds non-GPL rejection fixture.
docs/​user-guide/​decorators.md Documents default licensing.
docs/​getting-started/​quickstart.md Updates introductory guidance.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +296 to +297
If a program defines no `LICENSE`, PythonBPF uses `"GPL"`, the kernel's own
license, and logs a warning:
The overview example still labelled the LICENSE declaration as required,
which contradicts the GPL default documented in decorators.md and the
quickstart.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@r41k0u
r41k0u merged commit d093516 into master Oct 8, 2026
2 checks passed
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.

2 participants