`gradle` compiler erased files/folders under my home directory

I cloned gradle from https://github.com/gradle/gradle and worked on building it on linux x86_64 (Fedora 37). I did not modify any of the configuration files. As gradle finished building, it erased/deleted - seemingly on cleanup - files and folders I had under $HOME. I looked under $HOME/.gradle/caches, /tmp, Trash, but could not find any of the erased files/folders. I read about the gradle directories at https://docs.gradle.org/current/userguide/directory_layout.html and could understand that cleanup is done automatically on cleanup. Is there a way to recover the BuildDirectory and how? I assume that this BuildDirectory- if recovered - will have the files/folders I lost. Thanks in advance.

I do not expect any package or compiler to erase/delete material - especially system files and folders - that does not belong to the package itself. I also expect the compiler to ask and let the user decide and further emit a warning message before it erases any files or folders. The issue becomes more serious when such files and folders are system ones. The development team is kindly asked to look into this issue and put in place warnings and a security check that prevents gradle from erasing/deleting system files and folders as well as owner files and folders that do not belong to gradle itself.

I highly doubt it did, to be honest.
I’ve never seen the Gradle build to erase anything on my disk outside its project directory.
But if you are sure about that, you should probably open a bug report / improvement request on the Gradle issue tracker instead of a post in the community forum.
It is unlikely something will change just by complaining here. :slight_smile:

1 Like

It did. I compiled under $HOME as I wanted the package to install under $HOME/.gradle. System files and folders and my personal files and folders under $HOME were all erased by the compiler.

I don’t really understand what you mean with “compiled under $HOME”.

If you checked out the Gradle repository at $HOME so that you have $HOME/settings.gradle.kts, $HOME/version.txt, and so on, then you made your whole $HOME directory the project directory of the Gradle build and I wouldn’t wonder if that breaks things. But you surely didn’t mean that, as it sounds pretty strange.

If you want it installed under $HOME/.gradle, which does not sound like the best idea either, you would just set the according Gradle property (gradle_installPath) to the according directory as documented in CONTRIBUTING.md.

1 Like

Can the erased files be recovered? Can make install be reversed with make uninstall?

Gradle build does not use makefiles.
If you meant ./gradlew uninstall, no.
Even if that would exist, it could not magically undelete files.
For undeleting deleted files, you need to have a backup of these files.

1 Like

Thanks. But gradlew install wiped out files. Where do such files go?

The way of all mortal I guess

For the benefit of others, here is the link to the issue lodged at github:

At https://github.com/gradle/gradle/pull/24376 one can see that the latest build will - on installation - prevent gradle from deleting an existing directory. Messages will be generated to help the user.

1 Like