URL: <https://savannah.gnu.org/bugs/?62324>
Summary: Fix cache integrity check Project: make Submitted by: dgoncharov Submitted on: Sat 16 Apr 2022 05:59:23 PM UTC Severity: 3 - Normal Item Group: Bug Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any Component Version: SCM Operating System: None Fixed Release: None Triage Status: None _______________________________________________________ Details: ++++ .SECONDEXPANSION: all: bye.x %.x: $$(firstword %.1; ---- The makefile presented above causes make to fail integrity self check with the following message make: *** unterminated call to function 'firstword': missing ')'. Stop. make: bye.x: Field 'stem' not cached: bye This "'stem' not cached" failure happens, because in pattern_search file->stem is temporarily set to a value for the sake of set_file_variables and reset afterwords. However, before file->stem can be reset variable_expand_for_file is called and it bumps to the syntax error and causes make to perform integrity self check before exiting. The integrity check fails, because the stem in question was never cached. This fix adds a dedicated stem parameter to set_file_variables to relieve the callers from having to modify and then restore file->stem. src/commands.c (set_file_variables): Take second parameter stem to relieve the callers of set_file_variables from setting and restoring file->stem. src/commands.h (set_file_variables): Ditto. (execute_file_commands): Pass file->stem to set_file_variables. src/file.c (expand_deps): Pass d->stem to set_file_variables and remove no longer needed code to set and restore file->stem. src/implicit.c (pattern_search): Pass stem_str to set_file_variables and remove no longer needed code to set and reset file->stem. tests/scripts/features/se_explicit: Add new tests. tests/scripts/features/se_implicit: Ditto. tests/scripts/features/se_statpat: Ditto. tests/scripts/variables/automatic: Ditto. _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?62324> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/