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

Preliminary build support for macOS on aarch64 (M1) #4119

Merged
merged 2 commits into from
Feb 28, 2022

Conversation

trustin
Copy link
Member

@trustin trustin commented Feb 25, 2022

Motivation:

Our current and future contributors can't build Armeria with their M1 MacBooks.

Modifications:

  • Fixed the test cases that make false assumption that Brotli codec will
    be always available.
  • Fixed FileService so that it works as expected even when Brotli
    codec is not available.
  • Updated NPM to 8.5.2 for docs-client
  • Updated docs-client/package-lock.json
  • Fixed eslint and TypeScript compilation errors
    • Disabled soon-to-be-deprecated eslint rule.
  • Fixed a Kotlin compiler warning in DataClassDocServiceTest
  • Added -Xskip-prerelease-check option to Kotlin compiler to work
    around its complaints about the code compiled with a pre-release compiler.
  • Misc:
    • Increased the timeout for some assertions, clients and services for
      less flakiness.

Result:

  • A contributor can build Armeria on macOS with Apple Silicon (M1).
    • Known issues:
      • :site cannot be built yet. Need to upgrade a lot of
        dependencies to make it happen.
      • Parallel build sometimes results in a build failure related with
        duplicate classes in a JAR.
  • (defect) FileService doesn't choose a .br file for generating
    decompressed content anymore when Brotli is not available.

@trustin trustin added this to the 1.15.0 milestone Feb 25, 2022
@trustin trustin force-pushed the apple_silicon branch 2 times, most recently from 743cbd2 to 82ef016 Compare February 25, 2022 16:16
@codecov
Copy link

codecov bot commented Feb 26, 2022

Codecov Report

Merging #4119 (a877da7) into master (56270e6) will decrease coverage by 0.01%.
The diff coverage is 60.00%.

❗ Current head a877da7 differs from pull request most recent head ffb7de6. Consider uploading reports for the commit ffb7de6 to get more accurate results

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #4119      +/-   ##
============================================
- Coverage     73.22%   73.21%   -0.02%     
+ Complexity    16134    16131       -3     
============================================
  Files          1405     1405              
  Lines         61669    61673       +4     
  Branches       7765     7766       +1     
============================================
- Hits          45155    45151       -4     
- Misses        12583    12590       +7     
- Partials       3931     3932       +1     
Impacted Files Coverage Δ
.../com/linecorp/armeria/server/file/FileService.java 82.11% <60.00%> (-0.61%) ⬇️
...m/linecorp/armeria/client/DecodedHttpResponse.java 80.00% <0.00%> (-5.00%) ⬇️
.../linecorp/armeria/client/Http2ResponseDecoder.java 69.44% <0.00%> (-4.17%) ⬇️
...meria/client/DefaultDnsQueryLifecycleObserver.java 68.11% <0.00%> (-2.90%) ⬇️
...inecorp/armeria/server/file/StreamingHttpFile.java 54.78% <0.00%> (-2.61%) ⬇️
...ia/internal/common/stream/ByteBufDecoderInput.java 84.89% <0.00%> (-2.16%) ⬇️
...corp/armeria/client/RefreshingAddressResolver.java 75.00% <0.00%> (-2.15%) ⬇️
...corp/armeria/common/logging/DefaultRequestLog.java 79.47% <0.00%> (+0.25%) ⬆️
...orp/armeria/common/logging/ExportGroupBuilder.java 77.86% <0.00%> (+0.76%) ⬆️
...p/armeria/internal/common/eureka/InstanceInfo.java 52.63% <0.00%> (+0.87%) ⬆️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5a3057a...ffb7de6. Read the comment docs.

Copy link
Contributor

@ikhoon ikhoon left a comment

Choose a reason for hiding this comment

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

Thanks, @trustin!

build.gradle Outdated
// Suppress the 'Class X is compiled by a pre-release version of Kotlin and
// cannot be loaded by this version of the compiler' error.
tasks.withType(KotlinCompile) { task ->
task.kotlinOptions.freeCompilerArgs += '-Xskip-prerelease-check'
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we move the option to?

def compilerArgs = ["-Xjsr305=strict", "-java-parameters"]

Copy link
Member Author

Choose a reason for hiding this comment

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

We can. Let me send out a PR there and merge it.

Copy link
Member Author

Choose a reason for hiding this comment

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

@trustin trustin force-pushed the apple_silicon branch 2 times, most recently from 28ccddb to a52c7dd Compare February 28, 2022 05:58
Motivation:

Our current and future contributors can't build Armeria with their M1 MacBooks.

Modifications:

- Fixed the test cases that make false assumption that Brotli codec will
  be always available.
- Fixed `FileService` so that it works as expected even when Brotli
  codec is not available.
- Updated NPM to 8.5.2 for `docs-client`
- Updated `docs-client/package-lock.json`
- Fixed eslint and TypeScript compilation errors
  - Disabled soon-to-be-deprecated eslint rule.
- Fixed a Kotlin compiler warning in `DataClassDocServiceTest`
- Added `-Xskip-prerelease-check` option to Kotlin compiler to work
  around its complaints about the code compiled with a pre-release compiler.
- Misc:
  - Increased the amount of time to wait for a future in
    `AbstractTHttp2Client` for less flakiness

Result:

- A contributor can build Armeria on macOS with Apple Silicon (M1).
  - Known issues:
    - `:site` cannot be built yet. Need to upgrade a lot of
      dependencies to make it happen.
    - Parallel build sometimes results in a build failure related with
      duplicate classes in a JAR.
- (defect) `FileService` doesn't choose a `.br` file for generating
  decompressed content anymore when Brotli is not available.

Increase the timeout for `ManagementServiceTest`

ASDF
Copy link
Contributor

@minwoox minwoox left a comment

Choose a reason for hiding this comment

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

Thanks a lot! 👍

@@ -84,7 +85,9 @@ void threadDumpWithJson() throws Exception {

@Test
void heapDump() throws InterruptedException {
final WebClient client = WebClient.of(server.httpUri());
final WebClient client = WebClient.builder(server.httpUri())
.responseTimeout(Duration.ofSeconds(45)) // Heap dump can take time.
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like the request timeout of the server is not increased?

Copy link
Member Author

Choose a reason for hiding this comment

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

Increased to 50 seconds

@trustin trustin merged commit 84cbaf1 into line:master Feb 28, 2022
@trustin trustin deleted the apple_silicon branch February 28, 2022 06:14
wooseongshin added a commit to wooseongshin/armeria that referenced this pull request Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants