Skip to content

Conversation

@ream88
Copy link
Contributor

@ream88 ream88 commented Nov 5, 2025

The issue was caused by using Application.compile_env/3 and Application.compile_env!/2 in module attributes (@assert_receive_timeout and @refute_receive_timeout). These functions create compile-time dependencies on application configuration, causing Mix to recompile the module every time the parent application compiles.

The fix:

  • Replaced Application.compile_env with Application.get_env, which reads configuration at runtime instead of compile time
  • Converted the module attributes to private functions that are called at runtime
  • Updated all usages to call these functions instead of referencing module attributes

This eliminates the compile-time dependency, so tracee will only be compiled once per version/environment as expected.

Fixes #1

The issue was caused by using Application.compile_env/3 and
Application.compile_env!/2 in module attributes (@assert_receive_timeout
and @refute_receive_timeout). These functions create compile-time
dependencies on application configuration, causing Mix to recompile
the module every time the parent application compiles.

The fix:
- Replaced Application.compile_env with Application.get_env, which
  reads configuration at runtime instead of compile time
- Converted the module attributes to private functions that are called
  at runtime
- Updated all usages to call these functions instead of referencing
  module attributes

This eliminates the compile-time dependency, so tracee will only be
compiled once per version/environment as expected.

Fixes #1
@ream88 ream88 changed the title Implement core tracing functionality for Tracee Fix constant recompilation issue by replacing compile-time config reads Nov 5, 2025
@ream88 ream88 changed the title Fix constant recompilation issue by replacing compile-time config reads Fix constant recompilation issue Nov 5, 2025
@ream88 ream88 merged commit 8e2c9da into main Nov 5, 2025
4 checks passed
@ream88 ream88 deleted the claude/issue-1-fix-011CUpU8v4LXvEoh2i15ijF1 branch November 5, 2025 09:32
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.

Recompiles during every app compilation

3 participants