Skip to content

Commit

Permalink
Merge pull request #330 from zowe/v2.x/staging
Browse files Browse the repository at this point in the history
merge v2.x/staging into v2.x/rc
  • Loading branch information
1000TurquoisePogs authored Sep 1, 2022
2 parents 6eb7806 + 2d71165 commit a0f729d
Show file tree
Hide file tree
Showing 32 changed files with 1,414 additions and 347 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-configmgr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Test Workflow
name: Build configmgr
on:
push:
branches:
Expand Down
89 changes: 89 additions & 0 deletions .github/workflows/build-rexxconfigmgr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Build REXX configmgr
on:
push:
branches:
- v2.x/staging
- v2.x/master
- v2.x/rc
pull_request:
types: [opened, reopened, synchronize]
workflow_dispatch:
inputs:
PERFORM_RELEASE:
description: '[Release] perform release'
required: false
default: 'false'


jobs:
check-permission:
runs-on: ubuntu-latest
steps:
# this action will fail the whole workflow if permission check fails
- name: check permission
uses: zowe-actions/shared-actions/permission-check@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

build-test:
runs-on: ubuntu-latest
needs: check-permission
steps:
- name: '[Prep 1] Checkout'
uses: actions/checkout@v2

- name: '[Dep 1] Libyaml'
uses: actions/checkout@v3
with:
repository: yaml/libyaml
path: deps/configmgr/libyaml
ref: '0.2.5'

- name: '[Dep 2] Quickjs'
uses: actions/checkout@v3
with:
repository: joenemo/quickjs-portable
path: deps/configmgr/quickjs
ref: 'main'

- name: '[Prep 2] Setup jFrog CLI'
uses: jfrog/setup-jfrog-cli@v2
env:
JF_ARTIFACTORY_1: ${{ secrets.JF_ARTIFACTORY_TOKEN }}

- name: '[Prep 3] Set date'
id: date
run: echo "::set-output name=date::$(date +'%Y%m%d%S')"

- name: '[Prep 4] Set version'
id: version
run: echo "::set-output name=version::$(cat build/configmgr.proj.env | grep VERSION | cut -f 2 -d=)"

- name: '[Prep 5] Set branchname'
id: branch
run: echo "::set-output name=branch::$(if [ -n '${{ github.head_ref }}' ]; then echo '${{ github.head_ref }}'; else echo '${{ github.ref_name }}'; fi | sed 's@/@_@g')"


- name: '[Prep 6] Prepare workflow'
uses: zowe-actions/shared-actions/prepare-workflow@main


- name: '[Packaging] Make pax'
uses: zowe-actions/shared-actions/make-pax@main
with:
pax-name: 'configmgr-rexx'
pax-options: '-x os390 -pp'
pax-local-workspace: './.pax/configmgr-rexx'
pax-ssh-username: ${{ secrets.SSH_MARIST_USERNAME }}
pax-ssh-password: ${{ secrets.SSH_MARIST_RACF_PASSWORD }}

- name: '[Publish] Publish'
uses: zowe-actions/shared-actions/publish@main
if: success()
with:
artifacts: |
.pax/configmgr-rexx/configmgr-rexx.pax
publish-target-path-pattern: libs-snapshot-local/org/zowe/configmgr-rexx/${{ steps.version.outputs.version }}-${{ steps.branch.outputs.branch }}
publish-target-file-pattern: configmgr_rexx-${{ steps.version.outputs.version }}-${{ steps.date.outputs.date }}.pax
perform-release: ${{ github.event.inputs.PERFORM_RELEASE }}

37 changes: 37 additions & 0 deletions .pax/configmgr-rexx/pre-packaging.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/sh -e
set -xe

################################################################################
# This program and the accompanying materials are made available under the terms of the
# Eclipse Public License v2.0 which accompanies this distribution, and is available at
# https://www.eclipse.org/legal/epl-v20.html
#
# SPDX-License-Identifier: EPL-2.0
#
# Copyright Contributors to the Zowe Project.
################################################################################


# contants
SCRIPT_NAME=$(basename "$0")
SCRIPT_DIR=$(pwd)

# build
echo "$SCRIPT_NAME build_rexxcmgr.sh ..."
STEPLIB=CBC.SCCNCMP "$SCRIPT_DIR/content/build/build_rexxcmgr.sh"

echo "$SCRIPT_NAME build_rexxintfsh ..."
STEPLIB=CBC.SCCNCMP "$SCRIPT_DIR/content/build/build_rexxintf.sh"


# clean up content folder
echo "$SCRIPT_NAME cleaning up pax folder ..."
cd "$SCRIPT_DIR"
mv content bak && mkdir -p content

