JavaGradleWorkflow includes extraneous files if other archive artifacts are defined
メンテナーはふだん 10 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 38/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- java
- 領域
- build-system
調査の方向性
aws_lambda_builders/workflows/java_gradle/resources/lambda-build-init.gradle から始め、特にアーカイブ成果物の選択と、JavaGradleWorkflow の GradleBuild および CopyArtifacts ステップを確認します。ドキュメントに記載された sam init、application-plugin edit、sam build、find コマンドで再現します。完了条件は、不要なアプリケーションの配布ディレクトリとそのファイルを含めずに、ビルドにアプリケーションのクラスと依存関係の JAR が含まれることです。
索引モデルが issue の本文から書いたものです。
説明
Description:
In certain Gradle projects, running sam build may include files in the bundle that aren't needed.
This occurs because the logic for grabbing the project's jar is actually pulling the contents of all defined archive artifacts, some of which may be for other purposes entirely. In most cases, this doesn't "break" anything, but just increases the size of the deployment bundle silently.
One example of a situation that would cause this is a Java project with the built-in "application" plugin applied, which then produces additional zip and tar distribution artifacts.
One potential fix would be to change https://github.com/awslabs/aws-lambda-builders/blob/develop/aws_lambda_builders/workflows/java_gradle/resources/lambda-build-init.gradle#L27 from def artifactJars = t.project.configurations.archives.artifacts.files.files to def artifactJars = configurations.archives.artifacts.findAll { it.extension == 'jar' }*.file.
Steps to reproduce the issue:
- Run
sam init --runtime java8 --dependency-manager gradle --name gradlebuildtest - Run
cd gradlebuildtest/ - Run
sam build && find .aws-sam/build/HelloWorldFunction -type f(Expected result) - Remove the previous result:
rm -rf .aws-sam/ - Edit
HelloWorldFunction/build.gradleas follows- Add
id 'application'to thepluginsblock - Add
mainClassName = 'helloworld.App'(it's not actually executable yet, but that doesn't matter for demonstrating this behavior)
- Add
- Run
sam build && find .aws-sam/build/HelloWorldFunction -type f(Observed result) - Note that there is now an unnecessary
HelloWorldFunctiondirectory included.
Observed result:
mac-dcarr:gradlebuildtest dcarr$ sam build && find .aws-sam/build/HelloWorldFunction -type f
Building resource 'HelloWorldFunction'
Running JavaGradleWorkflow:GradleBuild
Running JavaGradleWorkflow:CopyArtifacts
Build Succeeded
Built Artifacts : .aws-sam/build
Built Template : .aws-sam/build/template.yaml
Commands you can use next
=========================
[*] Invoke Function: sam local invoke
[*] Package: sam package --s3-bucket <yourbucket>
.aws-sam/build/HelloWorldFunction/helloworld/GatewayResponse.class
.aws-sam/build/HelloWorldFunction/helloworld/App.class
.aws-sam/build/HelloWorldFunction/HelloWorldFunction/bin/HelloWorldFunction
.aws-sam/build/HelloWorldFunction/HelloWorldFunction/bin/HelloWorldFunction.bat
.aws-sam/build/HelloWorldFunction/HelloWorldFunction/lib/aws-lambda-java-core-1.2.0.jar
.aws-sam/build/HelloWorldFunction/HelloWorldFunction/lib/HelloWorldFunction.jar
.aws-sam/build/HelloWorldFunction/META-INF/MANIFEST.MF
.aws-sam/build/HelloWorldFunction/lib/aws-lambda-java-core-1.2.0.jar
mac-dcarr:gradlebuildtest dcarr$
Expected result:
mac-dcarr:gradlebuildtest dcarr$ sam build && find .aws-sam/build/HelloWorldFunction -type f
Building resource 'HelloWorldFunction'
Running JavaGradleWorkflow:GradleBuild
Running JavaGradleWorkflow:CopyArtifacts
Build Succeeded
Built Artifacts : .aws-sam/build
Built Template : .aws-sam/build/template.yaml
Commands you can use next
=========================
[*] Invoke Function: sam local invoke
[*] Package: sam package --s3-bucket <yourbucket>
.aws-sam/build/HelloWorldFunction/helloworld/GatewayResponse.class
.aws-sam/build/HelloWorldFunction/helloworld/App.class
.aws-sam/build/HelloWorldFunction/META-INF/MANIFEST.MF
.aws-sam/build/HelloWorldFunction/lib/aws-lambda-java-core-1.2.0.jar
mac-dcarr:gradlebuildtest dcarr$
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
Scripts were run on Mac OS X 10.14.6; SAM CLI, version 0.23.0.
- 主要言語
- Python
- スター
- 381
- フォーク
- 161
- 平均マージ
- 9日 8時間
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
aws/aws-lambda-builders のほかの issue
-
python_uv: `UvConfig.compile_bytecode` is never passed to uv, so the option has no effect対応中かも @xujiantop-crypto が 27 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
aws/aws-lambda-builders#925 · リアクション 1 件 ·
メンテナーはふだん 10 日以内に返信
-
Bytecode compiled during build is always discarded at runtime: SAM packaging writes 1980 timestamps, so timestamp-based .pyc never validate対応中かも @xujiantop-crypto が 27 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 64/100
aws/aws-lambda-builders#924 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 10 日以内に返信
-
Bug: PythonUvBuilder fails to build app with dependencies on editable installs in the workspace対応中かも @noritada が 96 日前に担当しました。 オープンstage/needs-triage
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
aws/aws-lambda-builders#892 ·
メンテナーはふだん 10 日以内に返信
-
stage/needs-triage type/feature
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
aws/aws-lambda-builders#839 · コメント 2 件 · リアクション 1 件 ·
メンテナーはふだん 10 日以内に返信
-
Feature request: Skip binary validation when builder is not used for any language再び着手できるかも @saketh-bandi が 41 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンarea/build contributors/good-first-issue contributors/welcome type/feature
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
aws/aws-lambda-builders#831 · コメント 3 件 ·
メンテナーはふだん 10 日以内に返信
aws/aws-lambda-builders の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
uniswap-python/uniswap-python#487 ·
-
[Bug]: agent_final_response still returns the abandoned branch's answer after navigate moves HEAD back対応中かも @enyst が今日担当しました。 オープンbug priority:low ready-for-dev
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
OpenHands/software-agent-sdk#5822 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
-
area: server enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
scs0209/laya-guard#52 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 2 日以内に返信