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

“Compress target directories” step fails for Lagom projects. #60

Open
michaelahlers opened this issue Apr 8, 2021 · 3 comments · Fixed by typelevel/sbt-typelevel#63

Comments

@michaelahlers
Copy link

This error occurs:

Run tar cf targets.tar modules/user-service-api/target target target/lagom-dynamic-projects/lagom-internal-meta-project-kafka/target target/lagom-dynamic-projects/lagom-internal-meta-project-service-locator/target target/lagom-dynamic-projects/lagom-internal-meta-project-cassandra/target project/target
8
tar: target/lagom-dynamic-projects/lagom-internal-meta-project-kafka/target: Cannot stat: No such file or directory
9
tar: target/lagom-dynamic-projects/lagom-internal-meta-project-service-locator/target: Cannot stat: No such file or directory
10
tar: target/lagom-dynamic-projects/lagom-internal-meta-project-cassandra/target: Cannot stat: No such file or directory
11
tar: Exiting with failure status due to previous errors
12
Error: Process completed with exit code 2.

The problem is rooted in Lagom adding "dynamic" modules to the project which then get added (I think) to internalTargetAggregation. These targets wouldn't be useful for adjacent jobs. On a pristine project—even after test is run—those paths still won't be present. And, of course, they're already considered by virtue of the tar command including target.

My first thought is there's two ways to address this:

  1. Whitelist which modules should be uploaded (given where I'm at on the learning curve with GitHub Actions and this project, not sure if that's sensible).
  2. Make the tar command tolerant of missing directories.
@djspiewak
Copy link
Collaborator

This is a problem that several people have encountered in different contexts! I wonder if we can leverage githubWorkflowArtifactUpload to resolve this? If we set it to false for all of the extra meta projects (the ones which don't have target directories), they'll be skipped during the compression stage.

@joroKr21
Copy link
Contributor

Or just modify the script to skip empty directories

@mdedetrich
Copy link
Contributor

Just making a note that #66 (comment) has been confirmed to be a working solution for the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants