Uploaded image for project: 'Ivy'
  1. Ivy
  2. IVY-1272

<cachefileset> on an empty configuration produces a very slow-to-evaluate fileset

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.0-RC1
    • Fix Version/s: 2.3.0-RC1
    • Component/s: Core
    • Labels:
      None
    • Environment:

      Ant 1.8.1
      Ivy 2.2.0-rc1

      Description

      If I declare a <cachefileset> for a configuration that is present but empty, I get a fileset that (as expected) matches no files.
      The problem is that when used, that fileset decides to match no files by recursively scanning all files starting from the current working directory (checked via strace and via a JVM thread dump)
      In our case, often the CWD is the top of our build tree, so this takes a very long time to work out that the fileset is in fact empty.

      Specifically, we're doing this (inside a macrodef)

      <ivy:cachefileset setid="@

      {module}.docdeps" conf="doc" type="javadoc.zip"/>
      <unzip dest="${target}/javadoc">
      <patternset>
      <include name="*/package-list"/>
      </patternset>
      <fileset refid="@{module}

      .docdeps"/>
      </unzip>

      and the unzip step takes a very, very, long time to do nothing when the "doc" conf is empty.
      If I replace the use of cachefileset with an explicit fileset that matches nothing, it runs fast as expected.

        Activity

        Hide
        hibou Nicolas Lalevée added a comment -

        There was some code which was building a fileset with a basedir as the current one and excluding every files. This is indeed some useless reading of the filesystem. I replaced it by a java empty iterator.

        Show
        hibou Nicolas Lalevée added a comment - There was some code which was building a fileset with a basedir as the current one and excluding every files. This is indeed some useless reading of the filesystem. I replaced it by a java empty iterator.

          People

          • Assignee:
            hibou Nicolas Lalevée
            Reporter:
            ojowett Oliver Jowett
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development