Skip to content

Commit

Permalink
Merge pull request #123 from mainframed/master
Browse files Browse the repository at this point in the history
Conversion Bugs Fixed and new Remote building added
  • Loading branch information
Peter-Jacob authored May 30, 2024
2 parents b984540 + 77b5edc commit 94c624b
Show file tree
Hide file tree
Showing 15 changed files with 285 additions and 147 deletions.
31 changes: 23 additions & 8 deletions build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
# change the following variables to fit your needs
#

# The location of the jcc compiler folder
JCCFOLDER := ../../jcc
# The location of rdrprep
RDRPREP := rdrprep
# The number of seconds to wait for a job to complete
TIMEOUT := 120

# SYSTEM determines how you want to build BREXX
#
Expand All @@ -24,7 +28,13 @@ RDRPREP := rdrprep
# webserver must be enabled to use this make file.
#
# Remote systems:
# Unfortunately remote systems aren't supported
# Building on remote systems is possible with the REXX script AUTOMVS.REXX
# which is available here: https://github.com/MVS-sysgen/automvs/tree/main/REXX
# Place the REXX script in the SYS2.EXEC dataset and place the JCL file in the
# SYS2.PROCLIB dataset. Then from the master console run the command
# 'START AUTOMVS' (in hercules this would be '/START AUTOMVS'). More information
# is available at the automvs github. Once installed and running you can
# uncomment the Remote System lines below.
#
# -----------------------
#SYSTEM := MVSCE
Expand All @@ -35,6 +45,7 @@ SYSTEM := TK5
# -----------------------
MVSCEHOST := 127.0.0.1
MVSCEPORT := 3505
MVSCEWEB := 8888
MVSCEUSER := IBMUSER
MVSCEPASS := SYS1
MVSCEFOLDER := /MVSCE
Expand All @@ -57,6 +68,10 @@ TK4USER := HERC01
TK4PASS := CUL8TR
TK4FOLDER := /tk4-
# -----------------------
# Remote System
# -----------------------
#REMOTEPORT := 9856
# -----------------------
# NJE38
# -----------------------
#
Expand All @@ -66,9 +81,7 @@ TK4FOLDER := /tk4-
# uncoment this line:
# NJE=YES
#
# by default it will send to MSGCLASS A or H, set
# CUSTOMCLASS below if you want to use a different class
CUSTOMCLASS := A
#

# Uncomment this line if you want verbose console logging
#DEBUG := -d
Expand All @@ -89,7 +102,7 @@ BUILDER := python3 builder.py
########################################
SHELL := /bin/bash
VERSION=$(shell grep "VERSION " ../inc/rexx.h|awk '{gsub(/"/, "", $$3); print $$3}')

REMOTE_PORT := --remote_port $(REMOTEPORT)

SRC_DIRS := ../src ../lstring ../rac ../dynit ../fss ../map ../smf ../regex
INC_DIRS := $(JCCINCS) ../inc ../rac ../dynit ../fss ../map ../smf ../regex ../cross
Expand Down Expand Up @@ -139,11 +152,11 @@ ifdef LEVEL
endif

