IBM / dbb-zappbuild

zAppBuild is a generic build solution for building z/OS applications using Apache Groovy build scripts and IBM Dependency Based Build (DBB) APIs.
Apache License 2.0
40 stars 123 forks source link

BuildUtilities.copySourceFiles(BuildUtilities.groovy:100) - EDC5003I Truncation of a record occurred during an I/O operation.; errno=3 errno2=0xc0400060 last_op=60 errorCode=0x5620062 #505

Closed FALLAI-Denis closed 2 months ago

FALLAI-Denis commented 2 months ago

Hi,

We had a problem when building a COBOL program which triggered a Java exception at the IBM DBB CopyToPDS function when feeding the PDS by the BuildUtilities.copySourceFiles function.

The zAppbuild build/script is stopped, in error. The Jenkins pipeline is stopped, in error.

This problem was related to the fact that a record (comment line) of the COBOL source file was longer than 80 characters for a copy in a PDS LRECL=80.

Despite the error, the COBOL source file was succesfully copied into the PDS, with truncation of the line concerned, without impact on the operation of the program. Moreover, this is not an Error but an Information: EDC5003I.

Is there a way to ignore file truncations, either at the zAppbuild level or at the DBB CopyToPDS API level?

The sources come from a Git repository, there is no control over the line length, except to activate a control when saving the file, (control which is normally done by IBM Z Open Editor unless the user has disabled it or forced the line length to more than 80 characters).

We would prefer to have a compilation error, manageable by the mainframe developer, rather than an abort of the Jenkins pipeline which is not manageable (nor understandable) by the mainframe developer, and which forces the CI/CD chain support team to diagnose the problem.

zAppbuild / Jenkins log:

14:57:44  com.ibm.dbb.build.BuildException: com.ibm.jzos.ZFileException: //DD:SYS00033: fwrite() failed; EDC5003I Truncation of a record occurred during an I/O operation.; errno=3 errno2=0xc0400060 last_op=60 errorCode=0x5620062
14:57:44    at com.ibm.dbb.build.CopyToPDS.execute(CopyToPDS.java:89)
14:57:44    at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:318)
14:57:44    at BuildUtilities.copySourceFiles(BuildUtilities.groovy:100)
14:57:44    at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:471)
14:57:44    at java.lang.invoke.MethodHandles$CatchHelper.helper(MethodHandles.java:2454)
14:57:44    at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:318)
14:57:44    at CobolBPCE.executeBuild(CobolBPCE.groovy:212)

zAppbuild script:

/*
 * copySourceFiles - copies both the program being built and the program
 * dependencies from USS directories to data sets
 *
 * parameters:
 *  - build file
 *  - target dataset for build file
 *  - name of the DBB PropertyMapping for dependencies (optional)
 *  - name of the map for alternate library names for PLI and COBOL (optional)
 *  - DependencyResolver to resolve dependencies
 */

def copySourceFiles(String buildFile, String srcPDS, String dependencyDatasetMapping, String dependenciesAlternativeLibraryNameMapping, SearchPathDependencyResolver dependencyResolver) {
    // only copy the build file once
    if (!copiedFileCache.contains(buildFile)) {
        copiedFileCache.add(buildFile)
        new CopyToPDS().file(new File(getAbsolutePath(buildFile)))
                .dataset(srcPDS)
                .member(CopyToPDS.createMemberName(buildFile))   <-- line 100 in error
                .execute()
    }
...
dennis-behm commented 2 months ago

Hi @FALLAI-Denis - Did you saw our enhancement in zAppBuild Release 3.6.0, that delivered https://github.com/IBM/dbb-zappbuild/pull/448 ?

This is handling the exceptions correctly and reports them as part of the build.

FALLAI-Denis commented 2 months ago

Hi @dennis-behm,

Thank you for this quick feedback.

We are very late on the zAppbuild versions and we are still with (adapted) zAppbuild 3.0.1 and with DBB version 2.0.0, with a fix to manage build concurrency.

We are completing the migration of our historic E** mainframe SCM/build/package/deploy solution to Git / DBB, and then we will take care of version upgrades.

Afterwards the basic question is whether we can force the CopyToPDS API to truncate a record without triggering an exception, add a parameter or an option to the function, but I haven't seen anything in the documentation DBB on this subject...

I will open a request on the IBM Ideas site for IBM DBB.

Thanks.