Repository navigation
[fuchsia] Export ICU_TIMEZONE_FILES_DIR only when tzdata directory is valid - #194242
Draft
zijiehe-google-com wants to merge 2 commits into
Draft
zijiehe-google-com wants to merge 2 commits into
zijiehe-google-com wants to merge 2 commits into
Conversation
…cu/44/le Updates kICUTZDataDir from /config/data/tzdata/icu/44/le to /config/tzdata/icu/44/le to match the tzdata-icu directory capability mounted in common.shard.cml and the Dart VM's Fuchsia OS layer.
… valid Previously, InitializeTZData() called setenv(ICU_TIMEZONE_FILES_DIR, ..., 0) before checking openat(), leaving an invalid path in the process environment when tzdata could not be opened. Check getenv() first to preserve the ability of tests to override the timezone directory, and only call setenv() after openat() succeeds.
Hzj-jie
force-pushed
the
fuchsia-tzdata-env
branch
from
October 12, 2026 19:48
9e7dbc9 to
7e45c44
Compare
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.
In
flutter_runner,InitializeTZData()previously setICU_TIMEZONE_FILES_DIRviasetenv(..., 0)before attemptingopenat().When
openat()failed (e.g. running in test environments or systems without timezone files),InitializeTZData()logged an error and returnedfalse, but leftICU_TIMEZONE_FILES_DIRpointing to a non-existent path in the environment. This prematurely polluted the process environment and prevented downstream initializers (such as Dart VM'sInitializeTZData(), which also callssetenv(..., 0)) from setting a valid path.This change:
getenv(kICUTZEnv)first to preserve the ability of unit tests (e.g.RunnerTZDataTest.LoadsWithTZDataPresent) to override the directory.ICU_TIMEZONE_FILES_DIRviasetenv()afteropenat()succeeds, matching the pattern in Dart VM'sruntime/vm/os_fuchsia.cc.Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.