I think what's needed are upstream commits
95603fae18f81eebdafc5b318e70f9e2cdefab9e and the patch under discussion
in https://review.openocd.org/c/openocd/+/8512

On Sat, Sep 28, 2024 at 02:54:51PM +0800, Bo YU wrote:
> Source: openocd
> Version: 0.12.0-2
> Severity: important
> 
> Dear Maintainer,
> 
> Jimtcl has release one new version with 0.83 and I am ready to update it
> now.
> 
> Before this transition, I noticed openocd has a ftbfs issue with
> jimtcl/0.83:
> 
> ```
> Writing index file openocd.fn
> [21] [22] [23]In file included from ./src/helper/jim-nvp.h:22,
>                  from ./src/helper/command.h:17,
>                  from ./src/helper/log.h:17,
>                  from ./src/jtag/jtag.h:15,
>                  from src/openocd.c:20:
> src/openocd.c: In function 'jim_expr_command':
> src/openocd.c:258:73: error: 'Jim_Interp' has no member named 
> 'currentScriptObj'; did you mean 'nullScriptObj'
> ?
>   258 |                 struct jim_scriptobj *script = 
> Jim_GetIntRepPtr(interp->currentScriptObj);
>       |                                                                       
>   ^~~~~~~~~~~~~~~~
> src/openocd.c:259:29: error: 'Jim_Interp' has no member named 
> 'currentScriptObj'; did you mean 'nullScriptObj'
> ?
>   259 |                 if (interp->currentScriptObj == interp->emptyObj ||
>       |                             ^~~~~~~~~~~~~~~~
>       |                             nullScriptObj
>  [24src/openocd.c:260:48: error: 'Jim_Interp' has no member named 
> 'currentScriptObj'; did you mean 'nullScript
> Obj'?
>   260 |                                 
> strcmp(interp->currentScriptObj->typePtr->name, "script") ||
>       |                                                ^~~~~~~~~~~~~~~~
>       |                                                nullScriptObj
> 
> ```
> 
> I think this issue from jimtcl upstream change:
> https://github.com/msteveb/jimtcl/commit/f07c53e38d55f0c7c648b7818798138d91053527
> 
> I have proposed one patch to fix the issue but please review it
> carefully as I am not sure this is total right or not.
> 
> BTW, I am not sure why the it needs introduce headers also with the
> change.
> 
> -- 
> Regards,
> --
>   Bo YU
> 

> diff -Nru openocd-0.12.0/debian/changelog openocd-0.12.0/debian/changelog
> --- openocd-0.12.0/debian/changelog   2024-08-30 15:23:51.000000000 +0800
> +++ openocd-0.12.0/debian/changelog   2024-09-28 14:28:52.000000000 +0800
> @@ -1,3 +1,10 @@
> +openocd (0.12.0-2.1) UNRELEASED; urgency=medium
> +
> +  * Non-maintainer upload.
> +  * Fix ftbfs on jimtcl-0.83.
> +
> + -- Bo YU <tsu.y...@gmail.com>  Sat, 28 Sep 2024 14:28:52 +0800
> +
>  openocd (0.12.0-2) unstable; urgency=medium
>  
>    * Disable libgpiod backend (Closes: #1070885)
> diff -Nru openocd-0.12.0/debian/patches/fix-ftbfs-jimtcl-0.83.patch 
> openocd-0.12.0/debian/patches/fix-ftbfs-jimtcl-0.83.patch
> --- openocd-0.12.0/debian/patches/fix-ftbfs-jimtcl-0.83.patch 1970-01-01 
> 07:30:00.000000000 +0730
> +++ openocd-0.12.0/debian/patches/fix-ftbfs-jimtcl-0.83.patch 2024-09-28 
> 13:47:36.000000000 +0800
> @@ -0,0 +1,41 @@
> +Index: b/src/openocd.c
> +===================================================================
> +--- a/src/openocd.c
> ++++ b/src/openocd.c
> +@@ -255,9 +255,9 @@
> +             Jim_Obj *obj = Jim_ConcatObj(interp, argc - 1, argv + 1);
> +             Jim_IncrRefCount(obj);
> +             const char *s = Jim_String(obj);
> +-            struct jim_scriptobj *script = 
> Jim_GetIntRepPtr(interp->currentScriptObj);
> +-            if (interp->currentScriptObj == interp->emptyObj ||
> +-                            strcmp(interp->currentScriptObj->typePtr->name, 
> "script") ||
> ++            struct jim_scriptobj *script = 
> Jim_GetIntRepPtr(interp->evalFrame->scriptObj);
> ++            if (interp->evalFrame->scriptObj == interp->emptyObj ||
> ++                            
> strcmp(interp->evalFrame->scriptObj->typePtr->name, "script") ||
> +                             script->subst_flags ||
> +                             script->filename_obj == interp->emptyObj)
> +                     LOG_WARNING("DEPRECATED! use 'expr { %s }' not 'expr 
> %s'", s, s);
> +Index: b/src/helper/configuration.h
> +===================================================================
> +--- a/src/helper/configuration.h
> ++++ b/src/helper/configuration.h
> +@@ -12,6 +12,7 @@
> + #define OPENOCD_HELPER_CONFIGURATION_H
> + 
> + #include <helper/command.h>
> ++#include <stdio.h>
> + 
> + int parse_cmdline_args(struct command_context *cmd_ctx,
> +             int argc, char *argv[]);
> +Index: b/src/helper/jim-nvp.c
> +===================================================================
> +--- a/src/helper/jim-nvp.c
> ++++ b/src/helper/jim-nvp.c
> +@@ -21,6 +21,7 @@
> + #endif
> + 
> + #include "jim-nvp.h"
> ++#include <stdio.h>
> + #include <string.h>
> + 
> + int jim_get_nvp(Jim_Interp *interp,
> diff -Nru openocd-0.12.0/debian/patches/series 
> openocd-0.12.0/debian/patches/series
> --- openocd-0.12.0/debian/patches/series      2024-08-30 15:23:51.000000000 
> +0800
> +++ openocd-0.12.0/debian/patches/series      2024-09-28 13:38:02.000000000 
> +0800
> @@ -1,3 +1,4 @@
>  no-duplicate-udev.patch
>  remove-jimtcl-configure.patch
>  no-libgpiod-v2.patch
> +fix-ftbfs-jimtcl-0.83.patch

J.

-- 
] https://www.earth.li/~noodles/ []     It does it for me our kid!     [
]  PGP/GPG Key @ the.earth.li    []                                    [
] via keyserver, web or email.   []                                    [
] RSA: 4096/0x94FA372B2DA8B985   []                                    [

Attachment: signature.asc
Description: PGP signature

Reply via email to