Skip to content

Commit

Permalink
Fix a bug that make.exe path may be broken
Browse files Browse the repository at this point in the history
GitHub: fix GH-225

This is not a real fix. This works only when Windows user doesn't
specify make.exe path explicitly by MAKE environment variable.

If an user specifies c:\...\make.exe by MAKE environment variable
explicitly, it still doesn't work. But I'm not sure whether the use
case exists or not. If we get a report for the use case and the user
can't use c:/.../make.exe path instead of c:\...\make.exe, I'll
reconsider how to fix the use case.

Reported by Lukasz Suleja. Thanks!!!
  • Loading branch information
kou committed Aug 2, 2023
1 parent 77d9294 commit 6af09fd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/rake/extensiontask.rb
Original file line number Diff line number Diff line change
Expand Up @@ -513,12 +513,15 @@ def make
def find_make
candidates = ["gmake", "make"]
paths = (ENV["PATH"] || "").split(File::PATH_SEPARATOR)
paths = paths.collect do |path|
Pathname(path).cleanpath
end

exeext = RbConfig::CONFIG["EXEEXT"]
candidates.each do |candidate|
paths.each do |path|
make = File.join(path, "#{candidate}#{exeext}")
return make if File.executable?(make)
make = path + "#{candidate}#{exeext}"
return make.to_s if make.executable?
end
end

Expand Down

0 comments on commit 6af09fd

Please sign in to comment.