[GRADLE-3269] Cannot expand archive with read only entries on non clean build Created: 24/Mar/15 Updated: 10/Feb/17 Resolved: 10/Feb/17 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | ||
Reporter: | Gradle Forums | Assignee: | Unassigned |
Resolution: | Won't Fix | Votes: | 5 |
Issue Links: |
|
Description |
If an archive has an entry that is read only, we fail to expand it if has already been expanded. |
Comments |
Comment by Gradle Forums [ 24/Mar/15 ] |
I'm not aware of a limit, and if there is one, it's somewhere in the GB range. There appears to be some other problem with your archive. |
Comment by Gradle Forums [ 24/Mar/15 ] |
I am seeing the same issue with Gradle 2.2.1. println tarTree(configurations.jdk.singleFile).files Results in: FAILURE: Build failed with an exception.
BUILD FAILED Total time: 3.081 secs This is an unaltered copy of the Oracle JDK tarball. I have verified that it is usable from the command line. Something Gradle-related doesn't like it. I could see it being the size (166M) as I've not run into this particular error before with tarballs. In case it comes up, I get the exact same error inside a copy task |
Comment by Gradle Forums [ 24/Mar/15 ] |
Could you please run with `--stacktrace` and provide the stack. Hopefully it contains information on the real error. |
Comment by Gradle Forums [ 24/Mar/15 ] |
Exception is: $ ls -l build/tmp/expandedArchives/jdk-8u40-linux-x64.tar.gz_7rgta7iqynbzorxi3d85umfvr/jdk1.8.0_40/README.html I notice that the file has a mode of 444. Could it just be that under the covers Gradle/Groovy/Java is trying to write to an existing read-only file without deleting it first? Not sure why it would be trying to untar it twice. For additional context, here is the relevant block of the build script up until the failing line: configurations { jdk jce }dependencies.jdk "com.oracle.java.jdk:jdk:${version}:[1]linux-x64@tar.gz" try { configurations.jdk.resolve() }catch (org.gradle.api.artifacts.ResolveException e) { println tarTree(configurations.jdk.singleFile).files |
Comment by Gradle Forums [ 24/Mar/15 ] |
Does this happen on a clean build? |
Comment by Gradle Forums [ 24/Mar/15 ] |
Actually, yes. My thought is that something about that block of code expands the tarball twice. Perhaps tarTree does it once, and then files tries it again? |
Comment by Adam Kaufman [ 25/Mar/15 ] |
Upon closer inspection, this does not happen on a clean build. My confusion arose out of the fact that the build couldn't clean itself because the error was happening during the configuration phase. When I manually removed the build directory, I found that the error goes away for that first build from a "clean" state. That said, I would still consider this a pretty big issue as it makes build scripts that hit it very brittle. Here is a very simple script to reproduce it:
repositories { flatDir { dirs projectDir }}
configurations { jdk }
dependencies.jdk "com.oracle.java.jdk:jdk:8u40:linux-x64@tar.gz"
configurations.jdk.resolve()
def secondTimeDeath = tarTree(configurations.jdk.singleFile).files
This has been tested with Gradle 2.2.1 and 2.3. |
Comment by Harris Bowron [ 14/Oct/16 ] |
Any update? |
Comment by Benjamin Muschko [ 15/Nov/16 ] |
As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub. We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to. Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:
We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle! |
Comment by Benjamin Muschko [ 10/Feb/17 ] |
Thanks again for reporting this issue. We haven't heard back from you after our inquiry from November 15th. We are closing this issue now. Please create an issue on GitHub if you still feel passionate about getting it resolved. |