Skip to content

feat(EnvVar): Environment Variables Store#23710

Closed
markovejnovic wants to merge 1 commit into
mainfrom
user/markovejnovic/cleaner-envvars
Closed

feat(EnvVar): Environment Variables Store#23710
markovejnovic wants to merge 1 commit into
mainfrom
user/markovejnovic/cleaner-envvars

Conversation

@markovejnovic

@markovejnovic markovejnovic commented Oct 15, 2025

Copy link
Copy Markdown
Contributor

What does this PR do?

env_var.zig - Environment Variable Store

This PR adds a new mechanism to keep track of environment variables. Instead of loading them ad-hoc in various places, it uses a memoization strategy that loads the environment variable once, stores it in .data and then loads it as required.

The goal of this PR is to make the tracking and management of environment variables (and feature flags) cleaner and safer

Misc

  • Made all .deinit() operations not take a const *T but now they all take *T on @taylordotfish's request
  • Added POSIX support for uv_os_homedir
  • Fixed a very minor leak and concurrency bug in fs.zig.

Future Improvements

How did you verify your code works?

Hopefully regressions pass. This is a refactor and not much more.

Breaking Changes

  • 💔 BUN_CONFIG_DNS_TIME_TO_LIVE_SECONDS has been changed to no longer accept negative inputs. The legacy behavior would allow you to pass negative numbers which would cause it to mean std.math.maxInt(32).

Loading
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.

5 participants