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

ProtobufExtract task not UP-TO-DATE when it should be #667

Open
scott-pollom opened this issue Jan 20, 2023 · 9 comments
Open

ProtobufExtract task not UP-TO-DATE when it should be #667

scott-pollom opened this issue Jan 20, 2023 · 9 comments

Comments

@scott-pollom
Copy link

ProtobufExtract task is not UP-TO-DATE when irrelevant input directories are added or removed.

See example below from AndroidX build:

task :datastore:datastore-preferences-proto:extractIncludeTestProto not UP-TO-DATE. It was out-of-date because:
[Input property 'inputProtoFiles' file $OUT_DIR/androidx/datastore/datastore-preferences-proto/build/classes/kotlin/main/META-INF has been removed., Input property 'inputProtoFiles' file $OUT_DIR/androidx/datastore/datastore-preferences-proto/build/classes/java/main/androidx has been removed., Input property 'inputProtoFiles' file $OUT_DIR/androidx/datastore/datastore-preferences-proto/build/classes/kotlin/main/androidx has been removed.]

This is surprising because ProtobufExtract.getInputProtoFiles() should only contain proto files.

protobuf-gradle-plugin version: 0.9.0

@rougsig
Copy link
Collaborator

rougsig commented Jan 20, 2023

Hi. Could you please write your androidx.* project dependencies?

@scott-pollom
Copy link
Author

Sorry for ambiguity, I'm building the androidx project itself.

To repro, you can do the following:

  1. run ./gradlew :datastore:datastore-preferences-proto:extractIncludeTestProto --scan
  2. create empty directory $OUT_DIR/androidx/datastore/datastore-preferences-proto/build/classes/kotlin/main/foo
  3. run ./gradlew :datastore:datastore-preferences-proto:extractIncludeTestProto --scan

The build scan from step 3 will show that the task was not UP-TO-DATE because of the empty directory.

@rougsig
Copy link
Collaborator

rougsig commented Jan 20, 2023

This is much better. Is this reproducible on the androidx-main branch?

@scott-pollom
Copy link
Author

yes

@rougsig
Copy link
Collaborator

rougsig commented Jan 20, 2023

@scott-pollock great, thanks. Will investigate on this weekend.

@scott-pollom
Copy link
Author

Thanks!

copybara-service bot pushed a commit to androidx/androidx that referenced this issue Jan 21, 2023
A bug in the protobuf-gradle-plugin is causing
:datastore:datastore-preferences-proto:extractIncludeTestProto to be not
UP-TO-DATE when it should be.

See google/protobuf-gradle-plugin#667

Bug: NA
Test: existing
Change-Id: If2d89dc9e38bb879338f01b79909ea764bb391ce
@rougsig
Copy link
Collaborator

rougsig commented Jan 21, 2023

This is the expected behavior at the moment. Bad behavior, but true. Will be fixed in the future, somewhere in version 0.10.*.

Extract include tasks for test sources depends on the main classpath that is passed as input to the task.

copybara-service bot pushed a commit to androidx/androidx that referenced this issue Jan 23, 2023
This is a follow-up to If2d89dc9e38bb879338f01b79909ea764bb391ce.

A bug in the protobuf-gradle-plugin is causing the
extractIncludeTestProto tasks to be not UP-TO-DATE when they should be.

See google/protobuf-gradle-plugin#667

Bug: NA
Test: existing
Change-Id: I77dfe1a5b716a573120c7fe7253bb1375a5a60cd
@liutikas
Copy link

liutikas commented Mar 2, 2023

Any updates on the fixes?

@liutikas
Copy link

Are we still planning to fix this?

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

No branches or pull requests

3 participants