ifeq ($(SYSTEM),TK5)
BUILDER := $(BUILDER) $(DEBUG) -s $(SYSTEM) -f $(TK5FOLDER) -u $(TK5USER) -p $(TK5PASS)
BUILDER := $(BUILDER) --timeout $(TIMEOUT) $(DEBUG) -s $(SYSTEM) -f $(TK5FOLDER) -u $(TK5USER) -p $(TK5PASS) $(REMOTE_PORT) --ip $(TK5HOST) --punch $(TK5PORT) --web $(TK5WEB)
else ifeq ($(SYSTEM),TK4-)
BUILDER := $(BUILDER) $(DEBUG) -s $(SYSTEM) -f $(TK4FOLDER) -u $(TK4USER) -p $(TK4PASS)
BUILDER := $(BUILDER) --timeout $(TIMEOUT) $(DEBUG) -s $(SYSTEM) -f $(TK4FOLDER) -u $(TK4USER) -p $(TK4PASS) $(REMOTE_PORT) --ip $(TK4HOST) --punch $(TK4PORT) --web $(TK4WEB)
else ifeq ($(SYSTEM),MVSCE)
BUILDER := $(BUILDER) $(DEBUG) -s $(SYSTEM) -f $(MVSCEFOLDER) -u $(MVSCEUSER) -p $(MVSCEPASS)
BUILDER := $(BUILDER) --timeout $(TIMEOUT) $(DEBUG) -s $(SYSTEM) -f $(MVSCEFOLDER) -u $(MVSCEUSER) -p $(MVSCEPASS) $(REMOTE_PORT) --ip $(MVSCEHOST) --punch $(MVSCEPORT) --web $(MVSCEWEB)
else
@echo "Unknown system specified: $(SYSTEM)"
@exit 1
Expand Down Expand Up @@ -275,6 +288,8 @@ metal.objp: ../metal/metal.c ../printf/printf.c SVC.punch GETSA.punch
irxexcom.objp: ../lstring/upper.c ../lstring/lstring.c ../src/bintree.c ../irx/irxexcom.c
@echo "# Compiling ../lstring/upper.c"
@$(CC) $(INC_FLAGS) $(D_FLAGS) -D__METAL_C__ -o -fstk -systemr ../lstring/upper.c >> jcc.log 2>&1 && ([ $$? -eq 0 ] && true) || { cat jcc.log; exit 1; }
@echo "# Compiling ../src/lstring.c"
@$(CC) $(INC_FLAGS) $(D_FLAGS) -D__METAL_C__ -o -fstk -systemr ../lstring/lstring.c >> jcc.log 2>&1 && ([ $$? -eq 0 ] && true) || { cat jcc.log; exit 1; }
@echo "# Compiling ../src/bintree.c"
@$(CC) $(INC_FLAGS) $(D_FLAGS) -D__METAL_C__ -o -fstk -systemr ../src/bintree.c >> jcc.log 2>&1 && ([ $$? -eq 0 ] && true) || { cat jcc.log; exit 1; }
@echo "# Compiling ../irx/irxexcom.c"
Expand Down
81 changes: 56 additions & 25 deletions build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,17 @@ BREXX/370 on MVS/CE, TK4- and TK5.
## Requirements

Before using this build engine you must have one of the following depending
on which version of MVS3.8j you have. Unfortunately only locally installed
MVS3.8j installs are supported at this time.
on which version of MVS3.8j you have.

### TK5

To use TK5 to build BREXX/370 you need to:

1. download the current version of TK5 and decompress
2. Run TK5 with `./mvs` in the TK5 folder and wait for it to boot
3. Either edit the `Makefile` and change the various TK5 setting like
3. Either edit the `Makefile` and change the various TK5 settingS
to match your setup, or change them at runtime. e.g.
`make TK5FOLDER=/home/test/MVSCE` (this applies to all make steps)
4. Either edit the `Makefile`, comment out `SYSTEM=MVSCE` and uncomment
`SYSTEM=TK5` or run make with `make SYSTEM=TK5` (this applies to all make steps)

### MVS/CE

Expand All @@ -30,7 +27,9 @@ To use MVS/CE to build BREXX/370 you need to:
2. Install hercules and make sure it is in your `$PATH`
3. Either edit the `Makefile` and change the various MVS/CE setting like
`MVSCEFOLDER` to match your setup, or change them at runtime:
`make MVSCEFOLDER=/home/test/MVSCE`
`make MVSCEFOLDER=/home/test/MVSCE` (this applies to all make steps)
4. Either edit the `Makefile`, comment out `SYSTEM=TK5` and uncomment
`SYSTEM=MVSCE` or run make with `make SYSTEM=MVSCE` (this applies to all make steps)

### TK4-

Expand All @@ -41,8 +40,8 @@ To use TK4- to build BREXX/370 you need to:
3. Either edit the `Makefile` and change the various TK5 setting like
to match your setup, or change them at runtime. e.g.
`make TK4FOLDER=/home/test/MVSCE` (this applies to all make steps)
4. Either edit the `Makefile`, comment out `SYSTEM=MVSCE` and uncomment
`SYSTEM=TK4` or run make with `make SYSTEM=TK4` (this applies to all make steps)
4. Either edit the `Makefile`, comment out `SYSTEM=TK5` and uncomment
`SYSTEM=TK4-` or run make with `make SYSTEM=TK4-` (this applies to all make steps)

### JCC

Expand All @@ -62,10 +61,10 @@ https://github.com/mvslovers/rdrprep.
The `builder.py` script makes heavy use of the automvs pypi library. Install it
with `pip install automvs`.

