Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix detection of compiler_wd in tool/update-deps #7331

Merged
merged 1 commit into from
Feb 21, 2023

Conversation

eightbitraptor
Copy link
Contributor

@eightbitraptor eightbitraptor commented Feb 16, 2023

This fixes the large list of warnings at the top of the Check Dependencies CI run that 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//
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//
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//
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//
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//

These warnings are being caused because gcc always outputs

# 1 "/home/runner/work/ruby/ruby//"

as the second line of the *.i file. There is already code in update-deps with the intention of removing this line from the dependencies array, however it is not working as intended

This is because when it loops through all the lines in the *.i files, it sets dep each time, and sets compiler_wd ||= dep. The use of ||= here means that the compiler_wd is always set to the first line in the file, rather than the second. Therefore the regex used to detect and remove the // and set the compile_wd correctly is never matching.

@peterzhu2118 peterzhu2118 merged commit 3c01342 into ruby:master Feb 21, 2023
@peterzhu2118 peterzhu2118 deleted the mvh-update-deps-fix branch February 21, 2023 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants