FS#71821 - [gnucobol] Arch Linux package GnuCobol does not support JSON GENERATE, original software does
Attached to Project:
Arch Linux
Opened by Elmar Klausmeier (eklausmeier) - Thursday, 12 August 2021, 19:34 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:16 GMT
Opened by Elmar Klausmeier (eklausmeier) - Thursday, 12 August 2021, 19:34 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:16 GMT
|
Details
Description: GnuCobol 3.1.2 officially supports JSON
GENERATE, but the Arch Linux version does not.
I removed the Arch Linux package and downloaded the GnuCobol source code and compiled + installed it (configure+make+make install). This original downloaded version does not contain the error. Additional info: * package version(s): 3.1.2-1 * config and/or log files etc. * link to upstream bug report, if any Steps to reproduce: Run below COBOL program: ```COBOL IDENTIFICATION DIVISION. PROGRAM-ID. json. AUTHOR. Elmar Klausmeier. DATE-WRITTEN. 12-Aug-2021. DATA DIVISION. WORKING-STORAGE SECTION. 01 I USAGE BINARY-LONG. 01 IMAX USAGE BINARY-LONG VALUE 20. 01 ARGV PIC X(100) VALUE SPACES. 77 j usage binary-long value 3. 77 jsono pic x(256) value spaces. 01 a1. 02 b. * 03 c occurs 0 to 2 depending j. 03 c. 04 d pic x value 'd'. 02 e pic x value 'e'. 01 rec. 03 a PIC X(3) VALUE 'A'. 03 b PIC X(3) VALUE ALL 'B'. 03 c. 05 d PIC X(3) VALUE SPACES. PROCEDURE DIVISION. DISPLAY "Converting from COBOL to JSON". ACCEPT ARGV FROM ARGUMENT-VALUE. MOVE ARGV TO j. DISPLAY "j = " j. DISPLAY "a1 = " a1. JSON GENERATE jsono FROM a1 ON EXCEPTION display 'cannot generate json from a1'. DISPLAY "jsono = " function trim(jsono). DISPLAY "rec = " rec. JSON GENERATE jsono FROM rec ON EXCEPTION display 'cannot generate json from rec'. DISPLAY "jsono = " function trim(jsono). STOP RUN. ``` Output: ``` ./json 3 Converting from COBOL to JSON j = +0000000003 a1 = de jsono = rec = A BBB jsono = ``` Expected output: ``` ./json 4 Converting from COBOL to JSON j = +0000000004 a1 = de jsono = {"a1":{"b":{"c":{"d":"d"}},"e":"e"}} rec = A BBB jsono = {"rec":{"a":"A","b":"BBB","c":{"d":" "}}} ``` To me it looks that during configuration of GnuCobol, i.e., ./configure step, the config for ``` configure: Used for XML I/O: libxml2 configure: Used for JSON I/O: json-c ``` was missing. |
This task depends upon
Closed by Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:16 GMT
Reason for closing: Moved
Additional comments about closing: https://gitlab.archlinux.org/archlinux/p ackaging/packages/gnucobol/issues/1
Saturday, 25 November 2023, 20:16 GMT
Reason for closing: Moved
Additional comments about closing: https://gitlab.archlinux.org/archlinux/p ackaging/packages/gnucobol/issues/1
For both to be available a runtime dependency to libxml and libjsonc should be added, along with a compile-time dependency to their -dev packages.
It _looks_ like ncursesw is also linked in this package so it would be useful to add the explicit dependencies, too - and maybe make them explicit on the configure line, too, something along
configure --with-db --with-curses=ncursesw --with-xml2 --with-json=json-c
Could it be an upstream bug ?
If yes then we should report this problem to gnucobol developers.
FS#79379