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

don't fail if fuzzOut isn't specified #413

Merged
merged 1 commit into from
Apr 7, 2023
Merged

Conversation

loosebazooka
Copy link
Member

fixes #412

@loosebazooka loosebazooka requested a review from vlsi April 5, 2023 15:15
@@ -13,5 +13,7 @@ dependencies {

tasks.register<Copy>("copyToFuzzOut") {
Copy link
Collaborator

Choose a reason for hiding this comment

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

The task should be Sync rather than Copy to remove stale files if some of the classes are removed from build to build

fuzzing/build.gradle.kts Outdated Show resolved Hide resolved
into(project.property("fuzzOut")).from(sourceSets.main.get().runtimeClasspath)
val defaultDestination = project.layout.buildDirectory.dir("fuzzOut")
val dest = if (project.hasProperty("fuzzOut")) project.property("fuzzOut") ?: defaultDestination else defaultDestination
into(dest).from(sourceSets.main.get().runtimeClasspath)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
into(dest).from(sourceSets.main.get().runtimeClasspath)
into(dest)
from(sourceSets.main.get().runtimeClasspath)

Copy link
Member Author

Choose a reason for hiding this comment

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

is this more idiomatic?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think so
They describe two different things:

  1. where to store the data
  2. which data to pick

For instance, if you would ever add the second from, then into(...).from(..).from(..) would look too long, while the following is fine:

into(...)
from(...)
from(...)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Consider this:

    into(dest)
    into("abcd") {
        from(sourceSets.main.get().runtimeClasspath)
    }

=>

% tree build/fuzzOut
build/fuzzOut
└── abcd
    ├── animal-sniffer-annotations-1.21.jar
    ├── annotations-4.1.1.4.jar
    ├── bcpkix-jdk18on-1.72.jar
    ├── bcprov-jdk18on-1.72.jar

@loosebazooka loosebazooka force-pushed the fix-fuzzing-task-config branch 2 times, most recently from 4b5a721 to 8b9c054 Compare April 5, 2023 15:36
vlsi
vlsi previously approved these changes Apr 5, 2023
@loosebazooka
Copy link
Member Author

hrmm.. I messed something up

@loosebazooka
Copy link
Member Author

loosebazooka commented Apr 5, 2023

ah we can't use Sync because the fuzzer builder is putting other things in the directory before gradle executes
but it's a clean build each time, so this should be a safe operation

@loosebazooka loosebazooka added the safe to test conformance testing label label Apr 5, 2023
@loosebazooka loosebazooka requested a review from vlsi April 5, 2023 16:19
@vlsi
Copy link
Collaborator

vlsi commented Apr 5, 2023

Copying is inherently unsafe (sometime later one might end up with multiple bc-java jars having slightly different versions), so I would prefer:
a) explicitly mention which files should be preserved by sync. See https://github.com/apache/jmeter/blob/50e2015613752fbd0ceedc84440d0bea27848b91/src/dist/build.gradle.kts#L247-L255

or

b) document the reasons for having copy here

Signed-off-by: Appu Goundan <appu@google.com>
@loosebazooka loosebazooka force-pushed the fix-fuzzing-task-config branch from a23b2e3 to 4e2dee7 Compare April 5, 2023 18:35
@loosebazooka
Copy link
Member Author

loosebazooka commented Apr 5, 2023

I mean (a) seems a bit much, we know it's a clean build, so the concerns don't exactly apply. Yes technically that could happen, but it wont. Added in some comments.

@loosebazooka loosebazooka added safe to test conformance testing label and removed safe to test conformance testing label labels Apr 5, 2023
@vlsi vlsi merged commit e85be54 into main Apr 7, 2023
@vlsi vlsi deleted the fix-fuzzing-task-config branch April 7, 2023 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test conformance testing label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build fails with Could not get unknown property 'fuzzOut' for project ':fuzzing
2 participants