Compare commits

..

5 Commits

Author SHA1 Message Date
0498885f71 Merge pull request #82 from pythonbpf/compilation-context
PythonBPF: Add Compilation Context to allow parallel compilation of multiple jobs
2026-03-29 10:02:10 +02:00
3f4f95115f Core: Pass compilation_context to _prepare_expr_args as it calls eval_expr 2026-03-29 13:28:38 +05:30
f2b9767098 Core: Fix args in helper/printk_formatter 2026-03-29 13:11:44 +05:30
b7f917c3c2 Merge pull request #83 from pythonbpf/dependabot/github_actions/actions-985357984d
build(deps): bump the actions group with 2 updates
2026-03-07 14:11:31 +05:30
b025ae7158 build(deps): bump the actions group with 2 updates
Bumps the actions group with 2 updates: [actions/upload-artifact](https://github.com/actions/upload-artifact) and [actions/download-artifact](https://github.com/actions/download-artifact).


Updates `actions/upload-artifact` from 6 to 7
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v6...v7)

Updates `actions/download-artifact` from 7 to 8
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v7...v8)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/download-artifact
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-02 11:45:33 +00:00
2 changed files with 7 additions and 12 deletions

View File

@ -33,7 +33,7 @@ jobs:
python -m build python -m build
- name: Upload distributions - name: Upload distributions
uses: actions/upload-artifact@v6 uses: actions/upload-artifact@v7
with: with:
name: release-dists name: release-dists
path: dist/ path: dist/
@ -59,7 +59,7 @@ jobs:
steps: steps:
- name: Retrieve release distributions - name: Retrieve release distributions
uses: actions/download-artifact@v7 uses: actions/download-artifact@v8
with: with:
name: release-dists name: release-dists
path: dist/ path: dist/

View File

@ -41,7 +41,7 @@ def handle_fstring_print(
fmt_parts, fmt_parts,
exprs, exprs,
local_sym_tab, local_sym_tab,
compilation_context.struct_sym_tab, compilation_context.structs_sym_tab,
) )
else: else:
raise NotImplementedError(f"Unsupported f-string value type: {type(value)}") raise NotImplementedError(f"Unsupported f-string value type: {type(value)}")
@ -55,12 +55,7 @@ def handle_fstring_print(
for expr in exprs[:3]: for expr in exprs[:3]:
arg_value = _prepare_expr_args( arg_value = _prepare_expr_args(
expr, expr, func, compilation_context, builder, local_sym_tab
func,
compilation_context.module,
builder,
local_sym_tab,
compilation_context.struct_sym_tab,
) )
args.append(arg_value) args.append(arg_value)
@ -216,19 +211,19 @@ def _create_format_string_global(fmt_str, func, module, builder):
return builder.bitcast(fmt_gvar, ir.PointerType()) return builder.bitcast(fmt_gvar, ir.PointerType())
def _prepare_expr_args(expr, func, module, builder, local_sym_tab, struct_sym_tab): def _prepare_expr_args(expr, func, compilation_context, builder, local_sym_tab):
"""Evaluate and prepare an expression to use as an arg for bpf_printk.""" """Evaluate and prepare an expression to use as an arg for bpf_printk."""
# Special case: struct field char array needs pointer to first element # Special case: struct field char array needs pointer to first element
if isinstance(expr, ast.Attribute): if isinstance(expr, ast.Attribute):
char_array_ptr, _ = get_char_array_ptr_and_size( char_array_ptr, _ = get_char_array_ptr_and_size(
expr, builder, local_sym_tab, struct_sym_tab, func expr, builder, local_sym_tab, compilation_context, func
) )
if char_array_ptr: if char_array_ptr:
return char_array_ptr return char_array_ptr
# Regular expression evaluation # Regular expression evaluation
val, _ = eval_expr(func, module, builder, expr, local_sym_tab, None, struct_sym_tab) val, _ = eval_expr(func, compilation_context, builder, expr, local_sym_tab)
if not val: if not val:
logger.warning("Failed to evaluate expression for bpf_printk, defaulting to 0") logger.warning("Failed to evaluate expression for bpf_printk, defaulting to 0")