Skip to content

Conversation

@brfrn169
Copy link
Collaborator

Description

I encountered the following error when building the data-loader module locally:

FAILURE: Build failed with an exception.

* What went wrong:
Some problems were found with the configuration of task ':data-loader:cli:shadowJar' (type 'ShadowJar').
  - Gradle detected a problem with the following location: '***'.
    
    Reason: Task ':data-loader:cli:distZip' uses this output of task ':data-loader:cli:shadowJar' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
    
    Possible solutions:
      1. Declare task ':data-loader:cli:shadowJar' as an input of ':data-loader:cli:distZip'.
      2. Declare an explicit dependency on ':data-loader:cli:shadowJar' from ':data-loader:cli:distZip' using Task#dependsOn.
      3. Declare an explicit dependency on ':data-loader:cli:shadowJar' from ':data-loader:cli:distZip' using Task#mustRunAfter.
    
    For more information, please refer to https://docs.gradle.org/8.7/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.
  - Gradle detected a problem with the following location: '***'.
    
    Reason: Task ':data-loader:cli:distTar' uses this output of task ':data-loader:cli:shadowJar' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
    
    Possible solutions:
      1. Declare task ':data-loader:cli:shadowJar' as an input of ':data-loader:cli:distTar'.
      2. Declare an explicit dependency on ':data-loader:cli:shadowJar' from ':data-loader:cli:distTar' using Task#dependsOn.
      3. Declare an explicit dependency on ':data-loader:cli:shadowJar' from ':data-loader:cli:distTar' using Task#mustRunAfter.
    
    For more information, please refer to https://docs.gradle.org/8.7/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.
  - Gradle detected a problem with the following location: '***'.
    
    Reason: Task ':data-loader:cli:startScripts' uses this output of task ':data-loader:cli:shadowJar' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
    
    Possible solutions:
      1. Declare task ':data-loader:cli:shadowJar' as an input of ':data-loader:cli:startScripts'.
      2. Declare an explicit dependency on ':data-loader:cli:shadowJar' from ':data-loader:cli:startScripts' using Task#dependsOn.
      3. Declare an explicit dependency on ':data-loader:cli:shadowJar' from ':data-loader:cli:startScripts' using Task#mustRunAfter.
    
    For more information, please refer to https://docs.gradle.org/8.7/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.

According to the error messages, we need to declare explicit dependencies between the shadowJar task and some other to ensure correct execution order.

This PR fixes the issue in the data-loader module by specifying the necessary task dependencies.

Related issues and/or PRs

N/A

Changes made

Outline the specific changes made in this pull request. Include relevant details, such as added features, bug fixes, code refactoring, or improvements.

Checklist

The following is a best-effort checklist. If any items in this checklist are not applicable to this PR or are dependent on other, unmerged PRs, please still mark the checkboxes after you have read and understood each item.

  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes.
  • I have considered whether similar issues could occur in other products, components, or modules if this PR is for bug fixes.
  • Any remaining open issues linked to this PR are documented and up-to-date (Jira, GitHub, etc.).
  • Tests (unit, integration, etc.) have been added for the changes.
  • My changes generate no new warnings.
  • Any dependent changes in other PRs have been merged and published.

Additional notes (optional)

N/A

Release notes

N/A

This comment was marked as outdated.

@brfrn169 brfrn169 force-pushed the fix-build-error-in-data-loader branch from 12d6af7 to 1a8a8c7 Compare June 12, 2025 02:13
@brfrn169 brfrn169 requested a review from Copilot June 12, 2025 02:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses a build error in the data-loader module by attempting to fix task ordering between shadowJar and its dependent tasks.

  • Adds a mustRunAfter clause to shadowJar for distZip and distTar tasks.
  • Aims to resolve Gradle configuration issues related to task dependencies.


// Build a fat jar
shadowJar {
mustRunAfter distZip, distTar
Copy link

Copilot AI Jun 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'mustRunAfter distZip, distTar' statement forces shadowJar to execute after distZip and distTar, which contradicts the intended dependency flow since these tasks depend on shadowJar's output. Consider instead having distZip, distTar, and startScripts declare an explicit dependency on shadowJar using 'dependsOn' to ensure the correct execution order.

Suggested change
mustRunAfter distZip, distTar

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@ypeckstadt ypeckstadt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you.

@komamitsu
Copy link
Contributor

komamitsu commented Jun 12, 2025

@brfrn169 I tried ./gradlew clean data-loader:cli:shadowJar with the current master (b3ae857), but it finished successfully. Did you use a different Gradle task?

@brfrn169
Copy link
Collaborator Author

I tried ./gradlew clean data-loader:cli:shadowJar with the current master (b3ae857), but it finished successfully. Did you use a different Gradle task?

@komamitsu I ran ./gradlew clean data-loader:cli:build and encountered the error.

@ypeckstadt
Copy link
Contributor

@brfrn169 Thank you for finding this one. This is really something that should not have happened as it's the basic build command.

To avoid issues like this, we will need to add the data loader to the CI workflows. If ok, I will create a PR to add it. Is it best to have a separate workflow file or it can be added to the CI.yaml one?

Copy link
Contributor

@Torch3333 Torch3333 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@brfrn169
Copy link
Collaborator Author

To avoid issues like this, we will need to add the data loader to the CI workflows. If ok, I will create a PR to add it. Is it best to have a separate workflow file or it can be added to the CI.yaml one?

@ypeckstadt You can create a separate workflow file for the data-loader CI.

Copy link
Contributor

@komamitsu komamitsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

Honestly speaking, https://github.com/scalar-labs/scalardb/pull/2757/files#r2141443330 sounds reasonable to me. But, I think there is no dependency between the distribution tasks and the shadow jar task, so explicitly defining the dependency somehow should be a simple solution for the issue.

Copy link
Contributor

@feeblefakie feeblefakie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you!

@brfrn169
Copy link
Collaborator Author

@inv-jishnu Can you please check this PR?

Copy link
Contributor

@inv-jishnu inv-jishnu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Thank you.

@brfrn169 brfrn169 merged commit a1e8b08 into master Jun 16, 2025
55 checks passed
@brfrn169 brfrn169 deleted the fix-build-error-in-data-loader branch June 16, 2025 08:03
feeblefakie pushed a commit that referenced this pull request Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants