Skip to content
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

util/timeutil: fix get tz at mojave #7784

Merged
merged 4 commits into from
Sep 27, 2018

Conversation

zhexuany
Copy link
Contributor

What problem does this PR solve?

After upgrading to macOs Mojave, soft link of /etc/localtime had been changed from /var/db/timezone/tz/2018e.1.0/zoneinfo/Asia/Shanghai to /usr/share/zoneinfo.default/Asia/Shanghai. A test case failed and this PR addresses this.

What is changed and how it works?

inferTZNameFromFileName is using zoneinfo to locate the IANA timezone name. This PR addresses that issue by adding one more logic, which is using zoneinfo.default to locate the IANA timezone name first. If nothing can be got, then fall back to using zoneinfo.

Check List

Tests

  • Unit test

Code changes

Side effects

Related changes

@zhexuany zhexuany changed the title util/time: fix get tz at mojave util/timeutil: fix get tz at mojave Sep 26, 2018
@imtbkcat
Copy link

Does it affect macOS High Sierra after this pr merge?

@zhexuany
Copy link
Contributor Author

Nope. Since it falls back to using zoneinfo to extract the IANA timezone name.

Copy link

@imtbkcat imtbkcat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@coocood
Copy link
Member

coocood commented Sep 26, 2018

LGTM

@coocood
Copy link
Member

coocood commented Sep 26, 2018

/run-all-tests

@coocood
Copy link
Member

coocood commented Sep 26, 2018

/run-common-test

@zhexuany zhexuany added status/LGT2 Indicates that a PR has LGTM 2. status/all tests passed labels Sep 26, 2018
Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zz-jason zz-jason merged commit 8917a15 into pingcap:master Sep 27, 2018
@zhexuany zhexuany deleted the fix_get_tz_at_mojave branch September 27, 2018 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/tools status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants