sbt / sbt/sbt-github-actions

“Compress target directories” step fails for Lagom projects.

Open
#60 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
199
Forks
67
Avg merge
6h 24m
Merged PRs (30d)
3

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the “Compress target directories” step and the internalTargetAggregation configuration that supplies its tar paths. Reproduce the failure with a pristine Lagom project, then verify the chosen handling of missing dynamic-module targets by rerunning the workflow and confirming it completes without tar errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, scala
Domain
build-system, ci-cd
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.