-
Notifications
You must be signed in to change notification settings - Fork 867
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
update re2 build for arm under node 14 #1454
Conversation
According to the feedbacks, I will add a unit test here. It will cover two things: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the tests Anan! I just have a couple minor suggestions.
jest.clearAllMocks(); | ||
}); | ||
|
||
it('patch_native_modules task downloads the correct package', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: patch_native_modules
is inferred because of the file name. You could also be specific about what correct
means here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I change patch_native_modules task
to patch native modules task
. Seems its name already explain what it is doing. Then I specify correct to correct platform
to show platform is the concern.
|
||
const build = new Build(config); | ||
|
||
download.mockImplementation(() => {}); | ||
|
||
untar.mockImplementation(() => {}); | ||
|
||
gunzip.mockImplementation(() => {}); | ||
|
||
return { config, build }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very minor: can we remove the extra whitespace here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed line 47 and 49
We build and restore re2 for arm. With a license built in, we zip the build artifact as .tar.gz. The original patchModule method has a default extract method and path which causes issues for extracting and using re2 arm build artifact. Therefore, we modify the method in this PR by passing an overriddenExtractMethod and an overriddenDestinationPath. Commit-2: add a unit test for PatchNativeModules Commit-3: polish the code and delete whitespaces Issue Resolved: opensearch-project#1436 Signed-off-by: Anan Zhuang <ananzh@amazon.com>
This is a backport for the fix we made on 2.0. Please check the Backport PR for more details. The difference between this version and 2.0 is node bump. From originial PR: We build and restore re2 for arm. With a license built in, we zip the build artifact as .tar.gz. The original patchModule method has a default extract method and path which causes issues for extracting and using re2 arm build artifact. Therefore, we modify the method in this PR by passing an overriddenExtractMethod and an overriddenDestinationPath. Backport PR: opensearch-project#1454 Issue Resolved: opensearch-project#1436 Signed-off-by: Anan Zhuang <ananzh@amazon.com>
This is a backport for the fix we made on 2.0. Please check the Backport PR for more details. The difference between this version and 2.0 is node bump. From originial PR: We build and restore re2 for arm. With a license built in, we zip the build artifact as .tar.gz. The original patchModule method has a default extract method and path which causes issues for extracting and using re2 arm build artifact. Therefore, we modify the method in this PR by passing an overriddenExtractMethod and an overriddenDestinationPath. Backport PR: opensearch-project#1454 Issue Resolved: opensearch-project#1436 Signed-off-by: Anan Zhuang <ananzh@amazon.com>
This is a backport for the fix we made on 2.0. Please check the Backport PR for more details. The difference between this version and 2.0 is node bump. From originial PR: We build and restore re2 for arm. With a license built in, we zip the build artifact as .tar.gz. The original patchModule method has a default extract method and path which causes issues for extracting and using re2 arm build artifact. Therefore, we modify the method in this PR by passing an overriddenExtractMethod and an overriddenDestinationPath. Backport PR: #1454 Issue Resolved: #1436 Signed-off-by: Anan Zhuang <ananzh@amazon.com>
This is a backport for the fix we made on 2.0. Please check the Backport PR for more details. The difference between this version and 2.0 is node bump. From originial PR: We build and restore re2 for arm. With a license built in, we zip the build artifact as .tar.gz. The original patchModule method has a default extract method and path which causes issues for extracting and using re2 arm build artifact. Therefore, we modify the method in this PR by passing an overriddenExtractMethod and an overriddenDestinationPath. Backport PR: #1454 Issue Resolved: #1436 Signed-off-by: Anan Zhuang <ananzh@amazon.com> (cherry picked from commit d0f368a)
This is a backport for the fix we made on 2.0. Please check the Backport PR for more details. The difference between this version and 2.0 is node bump. From originial PR: We build and restore re2 for arm. With a license built in, we zip the build artifact as .tar.gz. The original patchModule method has a default extract method and path which causes issues for extracting and using re2 arm build artifact. Therefore, we modify the method in this PR by passing an overriddenExtractMethod and an overriddenDestinationPath. Backport PR: #1454 Issue Resolved: #1436 Signed-off-by: Anan Zhuang <ananzh@amazon.com> (cherry picked from commit d0f368a)
Description
We build and restore re2 for arm. With a license built in,
we zip the build artifact as .tar.gz. The original patchModule
method has a default extract method and path which causes issues
for extracting and using re2 arm build artifact. Therefore, we
modify the method in this PR by passing an overriddenExtractMethod
and an overriddenDestinationPath.
Issues Resolved
#1436
Check List
yarn test:jest
yarn test:jest_integration
yarn test:ftr