Hoss Man created LUCENE-7830:
--------------------------------

             Summary: "ant clean-jars" doesn't remove symlinks that point to 
non existent files
                 Key: LUCENE-7830
                 URL: https://issues.apache.org/jira/browse/LUCENE-7830
             Project: Lucene - Core
          Issue Type: Bug
            Reporter: Hoss Man


Discovered this helping ishan troubleshoot weird failures he was getting on his 
machine today.

Steps to reproduce...
{code}
$ touch /tmp/foo.jar
$ touch /tmp/bar.jar
$ ln -s /tmp/foo.jar solr/core/lib/
$ ln -s /tmp/bar.jar solr/core/lib/
$ ls solr/core/lib/

$ ls -l solr/core/lib/

18:10 bar.jar -> /tmp/bar.jar
18:10 foo.jar -> /tmp/foo.jar
$ rm /tmp/bar.jar
$ ant clean-jars
Buildfile: /home/hossman/lucene/dev/build.xml

clean-jars:

BUILD SUCCESSFUL
Total time: 0 seconds
$ ls -l solr/core/lib/
total 0
lrwxrwxrwx 1 hossman hossman 12 May 15 18:10 bar.jar -> /tmp/bar.jar
{code}

The situation that (i speculate) led to ishan's problems was (smething like) ...

# at some point does a build that resolves all jars, ivy creates symlinks to 
it's cache
# at some later point, either the ivy cache (or a subset of jars in it) gets 
blown away (possibly intentionally to save disk space) or the working dir is 
copied from one machine to another
# the version of the dependency gets updated and/or the branch is changed so a 
diff version of some jar is needed - so "ant resolve" & all compilation and 
testing are happy even though there is a symlink to a file that isn't in the 
ivy cache anymore.
# check-licenses will fail however, because when it attempts to resolve the 
list of all jar resources found by ant, the underlying file doesn't actaully 
exist, so the build fails with an error about an "old" jar that you don't 
expect to be used anyway...{code}
// from LicenseCheckTask.java
      if (!r.isExists()) { 
        throw new BuildException("JAR resource does not exist: " + r.getName());
      }
{code}
# {{ant clean-jars}} does nothing to fix the underlying problem



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to