# move real files to the content folder
echo "$SCRIPT_NAME coping files should be in pax ..."
cd "$SCRIPT_DIR/content"
cp ../bak/bin/ZWECFG31 .
cp ../bak/bin/ZWECFG64 .
cp ../bak/bin/ZWERXCFG .
44 changes: 44 additions & 0 deletions .pax/configmgr-rexx/prepare-workspace.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/sh -e
set -xe

################################################################################
# This program and the accompanying materials are made available under the terms of the
# Eclipse Public License v2.0 which accompanies this distribution, and is available at
# https://www.eclipse.org/legal/epl-v20.html
#
# SPDX-License-Identifier: EPL-2.0
#
# Copyright Contributors to the Zowe Project.
################################################################################

################################################################################
# Prepare folders/files will be uploaded to Build/PAX server
################################################################################

# contants
SCRIPT_NAME=$(basename "$0")
SCRIPT_DIR=$(dirname "$0")
PAX_WORKSPACE_DIR=.pax/configmgr-rexx

# make sure in project root folder
cd $SCRIPT_DIR/../..

# prepare pax workspace
echo "[${SCRIPT_NAME}] preparing folders ..."
rm -fr "${PAX_WORKSPACE_DIR}/ascii" && mkdir -p "${PAX_WORKSPACE_DIR}/ascii"
rm -fr "${PAX_WORKSPACE_DIR}/content" && mkdir -p "${PAX_WORKSPACE_DIR}/content"

echo "[${SCRIPT_NAME}] copying files ..."
cp -R * "${PAX_WORKSPACE_DIR}/ascii"
# move files shouldn't change encoding to IBM-1047 to content folder
rsync -rv \
--include '*/' \
--include '*.png' \
--exclude '*' \
--prune-empty-dirs --remove-source-files \
"${PAX_WORKSPACE_DIR}/ascii/" \
"${PAX_WORKSPACE_DIR}/content/"

# update build information
# BRANCH_NAME and BUILD_NUMBER is Jenkins environment variable
commit_hash=$(git rev-parse --verify HEAD)
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Zowe Common C Changelog

## `2.3.0`

- Bugfix for lht functions of collections.c to avoid memory issues on negative keys
- Added a new build target, 'configmgr-rexx', which builds a version of configmgr that can be used within rexx scripts.
- Bugfix the help message on configmgr

## `2.2.0`

- Added a script 'dependencies.sh' which assists in managing external depedencies needed for project compilation
Expand Down
17 changes: 16 additions & 1 deletion build/build_cmgr_xlclang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ VERSION="\"${VERSION}\""

rm -f "${COMMON}/bin/configmgr"

GSKDIR=/usr/lpp/gskssl
GSKINC="${GSKDIR}/include"

xlclang \
-c \
-q64 \
Expand Down Expand Up @@ -96,9 +99,11 @@ xlclang \
-D_XOPEN_SOURCE=600 \
-D_OPEN_THREADS=1 \
-DNOIBMHTTP=1 \
-DUSE_ZOWE_TLS=1 \
-DCMGRTEST=1 \
-I "${COMMON}/h" \
-I "${COMMON}/platform/posix" \
-I ${GSKINC} \
-I "${DEPS_DESTINATION}/${LIBYAML}/include" \
-I "${DEPS_DESTINATION}/${QUICKJS}" \
-o "${COMMON}/bin/configmgr" \
Expand All @@ -122,22 +127,32 @@ xlclang \
${COMMON}/c/collections.c \
${COMMON}/c/configmgr.c \
${COMMON}/c/embeddedjs.c \
${COMMON}/c/fdpoll.c \
${COMMON}/c/http.c \
${COMMON}/c/httpclient.c \
${COMMON}/c/json.c \
${COMMON}/c/jcsi.c \
${COMMON}/c/jsonschema.c \
${COMMON}/c/le.c \
${COMMON}/c/logging.c \
${COMMON}/c/microjq.c \
${COMMON}/c/parsetools.c \
${COMMON}/c/pdsutil.c \
${COMMON}/c/qjsnet.c \
${COMMON}/c/qjszos.c \
${COMMON}/platform/posix/psxregex.c \
${COMMON}/c/recovery.c \
${COMMON}/c/scheduling.c \
${COMMON}/c/socketmgmt.c \
${COMMON}/c/timeutls.c \
${COMMON}/c/tls.c \
${COMMON}/c/utils.c \
${COMMON}/c/xlate.c \
${COMMON}/c/yaml2json.c \
${COMMON}/c/zos.c \
${COMMON}/c/zosfile.c
${COMMON}/c/zosfile.c \
${GSKDIR}/lib/GSKSSL64.x \
${GSKDIR}/lib/GSKCMS64.x
#then
# echo "Build successful"
# ls -l "${COMMON}/bin"
Expand Down
28 changes: 24 additions & 4 deletions build/build_rexxcmgr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,26 +90,35 @@ xlclang \
-D_OPEN_SYS_FILE_EXT=1 \
-D_XOPEN_SOURCE=600 \
-D_OPEN_THREADS=1 \
-DUSE_ZOWE_TLS=1 \
-DCONFIG_VERSION=\"2021-03-27\" \
-I "${DEPS_DESTINATION}/${LIBYAML}/include" \
-I "${DEPS_DESTINATION}/${QUICKJS}" \
-I ${COMMON}/h \
${COMMON}/c/embeddedjs.c
${COMMON}/c/embeddedjs.c \
${COMMON}/c/qjszos.c \
${COMMON}/c/qjsnet.c

