Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9141cf91e7 | ||
|
|
7f7e6ef3da | ||
|
|
60b3fdbcac |
No files matched your search
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
rscons (1.11.0)
|
rscons (1.11.1)
|
||||||
json (~> 1.0)
|
json (~> 1.0)
|
||||||
|
|
||||||
GEM
|
GEM
|
||||||
|
|||||||
@@ -560,7 +560,7 @@ env.depends("my_app", "config/link.ld", "README.txt", *Dir.glob("assets/**/*"))
|
|||||||
### API documentation
|
### API documentation
|
||||||
|
|
||||||
Documentation for the complete Rscons API can be found at
|
Documentation for the complete Rscons API can be found at
|
||||||
http://rubydoc.info/github/holtrop/rscons/frames.
|
http://www.rubydoc.info/github/holtrop/rscons/master.
|
||||||
|
|
||||||
## Release Notes
|
## Release Notes
|
||||||
|
|
||||||
|
|||||||
+9
-10
@@ -47,24 +47,18 @@ module Rscons
|
|||||||
# @return [nil, Hash]
|
# @return [nil, Hash]
|
||||||
# The next job to run.
|
# The next job to run.
|
||||||
def get_next_job_to_run(targets_still_building)
|
def get_next_job_to_run(targets_still_building)
|
||||||
targets_skipped = Set.new
|
|
||||||
@jobs.keys.each do |target|
|
@jobs.keys.each do |target|
|
||||||
skip = false
|
skip = false
|
||||||
(@jobs[target][0][:sources] + (@build_dependencies[target] || []).to_a).each do |src|
|
(@jobs[target][0][:sources] + (@build_dependencies[target] || []).to_a).each do |src|
|
||||||
if @jobs.include?(src)
|
if @jobs.include?(src)
|
||||||
if targets_skipped.include?(src) or (src == target)
|
# Skip this target because it depends on another target not yet
|
||||||
# We have encountered a circular dependency.
|
# built.
|
||||||
raise "Circular build dependency for #{src}"
|
|
||||||
end
|
|
||||||
# Skip this target because it depends on another target later in
|
|
||||||
# the job set.
|
|
||||||
targets_skipped << target
|
|
||||||
skip = true
|
skip = true
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
if targets_still_building.include?(src)
|
if targets_still_building.include?(src)
|
||||||
# Skip this target because it depends on another target that is
|
# Skip this target because it depends on another target that is
|
||||||
# still being built.
|
# currently being built.
|
||||||
skip = true
|
skip = true
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
@@ -79,7 +73,12 @@ module Rscons
|
|||||||
return job
|
return job
|
||||||
end
|
end
|
||||||
|
|
||||||
nil
|
# If there is a job to run, and nothing is still building, but we did
|
||||||
|
# not find a job to run above, then there might be a circular dependency
|
||||||
|
# introduced by the user.
|
||||||
|
if (@jobs.size > 0) and targets_still_building.empty?
|
||||||
|
raise "Could not find a runnable job. Possible circular dependency for #{@jobs.keys.first}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Remove all jobs from the JobSet.
|
# Remove all jobs from the JobSet.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
module Rscons
|
module Rscons
|
||||||
# gem version
|
# gem version
|
||||||
VERSION = "1.11.0"
|
VERSION = "1.11.1"
|
||||||
end
|
end
|
||||||
@@ -735,14 +735,14 @@ EOF
|
|||||||
it "raises an error for a circular dependency" do
|
it "raises an error for a circular dependency" do
|
||||||
test_dir("simple")
|
test_dir("simple")
|
||||||
result = run_test(rsconsfile: "error_circular_dependency.rb")
|
result = run_test(rsconsfile: "error_circular_dependency.rb")
|
||||||
expect(result.stderr).to match /Circular build dependency for (foo|bar|baz)/
|
expect(result.stderr).to match /Possible circular dependency for (foo|bar|baz)/
|
||||||
expect(result.status).to_not eq 0
|
expect(result.status).to_not eq 0
|
||||||
end
|
end
|
||||||
|
|
||||||
it "raises an error for a circular dependency where a build target contains itself in its source list" do
|
it "raises an error for a circular dependency where a build target contains itself in its source list" do
|
||||||
test_dir("simple")
|
test_dir("simple")
|
||||||
result = run_test(rsconsfile: "error_circular_dependency2.rb")
|
result = run_test(rsconsfile: "error_circular_dependency2.rb")
|
||||||
expect(result.stderr).to match /Circular build dependency for foo/
|
expect(result.stderr).to match /Possible circular dependency for foo/
|
||||||
expect(result.status).to_not eq 0
|
expect(result.status).to_not eq 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user