aws / aws-toolkit-jetbrains

AWS Toolkit for JetBrains - a plugin for interacting with AWS from JetBrains IDEs
https://plugins.jetbrains.com/plugin/11349-aws-toolkit
Apache License 2.0
754 stars 221 forks source link

How to build this plugin in linux without dotnet #2088

Closed zxkane closed 2 years ago

zxkane commented 4 years ago

Your Environment

Question

There was a switch skipRider to build plugin in linux without dotnet/rider env, but the switch was removed in recent changes for adopting to gradle kotlin script. Is there any way to build/test this plugin to exclude rider support?

abrooksv commented 4 years ago

If you want just community features, run ./gradlew :jetbrains-core:buildPlugin If you want ultimate features as well, run ./gradlew :jetbrains-ultimate:buildPlugin

You can then grab the built plugin from <subProject>/build/distributions/aws-jetbrains-toolkit-<version>.zip i.e. jetbrains-core/build/distributions/aws-jetbrains-toolkit-1.19-SNAPSHOT-193.zip

To change the version, you can edit the gradle.properties to match your target ide (2019.3 2020.1 2020.2), or use the env var ALTERNATIVE_IDE_PROFILE_NAME=2020.1 (i.e. ALTERNATIVE_IDE_PROFILE_NAME=2020.1 ./gradlew :jetbrains-ultimate:buildPlugin)

Let me know if these do not work for you

zxkane commented 4 years ago

Yes, ./gradlew :jetbrains-core:buildPlugin works. But it looks like it only build without testing. Is there any way to run test of community features as well?

Actually I used CodeBuild(standard:4.0) to do a full build via spec buildspec/linuxTests.yml, it failed on building rider plugin. Looks like the full build does not work on standard codebuild built-in image.

abrooksv commented 4 years ago

:jetbrains-core:check will run the tests,

linting is ./gradlew :ktlint

Not sure why it would fail, we also use standard:4.0

zxkane commented 4 years ago

If using codebuild spec buildspec/linuxTests.yml, the rider test case always failed.

image

I’m setting up the codebuild project like below,

https://github.com/aws-samples/aws-codecommit-devops-model/blob/d228893115a1f3106b3978707e283840955b15b1/lib/codecommit-devops-model-stack.ts#L97-L116

abrooksv commented 4 years ago

Ya, we see that every now and then. The settings look the same as ours. Usually there is a better message in the rider logs, that the build spec puts into the artifacts zip.

zxkane commented 4 years ago

There was no artifact collected due to the failure of unit test.


[Container] 2020/09/26 07:54:36 Command did not exit successfully ./gradlew check coverageReport --info --full-stacktrace --console plain exit status 1
--
970 | [Container] 2020/09/26 07:54:36 Phase complete: BUILD State: FAILED
971 | [Container] 2020/09/26 07:54:36 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: ./gradlew check coverageReport --info --full-stacktrace --console plain. Reason: exit status 1
972 | [Container] 2020/09/26 07:54:36 Entering phase POST_BUILD
973 | [Container] 2020/09/26 07:54:36 Running command BUILD_ARTIFACTS="/tmp/buildArtifacts"
974 |  
975 | [Container] 2020/09/26 07:54:36 Running command TEST_ARTIFACTS="/tmp/testArtifacts"
976 |  
977 | [Container] 2020/09/26 07:54:36 Running command mkdir -p $TEST_ARTIFACTS/test-reports
978 |  
979 | [Container] 2020/09/26 07:54:36 Running command mkdir -p $BUILD_ARTIFACTS
980 |  
981 | [Container] 2020/09/26 07:54:36 Running command rsync -rmq --include='*/' --include '**/build/idea-sandbox/system*/log/**' --exclude='*' . $TEST_ARTIFACTS/ \|\| true
982 |  
983 | [Container] 2020/09/26 07:54:37 Running command rsync -rmq --include='*/' --include '**/build/reports/**' --exclude='*' . $TEST_ARTIFACTS/ \|\| true
984 |  
985 | [Container] 2020/09/26 07:54:37 Running command rsync -rmq --include='*/' --include '**/test-results/**/*.xml' --exclude='*' . $TEST_ARTIFACTS/test-reports \|\| true
986 |  
987 | [Container] 2020/09/26 07:54:37 Running command cp -r ./build/distributions/*.zip $BUILD_ARTIFACTS/ \|\| true
988 | cp: cannot stat './build/distributions/*.zip': No such file or directory
989 |  
990 | [Container] 2020/09/26 07:54:37 Phase complete: POST_BUILD State: SUCCEEDED
abrooksv commented 4 years ago

The build spec produces 2 artifacts:

  1. The test artifacts zip (primary artifact). You would look for the jetbrains-rider folder in the Zip
  2. The plugin.zip

The first one will always be there, second will only be there if the build passes

zxkane commented 4 years ago

I see main thread unresponsive and NuGet operation cancelled in logs, but I can not find what caused it.

06:34:48.176 |W| RiderPrimaryThreadWatchdog    | MainGuardAvailabilityWatchdog:31 | Primary thread didn't responded for 0.947sec (CurrentTask: 'PriorityRdDispatcher') QueueSize=9
06:34:48.127 |E| NuGetOperator                 | NuGetThread:52     | The operation was canceled.

The complete rider logs, jetbrains-rider.zip

rli commented 2 years ago

Closing due to age. Timeout issues mentioned fixed by setting timeout in #3174