# Hacking around weird link issue:
ar x /usr/lpp/cbclib/lib/libibmcmp.a z_atomic.LIB64R.o

GSKDIR=/usr/lpp/gskssl
GSKINC="${GSKDIR}/include"

xlc \
-q64 \
"-Wc,float(ieee),longname,langlvl(extc99),gonum,goff,ASM,asmlib('CEE.SCEEMAC','SYS1.MACLIB','SYS1.MODGEN'),list()" \
-D_OPEN_SYS_FILE_EXT=1 \
-D_XOPEN_SOURCE=600 \
-D_OPEN_THREADS=1 \
-DNEW_CAA_LOCATIONS=1 \
-DUSE_ZOWE_TLS=1 \
-I "${COMMON}/h" \
-I "${COMMON}/platform/posix" \
-I ${GSKINC} \
-I "${DEPS_DESTINATION}/${LIBYAML}/include" \
-o "${COMMON}/bin/zwecfgle" \
-I "${DEPS_DESTINATION}/${QUICKJS}" \
-o "${COMMON}/bin/ZWERXCFG" \
api.o \
reader.o \
scanner.o \
Expand All @@ -126,6 +135,8 @@ xlc \
polyfill.o \
debugutil.o \
embeddedjs.o \
qjszos.o \
qjsnet.o \
z_atomic.LIB64R.o \
${COMMON}/c/alloc.c \
${COMMON}/c/bpxskt.c \
Expand All @@ -148,13 +159,21 @@ xlc \
${COMMON}/c/xlate.c \
${COMMON}/c/yaml2json.c \
${COMMON}/c/zos.c \
${COMMON}/c/zosfile.c
${COMMON}/c/zosfile.c \
${COMMON}/c/httpclient.c \
${COMMON}/c/http.c \
${COMMON}/c/tls.c \
${COMMON}/c/socketmgmt.c \
${COMMON}/c/fdpoll.c \
${COMMON}/c/jcsi.c \
${GSKDIR}/lib/GSKSSL64.x \
${GSKDIR}/lib/GSKCMS64.x
#then
# echo "Build successful"
# ls -l "${COMMON}/bin"
# exit 0
#else
# # remove configmgr in case the linker had RC=4 and produced the binary
# remove configmgr in case the linker had RC=4 and produced the binary
# rm -f "${COMMON}/bin/configmgr"
# echo "Build failed"
# exit 8
Expand All @@ -168,3 +187,4 @@ xlc \
# SPDX-License-Identifier: EPL-2.0
#
# Copyright Contributors to the Zowe Project.

15 changes: 11 additions & 4 deletions build/build_rexxintf.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
#! /bin/sh

WORKING_DIR=$(dirname "$0")

echo "********************************************************************************"
echo "Building configmgr INTF for REXX"

COMMON="$WORKING_DIR/.."

# Step 0 Libraries

export _LD_SYSLIB="//'SYS1.CSSLIB'://'CEE.SCEELKEX'://'CEE.SCEELKED'://'CEE.SCEERUN'://'CEE.SCEERUN2'://'CSF.SCSFMOD0'://'CBC.SCCNOBJ'"

# Step 1: Build 31-bit program for REXX

xlc -qmetal -DMSGPREFIX=\"JOE\" -DSUBPOOL=132 -DMETTLE=1 "-Wc,longname,langlvl(extc99),goff,ASM,asmlib('CEE.SCEEMAC','SYS1.MACLIB','SYS1.MODGEN')" -I ../h -S ../c/zwecfg31.c ../c/metalio.c ../c/zos.c ../c/qsam.c ../c/timeutls.c ../c/utils.c ../c/alloc.c
xlc -qmetal -DMSGPREFIX=\"ZWE\" -DSUBPOOL=132 -DMETTLE=1 "-Wc,longname,langlvl(extc99),goff,ASM,asmlib('CEE.SCEEMAC','SYS1.MACLIB','SYS1.MODGEN')" -I ${COMMON}/h -S ${COMMON}/c/zwecfg31.c ${COMMON}/c/metalio.c ${COMMON}/c/zos.c ${COMMON}/c/qsam.c ${COMMON}/c/timeutls.c ${COMMON}/c/utils.c ${COMMON}/c/alloc.c

