-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
illumos: set default timezone info path #104533
Conversation
This is where these files live on OpenIndiana and SmartOS.
I have confirmed that both Solaris and Illumos used the https://www.illumos.org/man/5/timezone and https://support.oracle.com/knowledge/Sun%20Microsystems/1011541_1.html#aref_section23 So, the change looks good here. I am wondering, would it make sense instead of ifdef that for different system to introduce a fallback path to the time zones folder? I mean let I am suggesting that as I am not sure if we build the browser or WASM for Solaris or Illumos and use the embedded files which can point at wrong path at that time? CC @lewing if he can advise regarding the WASM cases. @am11 do you have any feedback about this PR? |
I wasn't able to run it myself as I'm currently on osx-arm64 (where x64 VMs are quite slow). I trust what @AustinWise has found. However, I would like to test it in Global Zone vs. non- Global Zone. Sometimes these system paths and properties vary in a virtualized zone vs. GZ. (not to be confused with timezones; zones in sunos are like containers in linux and jails in freebsd, virtualized sandbox environment)
Sounds like a good idea. It can probably return two strings for now, something like: - private static string GetTimeZoneDirectory()
+ private static (string knownPath, string fallbackPath) GetTimeZoneDirectory() |
Having a fallback system seems reasonable. I'll set this to a draft for now, and undraft when I have an implementation and testing strategy. |
Thanks for the links. I also found a version of the Solaris documentation that does not require a support subscription: https://docs.oracle.com/cd/E88353_01/html/E37852/timezone-5.html
Looking at Directory.Build.props, it looks only one of Considering the case of running a WASI app on an illumos system, this change should not have a negative effect. See Given all of the above, I'm not sure if change the code to probe multiple directories is worth it. There are already several fallbacks for probing different directories (example). Adding more fallbacks would further complicate the code and testing, for a scenario I'm not sure exists in the wild (non-standard timezone info path). And there is already the Given the above, I'm going to un-draft this with the existing, simple implementation. Please let me know if I overlooked a case where the fallback would be valuable.
For what it's worth, I confirmed the location in the OpenIndiania global zone, the SmartOS global zone, and a Joyent-branded zone on SmartOS. I have not tried other distributions or zone brands. |
@AustinWise thanks for your effort. The current change is ok. I am wondering if there is any other Linux based system using I'll wait for @am11 if he has any more comments and then we can merge the change. |
GZ is not recommended to be used for development purposes and using non-GZ zones is a common practice. In SmartOS, GZ doesn't even persists data and config by default and even if you alter the RO-ness, it has resource limitations. OmniOS made it simpler for the cloud but we are targeting generic SunOS. To get result from a neutral zone, you can create a |
Here are some different configurations to confirm the location of zone info in, with a checkmark indicating whether or not I have tested it:
Are there other distributions or zone brands I should try? |
I think having tested on generic 64-bit base is fine. When linux distros running in a zone, we don't expect dotnet(1) to run cross OS (each OS has a separate ELF binary). Thanks for testing. Looks good to me! ps - if you could keep a zone on OpenIndiana or SmartOS for future testing, that would be great to rule out any doubts. |
I confirmed that this change is compatible with several other illumos distributions and zone brands. I updated the above table with the extra testing.
From what I can gleam from code search, AIX might also use this path. I don't see obvious evidence of a Linux distribution also using this path.
Will do, I'll add an OpenIndiana zone to my primary SmartOS zone testing environment. |
Thanks @AustinWise, this is very helpful! |
Empirically, this is where these files live on OpenIndiana and SmartOS (global zone and Joyent-branded zones). This also the documented location for illumos and Solaris. (Thanks for the pointers to man pages Tarek!)
This makes this test pass:
dotnet xunit.console.dll System.Runtime.Tests.dll -method "Tests.System.TimeProviderTests.TestSystemProviderWithTimeZone"
If you don't have the fix in this PR, you can also make this test pass by setting the
TZDIR
environmental variable to/usr/share/lib/zoneinfo/
.Contributes to #34944