Merged
Conversation
marcoroth
approved these changes
Feb 3, 2026
| export PATH="$PWD/java/bin:$PATH" | ||
| export PATH="$PWD/rust/bin:$PATH" | ||
|
|
||
| source_env_if_exists .envrc.local |
marcoroth
pushed a commit
that referenced
this pull request
Feb 5, 2026
This PR changes how `clang`, `clang-tidy`, etc., are detected on macOS without requiring any changes for current users. **Rationale:** Not everyone uses Homebrew in this way. I personally only use it for application formulae and kegs, and manage my dev dependencies with Nix flakes (which is also what motivated #1120). **Proposed solution:** Use the Homebrew prefix by default on macOS, as it's a sensible choice. Users who install `clang` and friends some other way can probably figure out how to override the values as required for their environment (either by exporting environment variables or directly in the `make` invocation). **Verification:** I temporarily added the following task to the `Makefile`: ```make debug_cc: @echo "os: $(os)" @echo "cc: $(cc)" @echo "clang_format: $(clang_format)" @echo "clang_tidy: $(clang_tidy)" @echo "test_cflags: $(test_cflags)" @echo "test_ldflags: $(test_ldflags)" ``` I ran this before and after making the changes in this PR, the generated output was identical for the Homebrew use case: ```sh ❯ diff -s cc.old.txt cc.new.txt Files cc.old.txt and cc.new.txt are identical ``` **Notes:** 1. The `debug_cc` target could be generally useful, also for Linux users. If you want, I can add it to either this PR or separately. 2. It's a sort of convention in `Makefile`s to call the variables `CC`, `CFLAGS`, etc. This is primarily because they can be overridden from the environment, and lower-case environment variables look a bit odd. However, I decided not to change this in this PR, as it's not really related to the problem I'm trying to solve here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I think that when including an
.envrcin a repository, it's a good practice to also conditionally source another.envrcfile so users can customize their environment without having to worry about accidentally committing changes. I needed this today so figured I'll open a PR.