From d4a576df35a2f8d832a379740215de83266cc10e Mon Sep 17 00:00:00 2001 From: Paolo Pastori <75467826+paolopas@users.noreply.github.com> Date: Mon, 29 Dec 2025 21:22:47 +0100 Subject: [PATCH 1/2] argument description for DEPENDS/INCLUDES builtins now available, this when provided is used by the functions function_bind_variables, function_run, argument_error allowing the checking of arguments that otherwise cannot happen --- src/engine/builtins.cpp | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/engine/builtins.cpp b/src/engine/builtins.cpp index 29f1efc578..4e9ed5d627 100644 --- a/src/engine/builtins.cpp +++ b/src/engine/builtins.cpp @@ -54,7 +54,7 @@ # define FSCTL_GET_REPARSE_POINT 0x000900a8 #endif #ifndef IO_REPARSE_TAG_SYMLINK -# define IO_REPARSE_TAG_SYMLINK (0xA000000CL) +# define IO_REPARSE_TAG_SYMLINK (0xA000000CL) #endif #include @@ -169,9 +169,12 @@ void load_builtins() bind_builtin( "ALWAYS", builtin_flags, T_FLAG_TOUCHED, 0 ) ); - duplicate_rule( "Depends", - bind_builtin( "DEPENDS", - builtin_depends, 0, 0 ) ); + { + char const * args[] = { "targets1", "*", ":", "targets2", "*", 0 }; + duplicate_rule( "Depends", + bind_builtin( "DEPENDS", + builtin_depends, 0, args ) ); + } duplicate_rule( "echo", duplicate_rule( "Echo", @@ -199,9 +202,12 @@ void load_builtins() builtin_glob_recursive, 0, args ); } - duplicate_rule( "Includes", - bind_builtin( "INCLUDES", - builtin_depends, 1, 0 ) ); + { + char const * args[] = { "targets1", "*", ":", "targets2", "*", 0 }; + duplicate_rule( "Includes", + bind_builtin( "INCLUDES", + builtin_depends, 1, args ) ); + } { char const * args[] = { "targets", "*", ":", "targets-to-rebuild", "*", @@ -463,10 +469,10 @@ void load_builtins() #ifdef JAM_DEBUGGER - { - const char * args[] = { "list", "*", 0 }; - bind_builtin("__DEBUG_PRINT_HELPER__", builtin_debug_print_helper, 0, args); - } + { + const char * args[] = { "list", "*", 0 }; + bind_builtin("__DEBUG_PRINT_HELPER__", builtin_debug_print_helper, 0, args); + } #endif From f65f30a354aebda5abb44c3e5645ddc979541a8f Mon Sep 17 00:00:00 2001 From: Paolo Pastori <75467826+paolopas@users.noreply.github.com> Date: Mon, 29 Dec 2025 22:55:50 +0100 Subject: [PATCH 2/2] argument description provided for builtin rules ALWAYS, LEAVES, NOCARE, NOTIME, NOTFILE, NOUPDATE, TEMPORARY, ISFILE, FAIL_EXPECTED, RMOLD --- src/engine/builtins.cpp | 88 +++++++++++++++++++++++++++-------------- 1 file changed, 58 insertions(+), 30 deletions(-) diff --git a/src/engine/builtins.cpp b/src/engine/builtins.cpp index 4e9ed5d627..bff9dd68cf 100644 --- a/src/engine/builtins.cpp +++ b/src/engine/builtins.cpp @@ -97,7 +97,8 @@ * builtin_echo() - ECHO rule * builtin_exit() - EXIT rule * builtin_export() - EXPORT ( MODULE ? : RULES * ) - * builtin_flags() - NOCARE, NOTFILE, TEMPORARY rule + * builtin_flags() - ALWAYS/LEAVES/NOCARE/NOTIME/NOTFILE/NOUPDATE + * TEMPORARY/ISFILE/FAIL_EXPECTED/RMOLD rule * builtin_glob() - GLOB rule * builtin_glob_recursive() - ??? * builtin_hdrmacro() - ??? @@ -165,9 +166,12 @@ RULE * duplicate_rule( char const * name_, RULE * other ) void load_builtins() { - duplicate_rule( "Always", - bind_builtin( "ALWAYS", - builtin_flags, T_FLAG_TOUCHED, 0 ) ); + { + char const * args[] = { "targets", "*", 0 }; + duplicate_rule( "Always", + bind_builtin( "ALWAYS", + builtin_flags, T_FLAG_TOUCHED, args ) ); + } { char const * args[] = { "targets1", "*", ":", "targets2", "*", 0 }; @@ -216,9 +220,12 @@ void load_builtins() builtin_rebuilds, 0, args ); } - duplicate_rule( "Leaves", - bind_builtin( "LEAVES", - builtin_flags, T_FLAG_LEAVES, 0 ) ); + { + char const * args[] = { "targets", "*", 0 }; + duplicate_rule( "Leaves", + bind_builtin( "LEAVES", + builtin_flags, T_FLAG_LEAVES, args ) ); + } duplicate_rule( "Match", bind_builtin( "MATCH", @@ -230,39 +237,60 @@ void load_builtins() builtin_split_by_characters, 0, args ); } - duplicate_rule( "NoCare", - bind_builtin( "NOCARE", - builtin_flags, T_FLAG_NOCARE, 0 ) ); + { + char const * args[] = { "targets", "*", 0 }; + duplicate_rule( "NoCare", + bind_builtin( "NOCARE", + builtin_flags, T_FLAG_NOCARE, args ) ); + } - duplicate_rule( "NOTIME", - duplicate_rule( "NotFile", - bind_builtin( "NOTFILE", - builtin_flags, T_FLAG_NOTFILE, 0 ) ) ); + { + char const * args[] = { "targets", "*", 0 }; + duplicate_rule( "NOTIME", + duplicate_rule( "NotFile", + bind_builtin( "NOTFILE", + builtin_flags, T_FLAG_NOTFILE, args ) ) ); + } - duplicate_rule( "NoUpdate", - bind_builtin( "NOUPDATE", - builtin_flags, T_FLAG_NOUPDATE, 0 ) ); + { + char const * args[] = { "targets", "*", 0 }; + duplicate_rule( "NoUpdate", + bind_builtin( "NOUPDATE", + builtin_flags, T_FLAG_NOUPDATE, args ) ); + } - duplicate_rule( "Temporary", - bind_builtin( "TEMPORARY", - builtin_flags, T_FLAG_TEMP, 0 ) ); + { + char const * args[] = { "targets", "*", 0 }; + duplicate_rule( "Temporary", + bind_builtin( "TEMPORARY", + builtin_flags, T_FLAG_TEMP, args ) ); + } - bind_builtin( "ISFILE", - builtin_flags, T_FLAG_ISFILE, 0 ); + { + char const * args[] = { "targets", "*", 0 }; + bind_builtin( "ISFILE", + builtin_flags, T_FLAG_ISFILE, args ); + } duplicate_rule( "HdrMacro", bind_builtin( "HDRMACRO", builtin_hdrmacro, 0, 0 ) ); - /* FAIL_EXPECTED is used to indicate that the result of a target build - * action should be inverted (ok <=> fail) this can be useful when - * performing test runs from Jamfiles. - */ - bind_builtin( "FAIL_EXPECTED", - builtin_flags, T_FLAG_FAIL_EXPECTED, 0 ); + { + /* FAIL_EXPECTED is used to indicate that the result of a target build + * action should be inverted (ok <=> fail) this can be useful when + * performing test runs from Jamfiles. + */ + char const * args[] = { "targets", "*", 0 }; + bind_builtin( "FAIL_EXPECTED", + builtin_flags, T_FLAG_FAIL_EXPECTED, args ); + } - bind_builtin( "RMOLD", - builtin_flags, T_FLAG_RMOLD, 0 ); + { + char const * args[] = { "targets", "*", 0 }; + bind_builtin( "RMOLD", + builtin_flags, T_FLAG_RMOLD, args ); + } { char const * args[] = { "targets", "*", 0 };