as -mgoff -mobject -mflag=nocont --TERM --RENT -aegimrsx=zwecfg31.asm zwecfg31.s
as -mgoff -mobject -mflag=nocont --TERM --RENT -aegimrsx=alloc.asm alloc.s
Expand All @@ -16,11 +23,11 @@ as -mgoff -mobject -mflag=nocont --TERM --RENT -aegimrsx=zos.asm zos.s
as -mgoff -mobject -mflag=nocont --TERM --RENT -aegimrsx=qsam.asm qsam.s
as -mgoff -mobject -mflag=nocont --TERM --RENT -aegimrsx=metalio.asm metalio.s

ld -b rent -b case=mixed -b map -b xref -b reus -e main -o ../bin/zwecfg31 zwecfg31.o metalio.o qsam.o zos.o timeutls.o utils.o alloc.o
ld -b rent -b case=mixed -b map -b xref -b reus -e main -o ${COMMON}/bin/ZWECFG31 zwecfg31.o metalio.o qsam.o zos.o timeutls.o utils.o alloc.o

# Step 2: Build 64 Bit Metal program to be called from REXX to call LE64

xlc -qmetal -q64 -DMSGPREFIX=\"JOE\" -DMETAL_PRINTF_TO_STDOUT=1 -DSUBPOOL=132 -DMETTLE=1 "-Wc,longname,langlvl(extc99),goff,ASM,asmlib('CEE.SCEEMAC','SYS1.MACLIB','SYS1.MODGEN')" -I ../h -S ../c/rex2le64.c ../c/metalio.c ../c/zos.c ../c/qsam.c ../c/timeutls.c ../c/utils.c ../c/alloc.c
xlc -qmetal -q64 -DMSGPREFIX=\"ZWE\" -DMETAL_PRINTF_TO_STDOUT=1 -DSUBPOOL=132 -DMETTLE=1 "-Wc,longname,langlvl(extc99),goff,ASM,asmlib('CEE.SCEEMAC','SYS1.MACLIB','SYS1.MODGEN')" -I ${COMMON}/h -S ${COMMON}/c/rex2le64.c ${COMMON}/c/metalio.c ${COMMON}/c/zos.c ${COMMON}/c/qsam.c ${COMMON}/c/timeutls.c ${COMMON}/c/utils.c ${COMMON}/c/alloc.c

as -mgoff -mobject -mflag=nocont --TERM --RENT -aegimrsx=rexle64.asm rex2le64.s
as -mgoff -mobject -mflag=nocont --TERM --RENT -aegimrsx=alloc.asm alloc.s
Expand All @@ -30,5 +37,5 @@ as -mgoff -mobject -mflag=nocont --TERM --RENT -aegimrsx=zos.asm zos.s
as -mgoff -mobject -mflag=nocont --TERM --RENT -aegimrsx=qsam.asm qsam.s
as -mgoff -mobject -mflag=nocont --TERM --RENT -aegimrsx=metalio.asm metalio.s

ld -b rent -b case=mixed -b map -b xref -b reus -e main -o ../bin/zwecfg64 rex2le64.o metalio.o qsam.o zos.o timeutls.o utils.o alloc.o
ld -b rent -b case=mixed -b map -b xref -b reus -e main -o ${COMMON}/bin/ZWECFG64 rex2le64.o metalio.o qsam.o zos.o timeutls.o utils.o alloc.o

2 changes: 1 addition & 1 deletion build/configmgr.proj.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PROJECT="configmgr"
VERSION=0.3.0
VERSION=0.4.0
DEPS="QUICKJS LIBYAML"

QUICKJS="quickjs"
Expand Down
6 changes: 3 additions & 3 deletions build/deploy_rexxcmgr.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#! /bin/sh
if [ "$#" -eq 1 ]
then
cp ../bin/zwecfg31 "//'$1(ZWECFG31)'"
cp ../bin/zwecfg64 "//'$1(ZWECFG64)'"
cp ../bin/zwecfgle "//'$1(ZWERXCFG)'"
cp ../bin/ZWECFG31 "//'$1(ZWECFG31)'"
cp ../bin/ZWECFG64 "//'$1(ZWECFG64)'"
cp ../bin/ZWERXCFG "//'$1(ZWERXCFG)'"
else
echo "Bad arguments"
fi
Expand Down
Loading

0 comments on commit a0f729d

Please sign in to comment.