ruby / ruby/rake

Shared multitask prerequisite intermittently executed multiple times

Aperta
#274 1 commento 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Ruby
Stelle
2.5k
Fork
650
Merge medio
6m
PR unite (30g)
3

Descrizione

Given a Rakefile

multitask :default => [:a, :b, :c, :d, :e]

task :a => ['target']
task :b => ['target']
task :c => ['target']
task :d => ['target']
task :e => ['target']

rule(/^target$/ => [ 'source' ]) do |t|
    p "#{t.name} => #{t.source}"
    p t.actions
end

file 'source'

the target may get executed multiple times like this

$ ruby --version
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-musl]
$ rake --version
rake, version 12.3.1
$ rake --trace --rules
** Invoke default (first_time)
** Invoke a (first_time)
Attempting Rule target => source
** Invoke b (first_time)
Attempting Rule target => source
** Invoke c (first_time)
Attempting Rule target => source
** Invoke d (first_time)
Attempting Rule target => source
(target => source ... EXIST)
** Invoke e (first_time)
Attempting Rule target => source
(target => source ... EXIST)
(target => source ... EXIST)
** Invoke target (first_time)
(target => source ... EXIST)
** Invoke source (first_time)
(target => source ... EXIST)
** Execute source
** Execute target
"target => source"
[#<Proc:0x000055e092b971c0@/repo/Rakefile:10>, #<Proc:0x000055e092b971c0@/repo/Rakefile:10>, #<Proc:0x000055e092b971c0@/repo/Rakefile:10>, #<Proc:0x000055e092b971c0@/repo/Rakefile:10>, #<Proc:0x000055e092b971c0@/repo/Rakefile:10>]
"target => source"
[#<Proc:0x000055e092b971c0@/repo/Rakefile:10>, #<Proc:0x000055e092b971c0@/repo/Rakefile:10>, #<Proc:0x000055e092b971c0@/repo/Rakefile:10>, #<Proc:0x000055e092b971c0@/repo/Rakefile:10>, #<Proc:0x000055e092b971c0@/repo/Rakefile:10>]
"target => source"
[#<Proc:0x000055e092b971c0@/repo/Rakefile:10>, #<Proc:0x000055e092b971c0@/repo/Rakefile:10>, #<Proc:0x000055e092b971c0@/repo/Rakefile:10>, #<Proc:0x000055e092b971c0@/repo/Rakefile:10>, #<Proc:0x000055e092b971c0@/repo/Rakefile:10>]
"target => source"
[#<Proc:0x000055e092b971c0@/repo/Rakefile:10>, #<Proc:0x000055e092b971c0@/repo/Rakefile:10>, #<Proc:0x000055e092b971c0@/repo/Rakefile:10>, #<Proc:0x000055e092b971c0@/repo/Rakefile:10>, #<Proc:0x000055e092b971c0@/repo/Rakefile:10>]
"target => source"
[#<Proc:0x000055e092b971c0@/repo/Rakefile:10>, #<Proc:0x000055e092b971c0@/repo/Rakefile:10>, #<Proc:0x000055e092b971c0@/repo/Rakefile:10>, #<Proc:0x000055e092b971c0@/repo/Rakefile:10>, #<Proc:0x000055e092b971c0@/repo/Rakefile:10>]
** Execute d
** Invoke target 
** Execute b
** Invoke target 
** Execute a
** Invoke target 
** Execute c
** Invoke target 
** Execute e
** Execute default

The results differ between runs. It seems to happen more often with debug output.

The same action block gets added multiple times to the same task.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Riproduci il problema con il Rakefile fornito usando rake --trace --rules, variando l'output di debug e le esecuzioni ripetute. Traccia gli entry point di multitask e rule-resolution per determinare perché la stessa azione viene aggiunta ripetutamente; il lavoro è completato quando l'azione del target condiviso viene eseguita esattamente una volta in modo coerente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
ruby
Ambito
build-system
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.