### Documation
### Documentation

If you're building a release version you need to also install the required
libraries for sphinx:
If you're building a release version (or when you run `make clean`) you
need to also install the required libraries for sphinx:


```
Expand All @@ -75,10 +74,39 @@ pip install rst2pdf
pip install sphinx_markdown_builder
```

## Remote

This build engine supports remote building of BREXX using the AUTOMVS rexx script.
You can obtain that script and instructions on how to install from here:

https://github.com/MVS-sysgen/automvs/tree/main/REXX

After install you can run it from hercules with `/s automvs` which will run
on the default port 9856. You can then enable remote building by uncommenting
the `REMOTEPORT` line in the Makefile in the **Remote System** section and making sure the
`TK5HOST` or `TK4HOST` ip address is set correctly.

You can also make remote builds, without editing the Makefile, from the
command line after you've started AUTOMVS by passing the `REMOTEPORT` and
`<system>HOST` arguments:

```
$ cd project/build
$ make SYSTEM=TK4 REMOTEPORT=9856 TK4HOST=testing.mainframe.tk5
$ make SYSTEM=TK4 REMOTEPORT=9856 TK4HOST=testing.mainframe.tk5 test
$ make SYSTEM=TK4 REMOTEPORT=9856 TK4HOST=testing.mainframe.tk5 release
```

:warning: Unlike the local builds, remote builds will not produce a final
ZIP file releases. This is due to the XMIT file being too large for the
file read function and BREXX running out of memory.


## Makefile

The makefile contains multiple targets to build specific components. You can
also run these make commands from the brexx370 root folder.
run these make commands from the brexx370 root folder or from this build
folder.

Make options:

Expand All @@ -97,10 +125,10 @@ Make options:
files that are typically generated by `builder.py` and places them in this
folder. Each file is named after the step. This is typically used for
educational purposes.
- `make check` - Due to the way files are uploaded to the system files that
- `make check` - Due to the way files are uploaded to the system, files that
have lines that are longer than 80 columns wide will be truncated. To prevent
this from happening accidentally this step checks all the files in `rxlib`,
`jcl`, `proclib`, `cmdlib`, and `samples` and fails identifies any lines
`jcl`, `proclib`, `cmdlib`, and `samples` and fails if it identifies any lines
longer than 80 characters. This step is included when running `make release`.

### Make arguments:
Expand Down Expand Up @@ -168,18 +196,17 @@ python3 builder.py -s MVSCE -f /MVSCE -u IBMUSER -p SYS1 --RXMVSEXT
## Container

To make building easier a docker container with all three MVS3.8j versions
mentioned above has been created. To use the docker container you can run the
mentioned above has been created. To use the docker container you can run one of the
following (make sure you're in the root of this repository):


**MVS/CE Build**

```
$ docker run -it --entrypoint /bin/bash -v $(pwd):/project mainframed767/brexx:latest
# cd project/build
# make
# make test
# make release
# make SYSTEM=MVSCE
# make test SYSTEM=MVSCE
# make release SYSTEM=MVSCE
```

**TK5 Build**
Expand All @@ -192,23 +219,27 @@ $ docker run -it --entrypoint /bin/bash -v $(pwd):/project mainframed767/brexx:l
# /run.sh /mvs-tk5/
# /home/hercules/loaded.sh
# cd project/build
# make SYSTEM=TK5
# make SYSTEM=TK5 test
# make SYSTEM=TK5 release
# make
# make test
# make release
```

**TK4 Build**
**TK4- Build**

Note: `/run.sh` starts TK5 silently. `/home/hercules/loaded.sh` will print a `.`
Note: `/run.sh` starts TK4- silently. `/home/hercules/loaded.sh` will print a `.`
once a second and returns when TK5 is fully IPL'd.

```
$ docker run -it --entrypoint /bin/bash -v $(pwd):/project mainframed767/brexx:latest
# /run.sh /mvs-tk5/
# /run.sh /tk4-/
# /home/hercules/loaded.sh
# cd project/build
# make SYSTEM=TK4
# make SYSTEM=TK4 test
# make SYSTEM=TK4 release
```

## Build Failures

Occasionally the hercules emulator or the jcc compiler will crash which will cause
make to fail. Typically restarting tk4-/tk5 will fix the issue.
Loading

0 comments on commit 94c624b

Please sign in to comment.