Rake executes file task when prerequisites have older timestamp
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- ruby
- Domain
- build-system
Research direction
Reproduce the issue with the Rakefile example and compare the --trace output between the affected behavior and 12.0. Start by tracing how file-task prerequisites and timestamps are evaluated; done means rake component no longer executes the file task when its immediate prerequisite files are older.
Written by the indexing model from the issue text.
Description
When a file task depends on some non-file task indirectly,
Rake executes the file task even if its immediate prerequisite files have older timestamp.
It looks like the behavior changed at 12.1.0.
Example
require "rake/clean"
CLEAN.include("config.yml", "component")
task "setup" do
puts Rake::VERSION
touch "config.yml" unless File.exist?("config.yml")
end
file "config.yml" => "setup"
file "component" => "config.yml" do |t|
puts "[config.yml] #{File.mtime(t.prerequisites[0])}"
puts "[component] #{File.exist?(t.name) && File.mtime(t.name)}"
sleep 1
touch t.name
end
Based on the above Rakefile, clean up and create the "component" first.
$ rake clean && rake component
The next rake component results in different behavior as follows.
On 12.0.0:
$ rake component --trace
(in /path/to/Rakefile-directory)
** Invoke component (first_time, not_needed)
** Invoke config.yml (first_time)
** Invoke setup (first_time)
** Execute setup
12.0.0
** Execute config.yml
On 12.1.0:
$ rake component --trace
(in /path/to/Rakefile-directory)
** Invoke component (first_time)
** Invoke config.yml (first_time)
** Invoke setup (first_time)
** Execute setup
12.1.0
** Execute config.yml
** Execute component
[config.yml] 2018-01-01 15:13:19 +0900
[component] 2018-01-01 15:13:20 +0900
touch component
- Dominant language
- Ruby
- Stars
- 2.5k
- Forks
- 649
- Avg merge
- 4m
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ruby/rake
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
rake -P output is ambiguous with prereq namespacesPossibly taken @leoarnold claimed this 110 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Difficulty 5/5 Over a week Newbie friendliness 28/100
-
FileList#<< bypasses exclusions while FileList#include respects themPossibly taken @hsbt claimed this 124 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 45/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
cline/mcp-marketplace#3886 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
jetrockets/recorder#61 ·
-
PROJECT: website-redesign
Difficulty 1/5 Under an hour Newbie friendliness 72/100
thewca/worldcubeassociation.org#16617 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day