Skip to content

Add an ENVIRONMENT option to add_halide_library - #9545

Open
alexreinking wants to merge 1 commit into
mainfrom
alexreinking/halide-library-environment
Open

alexreinking wants to merge 1 commit into
mainfrom
alexreinking/halide-library-environment

Conversation

@alexreinking

Copy link
Copy Markdown
Member

add_halide_library gains ENVIRONMENT VAR=value..., which sets environment variables for that library's generator invocations only (via cmake -E env). Entries must look like NAME=value.
The motivating use is HL_LLVM_ARGS: LLVM options are process-global, so this is the only way to give one library a flag such as -misched-regpressure=false without applying it to every library in the build.
Because HL_LLVM_ARGS can change codegen, the generator compile cache now includes it in the cache key; previously a cached result could be reused across different HL_LLVM_ARGS.
correctness_generator_cache checks that changing HL_LLVM_ARGS misses the cache (it fails without the key change). The new aot_generator_environment integration test passes an unknown LLVM option through ENVIRONMENT and checks that LLVM rejects it.


Authored by GitHub Copilot

ENVIRONMENT VAR=value... sets environment variables for one library's
generator invocations, e.g. HL_LLVM_ARGS to pass LLVM flags to a single
library. Since HL_LLVM_ARGS can change codegen, the generator compile
cache now includes it in the cache key.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@alexreinking
alexreinking marked this pull request as ready for review October 10, 2026 17:12
@codecov

codecov Bot commented Oct 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 71.13%. Comparing base (ee9f17a) to head (f522dad).

Files with missing lines Patch % Lines
src/Generator.cpp 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9545      +/-   ##
==========================================
+ Coverage   71.05%   71.13%   +0.07%     
==========================================
  Files         262      262              
  Lines       81084    81088       +4     
  Branches    19770    19770              
==========================================
+ Hits        57615    57679      +64     
+ Misses      17502    17480      -22     
+ Partials     5967     5929      -38     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
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.

1 participant