Skip to content

all: let interop test use shaded dependency correctly take 2#6792

Merged
dapengzhang0 merged 3 commits intogrpc:masterfrom
dapengzhang0:fix-shadow-dep
Mar 5, 2020
Merged

all: let interop test use shaded dependency correctly take 2#6792
dapengzhang0 merged 3 commits intogrpc:masterfrom
dapengzhang0:fix-shadow-dep

Conversation

@dapengzhang0
Copy link
Copy Markdown
Contributor

@dapengzhang0 dapengzhang0 commented Mar 2, 2020

This include two commits:

@dapengzhang0 dapengzhang0 requested a review from ejona86 March 2, 2020 19:53
// Use grpc-netty-shaded for transitive dependency.
compileOnly project(':grpc-netty')
shadow project(path: ':grpc-netty-shaded', configuration: 'shadow')
shadow configurations.compile.getDependencies()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is doubly suspicious. It is strange to need to copy the dependencies, but wouldn't this also include compile-only dependencies?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

My understanding is:

  • DependencyHandler.project(path : 'grpc-alts', configuration: 'shadow') returns a Dependency that includes the output of :grpc-alts:shadowJar plus all dependencies added (manually) into shadow configuration.

However,

  • The output of :grpc-alts:shadowJar does not depend on anything in the shadow configuration.

  • The output pom.xml of maven publication does not include anything in the shadow configuration unless you modify pom.withXml {} manually.

xds/build.gradle Outdated
// Use grpc-netty-shaded for transitive dependency.
compileOnly project(':grpc-netty')
shadow project(path: ':grpc-netty-shaded', configuration: 'shadow')
shadow configurations.compile.getDependencies()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This brings in library.pgv. It needs to be excluded. (maybe with minus() like used in grpc-all?)

I sort of think excluding may be better than using compileOnly for grpc-netty, since then both 'compile' configuration and 'shadow' configuration are functional outside of this project. It also seems to be a bit less likely to have surprises. But I can accept what's been done here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Copy Markdown
Member

@ejona86 ejona86 left a comment

Choose a reason for hiding this comment

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

Looks good. One comment of something to clean up, but I'm fine if we submit this as-is and do it afterward (and it wouldn't need to be backported)


compileOnly libraries.javax_annotation
compileOnly libraries.javax_annotation,
// At runtime use the epoll included in grpc-netty-shaded
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Technically it would probably be best to do the same minus() thing here, but that can be a follow-up.

@dapengzhang0 dapengzhang0 merged commit 7be75a0 into grpc:master Mar 5, 2020
@dapengzhang0 dapengzhang0 deleted the fix-shadow-dep branch March 5, 2020 01:09
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants