[ruby-core:112474] [Ruby master Bug#19446] Remove `compiler_wd` related warnings in `tool/update-deps`

Issue #19446 has been reported by eightbitraptor (Matthew Valentine-House). ---------------------------------------- Bug #19446: Remove `compiler_wd` related warnings in `tool/update-deps` https://bugs.ruby-lang.org/issues/19446 * Author: eightbitraptor (Matthew Valentine-House) * Status: Open * Priority: Normal * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- [Github PR #7331](https://github.com/ruby/ruby/pull/7331) The update deps tool uses intermediary build files to verify dependencies. When these `*.i` files are generated by `gcc` the second line is always of the form ``` # 1 "/home/runner/work/ruby/ruby//" ``` Which `update-deps` attempts to parse out and set as the compiler working directory. It iterates through the intermediary files and sets `compiler_wd` in this loop: ```ruby compiler_wd = nil path_i.each_line {|line| next if /\A\# \d+ "(.*)"/ !~ line dep = $1 next if %r{\A<.*>\z} =~ dep # omit <command-line>, etc. next if /\.e?rb\z/ =~ dep compiler_wd ||= dep files[dep] = true } ``` This will always end up setting `compiler_wd` to the first line in the file, rather than the second, which means the subsequent check for the special gcc compiler dir line will fail, that line will be left in the resulting dependancy lists and manifests later on as warnings. We can see these by looking at any Github Actions Check Dependancies run [like this one](https://github.com/ruby/ruby/actions/runs/4200439119/jobs/7286451096). The warnings look like this ``` warning: file not found: /home/runner/work/ruby/ruby// warning: file not found: /home/runner/work/ruby/ruby// warning: file not found: /home/runner/work/ruby/ruby// ... ( ~350 lines of this) ``` The referenced PR fixes the way `compiler_wd` is set, in order to get rid of the warnings. -- https://bugs.ruby-lang.org/
participants (1)
-
eightbitraptor (Matthew Valentine-House)