JavaMavenWorkflow sam build fails with `[Errno 20] Not a directory`
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Lĩnh vực
- build-system, cli
Hướng nghiên cứu
Bắt đầu với JavaMavenWorkflow và bước CopySource của nó, sau đó kiểm tra lệnh gọi copytree được hiển thị trong traceback. Tái hiện sam build --debug với CodeUri trỏ đến lambdas/mainlambda/target/lambda.jar và so sánh với lệnh Maven reactor dự kiến. Được xem là hoàn thành khi dự án hiện tại build JAR mà không gặp NotADirectoryError.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Getting an error when running sam build in an existing project of mine,
where the sam template has a CodeUri that points to a JAR file in a reactor build submodule.
Steps to reproduce the issue:
- existing java maven project using reactor builds with
1.1 a shaded jar generated in a maven submodule's target directory
(<project-top-level>/lambdas/mainlambda/target/lambda.jarin my case)
1.2 a template.yaml in the<project-top-level>directory using
CodeUri: lambdas/mainlambda/target/lambda.jar - cd
<project-top-level> sam build --debug
Observed result:
2019-04-28 19:31:55 Collected default values for parameters: {}
2019-04-28 19:31:55 12 resources found in the template
2019-04-28 19:31:55 Found Serverless function with name='LatestFunction' and CodeUri='lambdas/mainlambda/target/lambda.jar'
2019-04-28 19:31:55 Found Serverless function with name='LiveFunction' and CodeUri='lambdas/mainlambda/target/lambda.jar'
2019-04-28 19:31:55 Found Serverless function with name='TestRunnerFunction' and CodeUri='lambdas/testlambda/target/lambda.jar'
2019-04-28 19:31:55 Building resource 'LatestFunction'
2019-04-28 19:31:55 Looking for a supported build workflow in following directories: ['<scrubbed>/GitRepos/someproject/lambdas/mainlambda/target/lambda.jar', '<scrubbed>/GitRepos/someproject']
2019-04-28 19:31:55 Loading workflow module 'aws_lambda_builders.workflows'
2019-04-28 19:31:55 Registering workflow 'PythonPipBuilder' with capability 'Capability(language='python', dependency_manager='pip', application_framework=None)'
2019-04-28 19:31:55 Registering workflow 'NodejsNpmBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm', application_framework=None)'
2019-04-28 19:31:55 Registering workflow 'RubyBundlerBuilder' with capability 'Capability(language='ruby', dependency_manager='bundler', application_framework=None)'
2019-04-28 19:31:55 Registering workflow 'GoDepBuilder' with capability 'Capability(language='go', dependency_manager='dep', application_framework=None)'
2019-04-28 19:31:55 Registering workflow 'GoModulesBuilder' with capability 'Capability(language='go', dependency_manager='modules', application_framework=None)'
2019-04-28 19:31:55 Registering workflow 'JavaGradleWorkflow' with capability 'Capability(language='java', dependency_manager='gradle', application_framework=None)'
2019-04-28 19:31:55 Registering workflow 'JavaMavenWorkflow' with capability 'Capability(language='java', dependency_manager='maven', application_framework=None)'
2019-04-28 19:31:55 Registering workflow 'DotnetCliPackageBuilder' with capability 'Capability(language='dotnet', dependency_manager='cli-package', application_framework=None)'
2019-04-28 19:31:55 Found workflow 'JavaMavenWorkflow' to support capabilities 'Capability(language='java', dependency_manager='maven', application_framework=None)'
2019-04-28 19:31:55 Running workflow 'JavaMavenWorkflow'
2019-04-28 19:31:55 Running JavaMavenWorkflow:CopySource
2019-04-28 19:31:55 JavaMavenWorkflow:CopySource raised unhandled exception
Traceback (most recent call last):
File "<scrubbed>/.virtualenvs/aws/lib/python3.6/site-packages/aws_lambda_builders/workflow.py", line 248, in run
action.execute()
File "<scrubbed>/.virtualenvs/aws/lib/python3.6/site-packages/aws_lambda_builders/actions.py", line 101, in execute
copytree(self.source_dir, self.dest_dir, ignore=shutil.ignore_patterns(*self.excludes))
File "<scrubbed>/.virtualenvs/aws/lib/python3.6/site-packages/aws_lambda_builders/utils.py", line 43, in copytree
names = os.listdir(source)
NotADirectoryError: [Errno 20] Not a directory: '<scrubbed>/GitRepos/someproject/lambdas/mainlambda/target/lambda.jar'
Expected result:
I would expect it to run the equivalent of
(in <project-top-level> folder)
mvn package -Dmaven.test.skip=true -pl lambdas/mainlambda -am
Which is what i run when I want to just build lambda.jar
-pl lambdas/mainlambdabecause that is the module folder of thetargetfolder wherelambda.jaris located.-ambecause otherwise reactor builds will fail-Dmaven.test.skip=truebecause when run from the aws-toolkit, you don't want to rerun the whole test suite (?)
This sam build failure is preventing me from creating launch configurations using aws-toolkit for Intellij.
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
I don't believe my environment makes any difference in this issue, but I'll answer any request for more information if that is deemed necessary
- Ngôn ngữ chính
- Python
- Star
- 381
- Fork
- 162
- Merge trung bình
- 1 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 2
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aws/aws-lambda-builders
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
aws/aws-lambda-builders#925 · 1 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 64/100
aws/aws-lambda-builders#924 · 1 bình luận · 1 reaction ·
-
Bug: PythonUvBuilder fails to build app with dependencies on editable installs in the workspace Đang mởstage/needs-triage
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
aws/aws-lambda-builders#892 ·
-
stage/needs-triage type/feature
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
aws/aws-lambda-builders#839 · 2 bình luận · 1 reaction ·
-
area/build contributors/good-first-issue contributors/welcome type/feature
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
aws/aws-lambda-builders#831 · 3 bình luận ·
Tất cả issue của aws/aws-lambda-builders
Issue tương tự
-
[Bug] reef-hermes tells me to resume with hermes --resume, which does not work from my shell Đang mởarea: harness bug status: needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Human-Agent-Society/reef#625 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
learningequality/kolibri#15351 · 2 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Name consistency Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
eellak/triplestore#65 · 1 bình luận ·