On Fri, Jul 18, 2014 at 11:49 AM, KARR, DAVID <dk0...@att.com> wrote:
> *From:* Daz DeBoer [mailto:darrell.deb...@gradleware.com] > *Sent:* Friday, July 18, 2014 10:41 AM > > *To:* dev@gradle.codehaus.org > *Subject:* Re: [gradle-dev] Confused by part of userguide build process > > > > > > On Fri, Jul 18, 2014 at 10:28 AM, KARR, DAVID <dk0...@att.com> wrote: > > > I’m seeing a new failure symptom this morning. This is what I’m running: > > gradle :integTest:integTest --tests > org.gradle.integtests.samples.UserGuideSamplesIntegrationTest –info > > This is failing with: > > org.gradle.integtests.samples.UserGuideSamplesIntegrationTest > > initializationError FAILED > > java.lang.AssertionError: Couldn't find any samples. Most likely, > samples.xml was not generated. > > Please run 'gradle docs:userguideDocbook' first. Expression: > assertion. Values: assertion = false > > I’ve tried running both “gradle docs:userguide” and “gradle > docs:userguideDocbook” before this, but it makes no difference. I even > tried the latter with “—rerun-tasks”. I also looked for a “samples.xml” > and found this: > > % ls -lt ./subprojects/docs/build/src/samples.xml > > -rwxr-xr-x+ 1 dk068x Domain Users 68 Jul 18 07:32 > ./subprojects/docs/build/src/samples.xml* > > > > However, this file is essentially empty: > > <?xml version="1.0" encoding="UTF-8" standalone="no"?> > > <samples/> > > At this point, I did a “gradle clean” and then verified that the > “samples.xml” file was gone. I then reran “docs:userguide” and then > inspected the resulting “samples.xml” file. It was over 60k bytes, but I > didn’t inspect the file. I then reran my integTest run. It failed in the > same way. I then reinspected the “samples.xml” file, and it appears that > the integTest run actually changed that file back to the almost empty > version. > > > I seem to recall hitting something similar at one stage, but I didn't > investigate further. IIRC there was a bug in our build logic that meant the > order that tasks were run in was important. > > > > Following your lead, I can confirm this is an issue. To reproduce run: > > ./gradlew clean > > ./gradlew :docs:userguide > ./gradlew :integTest:integTest --tests > org.gradle.integtests.samples.UserGuideSamplesIntegrationTest > > > > It seems like something is clearing the samples.xml file early in the > integTest run, but the :docs:userguideDocbook task is considered UP-TO-DATE > so it doesn't regenerate it.If you wanted to dig deeper to see exactly > which tasks are causing this problem, it would be most appreciated. Even to > just know the minimal set of tasks that trigger this condition would help. > > > > Ok. I would assume that adding “—debug” to that last command will be a > good starting point. I don’t know how many times I’ve wished I could set a > breakpoint on file i/o for a particular file. > Possibly. I sat there 'cat'ing the samples.xml file, and it looked like it was :docs:userguideFragmentSrc or :docs:distDocs that was doing the purging. Just getting a minimal reproducible example would be useful. -- Darrell (Daz) DeBoer http://www.gradleware.com