[Rock-dev] Amake stuck

Pierre Willenbrock pierre at pirsoft.de
Tue Sep 19 14:07:57 CEST 2017


Hello everyone,
i am not able to reproduce amake being stuck, but i am experiencing
excessive slowness. I traced that down to Rake::FileTask.needed?(to be
more specific: Rake::FileTask.out_of_date?) taking a long time to
recursively check the timestamps of all the prerequisites.

Modifying rake to have Rake::FileTask.out_of_date? like below helps
immensely(collects the touched tasks first, then checks timestamps):

    def out_of_date?(stamp)
      all_prerequisite_tasks.any? { |prereq_task|
        if prereq_task.instance_of?(Rake::FileTask)
          prereq_task.timestamp > stamp || !
File.exist?(prereq_task.name) || @application.options.build_all
        else
          prereq_task.timestamp > stamp
        end
      }
    end

The behaviour has changed between rake-12.0.0 and rake-12.1.0. In
rake-12.0.0, out_of_date? only checked its own timestamp.

Maybe this helps someone.

Regards,
  Pierre


More information about the Rock-dev mailing list