We're having an issue with deleted files after the build with sbt-avrohugger.
It seems, after the build some directories get deleted that shouldn't.
From what I could understand, the original path before a49e5f6 was relative (target).
Now in our build, we pass this directory absolute, eg. (/path/to/build).
The issue we encountered was the following:
The method deleteTemps deletes all files in the penultimate file of this path (in above example /path/to), that have no children - this seems to apply to all files as well as empty directories
Description of changes
I've taken the following actions, to avoid this in the future:
Create a temporary directory, which contains the generated files
Write the generated files to this directory
Delete all the contents of this directory afterwards
In my case I downgraded to 2.0.0-RC15, which didn't have this issue yet it seems.
Final note
I would urge users not to use the versions from 2.0.0-RC16 up to 2.0.0-RC24, because they can actually damage your system (if the permissions allow it).
For example, if I were to set -Djava.io.tmpdir=/home/myuser/.java_tmp it could wipe out my home directory.
Problem Description
We're having an issue with deleted files after the build with
sbt-avrohugger
. It seems, after the build some directories get deleted that shouldn't.From what I could understand, the original path before a49e5f6 was relative (
target
). Now in our build, we pass this directory absolute, eg. (/path/to/build
).The issue we encountered was the following: The method
deleteTemps
deletes all files in the penultimate file of this path (in above example/path/to
), that have no children - this seems to apply to all files as well as empty directoriesDescription of changes
I've taken the following actions, to avoid this in the future:
Steps to reproduce this issue:
1. Create the temporary directory structure
2. Run the build (for example with sbt-avrohugger 2.0.0-RC24)
SBT_OPTS="-Djava.io.tmpdir=/tmp/poc/java_tmp" sbt clean compile
3. Verify the outcome
Note that
foo
,bar
andbaz
have been deleted.Workaround
In my case I downgraded to
2.0.0-RC15
, which didn't have this issue yet it seems.Final note
I would urge users not to use the versions from
2.0.0-RC16
up to2.0.0-RC24
, because they can actually damage your system (if the permissions allow it). For example, if I were to set-Djava.io.tmpdir=/home/myuser/.java_tmp
it could wipe out my home directory.Just a heads up!