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

Prefer project modules on dependency resolution per default #2056

Merged
merged 2 commits into from
Jan 24, 2022

Conversation

fawind
Copy link
Contributor

@fawind fawind commented Jan 24, 2022

Before this PR

Every so often we run into support issues due to Gradle's version ordering semantics not being strictly compliant with our sls-version ordering.

E.g. based on the sls-spec, 1.264.0 < 1.264.0-90-g2f01179 holds true but according to Gradle's version ordering, the opposite is true, 1.264.0-90-g2f01179 < 1.264.0.

Using its default resolution strategy, Gradle will try to substitute artifacts of local projects. However this can fail when the version ordering does not align because according to Gradle's version ordering, the module is relying on a version from the future.

As a result, Gradle fails on dependency resolution which errors such as:

A problem occurred configuring root project 'my-project'.
> Could not compute lock state from configuration 'unifiedClasspath' due to unresolved dependencies:
   * project :my-sub-proj (requested: 'project :my-sub-proj' because: requested)
        Failures:
           - Could not resolve project :my-sub-proj.
           - Unable to find a variant of com.palantir.my-sub-proj:1.264.0 providing the requested capability gcv:path=:my-sub-proj scope=PRODUCTION:0:
     - Variant compile provides com.palantir:my-sub-proj:1.264.0
     - Variant runtime provides com.palantir:my-sub-proj:1.264.0
     [...]

After this PR

Prefer project modules that are part of this build over external modules on dependency resolution per default (docs).

This avoids the above conflict by always choosing the local project module on conflict.

==COMMIT_MSG==
Prefer project modules on dependency resolution per default
==COMMIT_MSG==

Possible downsides?

@changelog-app
Copy link

changelog-app bot commented Jan 24, 2022

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Prefer project modules on dependency resolution per default

Check the box to generate changelog(s)

  • Generate changelog entry

@policy-bot policy-bot bot requested a review from jkozlowski January 24, 2022 13:27
@fawind fawind requested review from CRogers and removed request for jkozlowski January 24, 2022 13:27
@bulldozer-bot bulldozer-bot bot merged commit 96e972f into develop Jan 24, 2022
@bulldozer-bot bulldozer-bot bot deleted the fw/prefer-project-modules-plugin branch January 24, 2022 14:15
@svc-autorelease
Copy link
Collaborator

Released 4.63.0

bulldozer-bot bot pushed a commit to palantir/witchcraft-api that referenced this pull request Jan 24, 2022
###### _excavator_ is a bot for automating changes across repositories.

Changes produced by the roomba/latest-baseline-oss check.

# Release Notes
## 4.63.0
| Type | Description | Link |
| ---- | ----------- | ---- |
| Improvement | Prefer project modules on dependency resolution per default | palantir/gradle-baseline#2056 |


## 4.64.0
| Type | Description | Link |
| ---- | ----------- | ---- |
| Improvement | Use lazy task initialization for the `compileRefaster` task for improved performance when it is not needed. | palantir/gradle-baseline#2052 |



To enable or disable this check, please contact the maintainers of Excavator.
This was referenced Jan 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants