From 8227b17d7e6cf108c2211d77774427c92a8bb9ca Mon Sep 17 00:00:00 2001 From: "John F. Davis" Date: Thu, 29 Feb 2024 14:06:03 -0500 Subject: [PATCH 01/11] updates for patches --- README.md | 23 +++++++++++++---- buildenv | 19 ++++++++++++++ setenv.sh | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 111 insertions(+), 5 deletions(-) create mode 100755 setenv.sh diff --git a/README.md b/README.md index 42abb34..f331c61 100644 --- a/README.md +++ b/README.md @@ -193,14 +193,14 @@ v8port/patches/. Adjust the path to v8port to match your environment. Example: This is a large patch which updates multiple portions of the codebase. ``` $ cd $HOME/zopen/dev/v8base/v8 -$ git apply ../../v8port/patches/git.20231122.fce38915e4.diff +$ git apply ../../patches/git.20231122.fce38915e4.diff ``` This is a small patch which updates the toolchain config. ``` $ cd $HOME/zopen/dev/v8base/v8 $ pushd build -$ git apply ../../../v8port/patches/build/git.20231122.968682938b.diff +$ git apply ../../patches/build/git.20231122.968682938b.diff $ popd ``` From this point forward, `pushd/popd` is used so that the directory @@ -209,14 +209,14 @@ is not specifed each time. This is a small patch which updates the third-party abseil common c++ libaries. ``` $ pushd third_party/abseil-cpp -$ git apply ../../../../v8port/patches/third_party/abseil-cpp/git.20231122.1e8861f03f.diff +$ git apply ../../../../patches/third_party/abseil-cpp/git.20231122.1e8861f03f.diff $ popd ``` This is a tiny patch which adds a new ZOS platform to google test. ``` $ pushd third_party/googletest/src -$ git apply ../../../../../v8port/patches/third_party/googletest/src/git.20231122.af29db7ec2.diff +$ git apply ../../../../../patches/third_party/googletest/src/git.20231122.af29db7ec2.diff $ popd ``` @@ -228,7 +228,7 @@ using the same approach. Example: ``` $ cd $HOME/zopen/dev/v8base/v8 -$ pax -p p -rzf ../../v8port/patches/src.zos.20231122.fce38915e4.pax +$ pax -p p -rzf ../../patches/src.zos.20231122.fce38915e4.pax $ pushd buildtools $ pax -p p -rzf ../../../v8port/patches/buildtools/buildtools.zos.20231122.92b79f4d75.pax @@ -318,4 +318,17 @@ fetch the v8 source code. Afterwards, source this venv via `. ${HOME}/zopen/usr/local/zopen/v8/v8-DEV/venv/bin/activate` to work on the repo. +This can be done in a convienece script via + +``` +$ . ./setenv.sh +``` + +or if you want to preserve the hidden `v8base/.gclient` and `v8base/.gclient_entries` + +``` +$ . ./setenv.sh -resume +``` + + diff --git a/buildenv b/buildenv index 49171ce..3f3ea82 100644 --- a/buildenv +++ b/buildenv @@ -141,9 +141,28 @@ zopen_build() { # use the specified commit hash echo "git reset fce38915e4c7c73c0e7f77bb13e2a78514968d35 --hard" git reset fce38915e4c7c73c0e7f77bb13e2a78514968d35 --hard + # Modify DEPS via sed + echo "Modify DEPS via sed" + sed -i -f../../patches/DEPS.sed DEPS # Use depot tools gclient sync echo "gclient sync -D" gclient sync -D + # + # echo apply patches + # + echo "Apply patch for overall repo" + git apply ../../patches/git.20231122.fce38915e4.diff + echo "Apply patch for toolchain config" + cd build + git apply ../../../patches/build/git.20231122.968682938b.diff + echo "Apply patch for abseil c++ libaries" + cd ../third_party/abseil-cpp + git apply ../../../../patches/third_party/abseil-cpp/git.20231122.1e8861f03f.diff + echo "Apply patch for googletest" + cd ../googletest/src + git apply ../../../../../patches/third_party/googletest/src/git.20231122.af29db7ec2.diff + + diff --git a/setenv.sh b/setenv.sh new file mode 100755 index 0000000..6d8fa3b --- /dev/null +++ b/setenv.sh @@ -0,0 +1,74 @@ +#!/bin/sh + +# The path and environment variables are updated as a result of the package install. +# However, if the user installs the package and does not run the zopen-config +# command in the current shell, then the path will not be there yet. In +# this case check for the path in the current path. + +desired_path="zopen/usr/local/zopen/depot_tools/depot_tools-main" + +if expr "${PATH}" : ".*${desired_path}.*" 1>/dev/null ; then + echo "Good. depot_tools is in path." +else + echo "Path to depot_tools missing. Adding it to path.." + export PATH=${PATH}:${HOME}/${desired_path} +fi + + +# activate the virtual env +echo "activating the virtual env - venv" +. ${HOME}/zopen/usr/local/zopen/v8/v8-DEV/venv/bin/activate + +# update the virtual env +python -m pip install -U pip + + +# install the necessary requirements +echo "Installing packages via requirements.txt..." +pip install -r ${HOME}/zopen/usr/local/zopen/v8/v8-DEV/requirements.txt + +# Using depot_tools disable metrics. +# Comment out this line if you wish to participate. +gclient metrics --opt-out + + +# provide a mechanism to resume work on v8 versus +# ensure pristine. Assume by default the user +# desires a pristine state and a fresh fetch. +RESUME=0 +while [ $# -gt 0 ]; do + case "$1" in + -resume) + echo "-resume switch used. Skipping .gclient* delete" + RESUME=1 + shift + ;; + -optionx) + echo "option x used with value $2" + echo "TODO: nothing to do yet" + shift 2 + ;; + *) + echo "unknown option" + echo "USAGE: $0 [-resume]" + exit 1 + ;; + esac +done + +# remove any previous attempts of fetch +# so as to pull a fresh copy. If this is the first time building +# depot tools, these file will not be present and thus +# no need to attempt to remove them. +# NOTE: assuming v8 will be built in $HOME/zopen/dev/v8port/v8base +if [ ${RESUME} -eq 0 ]; then + echo "Attempting to delete any leftover .gclient* entries" + if [ -d "${HOME}/zopen/dev/v8port/v8base" ]; then + if [ -f "${HOME}/zopen/dev/v8port/v8base/.gclient_entries" ]; then + rm ${HOME}/zopen/dev/v8port/v8base/.gclient_entries + fi + if [ -f "${HOME}/zopen/dev/v8port/v8base/.gclient" ]; then + rm ${HOME}/zopen/dev/v8port/v8base/.gclient + fi + fi +fi From 613f52059a8680b10fac2a099274858d567e9916 Mon Sep 17 00:00:00 2001 From: "John F. Davis" Date: Thu, 29 Feb 2024 14:12:59 -0500 Subject: [PATCH 02/11] updates for patches --- buildenv | 2 ++ 1 file changed, 2 insertions(+) diff --git a/buildenv b/buildenv index 3f3ea82..3767e5c 100644 --- a/buildenv +++ b/buildenv @@ -163,6 +163,8 @@ zopen_build() { git apply ../../../../../patches/third_party/googletest/src/git.20231122.af29db7ec2.diff + # return to v8port/v8base/v8 level + cd ../../../.. From 378fcabfdb70036283c645e1140c26de1b3fa5b9 Mon Sep 17 00:00:00 2001 From: "John F. Davis" Date: Fri, 1 Mar 2024 13:20:49 -0500 Subject: [PATCH 03/11] wip --- buildenv | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/buildenv b/buildenv index 3767e5c..19b9a60 100644 --- a/buildenv +++ b/buildenv @@ -148,7 +148,7 @@ zopen_build() { echo "gclient sync -D" gclient sync -D # - # echo apply patches + # apply patches # echo "Apply patch for overall repo" git apply ../../patches/git.20231122.fce38915e4.diff @@ -161,10 +161,20 @@ zopen_build() { echo "Apply patch for googletest" cd ../googletest/src git apply ../../../../../patches/third_party/googletest/src/git.20231122.af29db7ec2.diff - - + # return to v8port/v8base/v8/third_party level + cd ../.. # return to v8port/v8base/v8 level - cd ../../../.. + cd .. + # + # apply pax files + # + echo "Apply pax files to overall repo" + pax -p p -rzf ../../patches/src.zos.20231122.fce38915e4.pax + echo "Apply pax files to buildtools" + cd buildtools + pax -p p -rzf ../../../patches/buildtools/buildtools.zos.20231122.92b79f4d75.pax + cd .. + From fb04e4e36206f8c9321dd2d7ca144b7bc2a5963f Mon Sep 17 00:00:00 2001 From: "John F. Davis" Date: Fri, 1 Mar 2024 16:04:13 -0500 Subject: [PATCH 04/11] wip --- README.md | 6 +++++- buildenv | 9 +++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f331c61..72a5102 100644 --- a/README.md +++ b/README.md @@ -308,7 +308,11 @@ This is the workflow for building v8 using the z/OS Open Tools framework. 2. Currently v8port is still in developer form - `$ cd ${HOME}/zopen/dev` - `$ git clone git@github.com:ZOSOpenTools/v8port.git` -3. Start the build process +3. The build process will use git via ssh. If you have a passphrase + for your ssh key, do the following: + - `$ eval \`ssh-agent\`` + - `$ ssh-add ${HOME}/.ssh/some_private_ssh_key` +4. Start the build process - `$ cd ${HOME}/zopen/dev/v8port` - `$ rm -rf ~/.local v8base install ${HOME}/zopen/usr/local/zopen/v8 venv log; zopen build` diff --git a/buildenv b/buildenv index 19b9a60..8a469bc 100644 --- a/buildenv +++ b/buildenv @@ -173,6 +173,15 @@ zopen_build() { echo "Apply pax files to buildtools" cd buildtools pax -p p -rzf ../../../patches/buildtools/buildtools.zos.20231122.92b79f4d75.pax + # return to v8port/v8base/v8 level + cd .. + # + # download and build zoslib from IBMRuntimes + # + cd third_party + git clone git@github.com:ibmruntimes/zoslib + ./build.sh -c -r -t + # return to v8port/v8base/v8 level cd .. From 5d143eb95c3e8915973e2af8b7a7adfc02d500c7 Mon Sep 17 00:00:00 2001 From: "John F. Davis" Date: Fri, 1 Mar 2024 16:06:18 -0500 Subject: [PATCH 05/11] wip --- buildenv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/buildenv b/buildenv index 8a469bc..f2dafb1 100644 --- a/buildenv +++ b/buildenv @@ -180,9 +180,10 @@ zopen_build() { # cd third_party git clone git@github.com:ibmruntimes/zoslib + cd zoslib ./build.sh -c -r -t # return to v8port/v8base/v8 level - cd .. + cd ../.. From 932d8afba2de46efe5675cbe4f4e6de89ae72eca Mon Sep 17 00:00:00 2001 From: "John F. Davis" Date: Mon, 4 Mar 2024 10:58:43 -0500 Subject: [PATCH 06/11] wip --- setenv.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/setenv.sh b/setenv.sh index 6d8fa3b..90d917b 100755 --- a/setenv.sh +++ b/setenv.sh @@ -72,3 +72,18 @@ if [ ${RESUME} -eq 0 ]; then fi fi fi + +# start ssh-agent so that the git operations can +# be done without issuing passphrase during automated +# builds. +if ps -A | grep ssh-agent; then + echo "ssh-agent is already running" +else + echo "ssh-agent is not ot running" + echo "starting now..." + eval `ssh-agent` + ssh-add ${HOME}/.ssh/id_ed25519 +fi + + + From 2c2a3514d6c8258c57c5b227dfc8abfbbe3494ac Mon Sep 17 00:00:00 2001 From: "John F. Davis" Date: Wed, 6 Mar 2024 15:29:58 -0500 Subject: [PATCH 07/11] wip --- README.md | 11 +++++++++++ buildenv | 24 +++++++++++++++++++++--- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 72a5102..c36830b 100644 --- a/README.md +++ b/README.md @@ -335,4 +335,15 @@ $ . ./setenv.sh -resume ``` +``` +cd v8base/v8 +git stash +pushd third_party/abseil-cpp && git stash && popd +pushd third_party/googletest/src && git stash && popd +pushd third_party/fuzztest/src && git stash && popd +pushd third_party/re2/src && git stash && popd +pushd build && git stash && popd +sed -i -f../../patches/DEPS.sed DEPS +``` + diff --git a/buildenv b/buildenv index f2dafb1..b2d8adb 100644 --- a/buildenv +++ b/buildenv @@ -22,7 +22,6 @@ export ZOPEN_CATEGORIES="development language core" - zopen_check_results() { dir="$1" @@ -65,6 +64,8 @@ zopen_init() zopen_build() { echo "### zopen_build ###" + # enable tracing. + set -x # Ensure path is correct for depot tools installation desired_path="zopen/usr/local/zopen/depot_tools/depot_tools-main" @@ -85,9 +86,21 @@ zopen_build() { # update the compiler settings # TODO: this can probably be moved to v8 build later + # will be set via zopen build + echo "BEFORE CC: ${CC}" + echo "BEFORE CXX: ${CXX}" + echo "BEFORE LINK: ${LINK}" + echo "BEFORE CFLAGS=$CFLAGS" + echo "BEFORE CXXFLAGS=$CXXFLAGS" + unset CFLAGS CXXFLAGS export CC=clang export CXX=clang++ export LINK=clang++ + echo "CC: ${CC}" + echo "CXX: ${CXX}" + echo "LINK: ${LINK}" + echo "CFLAGS=$CFLAGS" + echo "CXXFLAGS=$CXXFLAGS" # Disable updating depot_tools export DEPOT_TOOLS_UPDATE=0 @@ -136,8 +149,8 @@ zopen_build() { echo "git checkout main" git checkout main # pull - echo "git pull" - git pull + #echo "git pull" + #git pull # use the specified commit hash echo "git reset fce38915e4c7c73c0e7f77bb13e2a78514968d35 --hard" git reset fce38915e4c7c73c0e7f77bb13e2a78514968d35 --hard @@ -160,6 +173,8 @@ zopen_build() { git apply ../../../../patches/third_party/abseil-cpp/git.20231122.1e8861f03f.diff echo "Apply patch for googletest" cd ../googletest/src + # TODO: + # ZOPEN_ROOT <- this is buildenv dir git apply ../../../../../patches/third_party/googletest/src/git.20231122.af29db7ec2.diff # return to v8port/v8base/v8/third_party level cd ../.. @@ -190,6 +205,9 @@ zopen_build() { # on exit return to the top level of the git repo cd ../.. + + # disable tracing + set +x } From bdffa948ff14845d12f9d0471e7bde99277a53e5 Mon Sep 17 00:00:00 2001 From: "John F. Davis" Date: Fri, 8 Mar 2024 12:51:08 -0500 Subject: [PATCH 08/11] wip --- buildenv | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/buildenv b/buildenv index b2d8adb..9ca2c19 100644 --- a/buildenv +++ b/buildenv @@ -65,7 +65,7 @@ zopen_build() { echo "### zopen_build ###" # enable tracing. - set -x + #set -x # Ensure path is correct for depot tools installation desired_path="zopen/usr/local/zopen/depot_tools/depot_tools-main" @@ -90,17 +90,20 @@ zopen_build() { echo "BEFORE CC: ${CC}" echo "BEFORE CXX: ${CXX}" echo "BEFORE LINK: ${LINK}" - echo "BEFORE CFLAGS=$CFLAGS" - echo "BEFORE CXXFLAGS=$CXXFLAGS" - unset CFLAGS CXXFLAGS + echo "BEFORE LDFLAGS: ${LDFLAGS}" + echo "BEFORE CFLAGS: ${CFLAGS}" + echo "BEFORE CXXFLAGS: ${CXXFLAGS}" + echo "unset c/xxflags and set CC/CXX/LINK" + unset CFLAGS CXXFLAGS LDFLAGS export CC=clang export CXX=clang++ export LINK=clang++ echo "CC: ${CC}" echo "CXX: ${CXX}" echo "LINK: ${LINK}" - echo "CFLAGS=$CFLAGS" - echo "CXXFLAGS=$CXXFLAGS" + echo "LDFLAGS: ${LDFLAGS}" + echo "CFLAGS: ${CFLAGS}" + echo "CXXFLAGS: ${CXXFLAGS}" # Disable updating depot_tools export DEPOT_TOOLS_UPDATE=0 @@ -159,7 +162,7 @@ zopen_build() { sed -i -f../../patches/DEPS.sed DEPS # Use depot tools gclient sync echo "gclient sync -D" - gclient sync -D + gclient sync -D -v # # apply patches # @@ -197,8 +200,21 @@ zopen_build() { git clone git@github.com:ibmruntimes/zoslib cd zoslib ./build.sh -c -r -t + # + # Prepare v8 for building + # + export ZOSLIB_LIBPATH=${ZOPEN_ROOT}/v8base/v8/third_party/zoslib/install/lib + export PATH=${ZOPEN_ROOT}/v8base/v8/buildtools/zos:$PATH # for the 'ar' wrapper + cd buildtools/zos + ln -s ${HOME}/zopen/dev/gnport/gn/out/gn . # return to v8port/v8base/v8 level - cd ../.. + cd ../../../.. + + # + # Do the v8 build + # + gn -v gen out/zos_s390x.release --args="is_debug=false treat_warnings_as_errors=false" + V=1 ninja -v -j 12 -C out/zos_s390x.release/ @@ -207,7 +223,7 @@ zopen_build() { cd ../.. # disable tracing - set +x + #set +x } From 17ba52f01a392d33fa813a2eec28fcac9741e4c8 Mon Sep 17 00:00:00 2001 From: "John F. Davis" Date: Mon, 11 Mar 2024 14:04:25 -0400 Subject: [PATCH 09/11] wip --- buildenv | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/buildenv b/buildenv index 9ca2c19..b5fffc8 100644 --- a/buildenv +++ b/buildenv @@ -200,15 +200,21 @@ zopen_build() { git clone git@github.com:ibmruntimes/zoslib cd zoslib ./build.sh -c -r -t + # return to v8port/v8base/v8 level + echo "change dir to v8base/v8 level......" + cd ../.. # # Prepare v8 for building # export ZOSLIB_LIBPATH=${ZOPEN_ROOT}/v8base/v8/third_party/zoslib/install/lib export PATH=${ZOPEN_ROOT}/v8base/v8/buildtools/zos:$PATH # for the 'ar' wrapper cd buildtools/zos + echo "change dir to v8base/v8/buildtools/zos level......" + echo "make link to gn in v8base/v8/buildtools/zos" ln -s ${HOME}/zopen/dev/gnport/gn/out/gn . # return to v8port/v8base/v8 level - cd ../../../.. + echo "change dir to v8base/v8 level......" + cd ../.. # # Do the v8 build @@ -217,10 +223,8 @@ zopen_build() { V=1 ninja -v -j 12 -C out/zos_s390x.release/ - - # on exit return to the top level of the git repo - cd ../.. + cd ${ZOPEN_ROOT} # disable tracing #set +x From 9c1d30fe34f5377689c4159556fc20ecaa216f33 Mon Sep 17 00:00:00 2001 From: "John F. Davis" Date: Tue, 12 Mar 2024 12:47:15 -0400 Subject: [PATCH 10/11] wip --- buildenv | 63 +++++++++++++++++++++++++------------------------------- 1 file changed, 28 insertions(+), 35 deletions(-) diff --git a/buildenv b/buildenv index b5fffc8..17c8a99 100644 --- a/buildenv +++ b/buildenv @@ -87,23 +87,23 @@ zopen_build() { # update the compiler settings # TODO: this can probably be moved to v8 build later # will be set via zopen build - echo "BEFORE CC: ${CC}" - echo "BEFORE CXX: ${CXX}" - echo "BEFORE LINK: ${LINK}" - echo "BEFORE LDFLAGS: ${LDFLAGS}" - echo "BEFORE CFLAGS: ${CFLAGS}" - echo "BEFORE CXXFLAGS: ${CXXFLAGS}" - echo "unset c/xxflags and set CC/CXX/LINK" + #echo "BEFORE CC: ${CC}" + #echo "BEFORE CXX: ${CXX}" + #echo "BEFORE LINK: ${LINK}" + #echo "BEFORE LDFLAGS: ${LDFLAGS}" + #echo "BEFORE CFLAGS: ${CFLAGS}" + #echo "BEFORE CXXFLAGS: ${CXXFLAGS}" + #echo "unset c/xxflags and set CC/CXX/LINK" unset CFLAGS CXXFLAGS LDFLAGS export CC=clang export CXX=clang++ export LINK=clang++ - echo "CC: ${CC}" - echo "CXX: ${CXX}" - echo "LINK: ${LINK}" - echo "LDFLAGS: ${LDFLAGS}" - echo "CFLAGS: ${CFLAGS}" - echo "CXXFLAGS: ${CXXFLAGS}" + #echo "CC: ${CC}" + #echo "CXX: ${CXX}" + #echo "LINK: ${LINK}" + #echo "LDFLAGS: ${LDFLAGS}" + #echo "CFLAGS: ${CFLAGS}" + #echo "CXXFLAGS: ${CXXFLAGS}" # Disable updating depot_tools export DEPOT_TOOLS_UPDATE=0 @@ -151,15 +151,12 @@ zopen_build() { # checkout main echo "git checkout main" git checkout main - # pull - #echo "git pull" - #git pull # use the specified commit hash echo "git reset fce38915e4c7c73c0e7f77bb13e2a78514968d35 --hard" git reset fce38915e4c7c73c0e7f77bb13e2a78514968d35 --hard # Modify DEPS via sed echo "Modify DEPS via sed" - sed -i -f../../patches/DEPS.sed DEPS + sed -i -f${ZOPEN_ROOT}/patches/DEPS.sed DEPS # Use depot tools gclient sync echo "gclient sync -D" gclient sync -D -v @@ -167,32 +164,28 @@ zopen_build() { # apply patches # echo "Apply patch for overall repo" - git apply ../../patches/git.20231122.fce38915e4.diff + git apply ${ZOPEN_ROOT}/patches/git.20231122.fce38915e4.diff echo "Apply patch for toolchain config" cd build - git apply ../../../patches/build/git.20231122.968682938b.diff + git apply ${ZOPEN_ROOT}/patches/build/git.20231122.968682938b.diff echo "Apply patch for abseil c++ libaries" - cd ../third_party/abseil-cpp - git apply ../../../../patches/third_party/abseil-cpp/git.20231122.1e8861f03f.diff + cd ${ZOPEN_ROOT}/v8base/v8/third_party/abseil-cpp + git apply ${ZOPEN_ROOT}/patches/third_party/abseil-cpp/git.20231122.1e8861f03f.diff echo "Apply patch for googletest" - cd ../googletest/src - # TODO: - # ZOPEN_ROOT <- this is buildenv dir - git apply ../../../../../patches/third_party/googletest/src/git.20231122.af29db7ec2.diff - # return to v8port/v8base/v8/third_party level - cd ../.. + cd ${ZOPEN_ROOT}/v8base/v8/third_party/googletest/src + git apply ${ZOPEN_ROOT}/patches/third_party/googletest/src/git.20231122.af29db7ec2.diff # return to v8port/v8base/v8 level - cd .. + cd ${ZOPEN_ROOT}/v8base/v8 # # apply pax files # echo "Apply pax files to overall repo" - pax -p p -rzf ../../patches/src.zos.20231122.fce38915e4.pax + pax -p p -rzf ${ZOPEN_ROOT}/patches/src.zos.20231122.fce38915e4.pax echo "Apply pax files to buildtools" cd buildtools - pax -p p -rzf ../../../patches/buildtools/buildtools.zos.20231122.92b79f4d75.pax + pax -p p -rzf ${ZOPEN_ROOT}/patches/buildtools/buildtools.zos.20231122.92b79f4d75.pax # return to v8port/v8base/v8 level - cd .. + cd ${ZOPEN_ROOT}/v8base/v8 # # download and build zoslib from IBMRuntimes # @@ -201,8 +194,7 @@ zopen_build() { cd zoslib ./build.sh -c -r -t # return to v8port/v8base/v8 level - echo "change dir to v8base/v8 level......" - cd ../.. + cd ${ZOPEN_ROOT}/v8base/v8 # # Prepare v8 for building # @@ -213,13 +205,14 @@ zopen_build() { echo "make link to gn in v8base/v8/buildtools/zos" ln -s ${HOME}/zopen/dev/gnport/gn/out/gn . # return to v8port/v8base/v8 level - echo "change dir to v8base/v8 level......" - cd ../.. + cd ${ZOPEN_ROOT}/v8base/v8 # # Do the v8 build # + echo "Generate ninja files using gn..." gn -v gen out/zos_s390x.release --args="is_debug=false treat_warnings_as_errors=false" + echo "Perform build using ninja..." V=1 ninja -v -j 12 -C out/zos_s390x.release/ From aafd3288a457297a38805aa976c5c0098f72f2b4 Mon Sep 17 00:00:00 2001 From: "John F. Davis" Date: Tue, 12 Mar 2024 13:52:29 -0400 Subject: [PATCH 11/11] wip --- README.md | 271 ------------------------------------------------------ 1 file changed, 271 deletions(-) diff --git a/README.md b/README.md index c36830b..0c48470 100644 --- a/README.md +++ b/README.md @@ -39,266 +39,6 @@ The manual workflow to build v8port requires the following: -## Manual Workflow - -#### Applying the patches -Since the [cipd executable](https://chromium.googlesource.com/infra/luci/luci-go/+/master/cipd/) is not yet ported on z/OS, the following steps are -currently used to update V8 and its dependencies, and apply the z/OS port, after -the initial [fetch v8](https://v8.dev/docs/source-code) (also included below with a comment). - -This workflow requires two platforms. One a z/OS® UNIX System Services (z/OS UNIX) which is -the target platform. The second is a generic platform used to get files normally acquired via `cipd`. - - -### Linux platform (non z/OS® UNIX System Services (z/OS UNIX)) setup - -This is the workflow on the non-z/OS UNIX platform for obtaining files via `cipd`. -There are two aspects to this workflow. One which is done once and one which -is done everytime you want to sync. - -This workflow is done once. - -``` -$ cd $HOME -$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git -$ export PATH=~/depot_tools:$PATH -``` - -As an aside, if you have done this already and you are trying to repeat -from a pristine state, remove all the old `.gclient*` files at the -level of v8 before continuing. - -``` -$ cd $HOME -$ rm .gclient* -``` - -``` -$ fetch v8 -$ cd $HOME/v8 -$ git checkout main -``` -This workflow is done afterwards and everytime you want to sync. - -``` -$ cd $HOME/v8 -$ git pull -$ git reset fce38915e4c7c73c0e7f77bb13e2a78514968d35 --hard -$ gclient sync -D -$ tar -cvf x.tar test tools third_party -``` - -Note, the resultant tar file is 2.4GB. Use sftp rather than scp -to transfer the file to z/OS UNIX platform. -Due to large file size use md5sum to verify the hash on -each platform like so: - -``` -$ md5sum x.tar -``` - - -### z/OS® UNIX System Services (z/OS UNIX) platform setup - -This is the workflow on the z/OS® UNIX System Services (z/OS UNIX) platform. - -It assumes you are using z/OS Open Tools framework and the associated install -of depot_toolsport. Follow the workflow described [here](https://github.com/ZOSOpenTools/depot_toolsport?tab=readme-ov-file#developer-notes) to ensure you have depot tools properly installed -and configured. - -##### Do this once - -This uses zopen depot tools port to obtain a copy of the v8 source -according to the v8 workflow. - -``` -$ mkdir $HOME/zopen/dev/v8base -$ cd $HOME/zopen/dev/v8base -$ fetch v8 -``` - -Obtain a valid git repo. - -``` -$ cd $HOME/zopen/dev/v8base/v8 -$ git checkout main -``` - -##### Do this afterwards and everytime you need to sync - -Once you have done the initial setup above, these are the -steps to sync the code to the specified revision and apply the corresponding -files from the Linux AMD64 platform for the files normally -acquired via `cipd`. - -The reset command is required as the current patches are valid as of the specified commit. - -``` -$ cd $HOME/zopen/dev/v8base/v8 -$ git pull -$ git reset fce38915e4c7c73c0e7f77bb13e2a78514968d35 --hard -$ gclient sync -D -$ rm -rf test tools third_party -``` - -At this point the file system is ready to be suplemented with the files -in the tar file from the non z/OS UNIX platform. - -``` -$ cd $HOME/zopen/dev/v8base/v8 -$ tar -xvf $HOME/zopen/x.tar -``` - -Then make sure all the files are properly tagged as ASCII: - -``` -$ cd $HOME/zopen/dev/v8base/v8 -$ chtag -tc819 -R test tools third_party -``` - -Optionally remove the tar file as its not longer needed. It will -need to be replaced if sync is performed, however keep in mind -this will also require the workflow on the non z/OS UNIX platform -to recreate it. - -``` -$ rm x.tar -``` - -Ensure that the commit hash on each platform at the top matches. - -On each system: - -``` -$ git log --oneline -``` - -##### Apply patches and pax files on z/OS UNIX platform - -The .pax files contain only z/OS files, and are intended to easily extract its -content to include those files' directories. Those files are also available in -the repository for review. - -Patch files are named without `.patch` so they're not processed by zopen. The -date in the filenames is the date on which the V8 repository and its -dependencies were pulled; the commit is the head commit of the corresponding -repository at the time of the pull. - -From your local V8 repository or dependency, run `git apply` on the -`git...diff` file that's under the corresponding directory in -v8port/patches/. Adjust the path to v8port to match your environment. Example: - -##### Patch Workflow - -This is a large patch which updates multiple portions of the codebase. -``` -$ cd $HOME/zopen/dev/v8base/v8 -$ git apply ../../patches/git.20231122.fce38915e4.diff -``` - -This is a small patch which updates the toolchain config. -``` -$ cd $HOME/zopen/dev/v8base/v8 -$ pushd build -$ git apply ../../patches/build/git.20231122.968682938b.diff -$ popd -``` -From this point forward, `pushd/popd` is used so that the directory -is not specifed each time. - -This is a small patch which updates the third-party abseil common c++ libaries. -``` -$ pushd third_party/abseil-cpp -$ git apply ../../../../patches/third_party/abseil-cpp/git.20231122.1e8861f03f.diff -$ popd -``` - -This is a tiny patch which adds a new ZOS platform to google test. -``` -$ pushd third_party/googletest/src -$ git apply ../../../../../patches/third_party/googletest/src/git.20231122.af29db7ec2.diff -$ popd -``` - - -##### PAX Workflow - -Extract the files from the .pax files, by running `pax -p p -rzf `, -using the same approach. Example: - -``` -$ cd $HOME/zopen/dev/v8base/v8 -$ pax -p p -rzf ../../patches/src.zos.20231122.fce38915e4.pax - -$ pushd buildtools -$ pax -p p -rzf ../../../v8port/patches/buildtools/buildtools.zos.20231122.92b79f4d75.pax -$ popd -``` - - -##### Download, build and install zoslib: - - -``` -$ cd $HOME/zopen/dev/v8base/v8/third_party -$ git clone git@github.com:ibmruntimes/zoslib -$ cd zoslib -``` - -Ensure the toolchain is set properly. These settings -are also made in the depot_toolsport/setenv.sh script. - -``` -$ export CC=clang -$ export CXX=clang++ -$ export LINK=clang++ -``` - -Build zoslib. - -``` -$ cd $HOME/zopen/dev/v8base/v8/third_party/zoslib -$ ./build.sh -c -r -t -``` - - -Even though zoslib is built as part of V8 as a static library, the shared -library version currently has to be built manually, and is used by -`IsS390SimdSupported()` in `tools/testrunner/local/utils.py`, where it's -dynamically loaded, with its directory extracted from the `ZOSLIB_LIBPATH` -environment variable. So set the variable before running the tests: - - - -``` -$ cd $HOME/zopen/dev/v8base/v8 -$ export ZOSLIB_LIBPATH=`pwd`/third_party/zoslib/install/lib -``` - - -##### Build V8 - - -Prepare v8 for building. - -``` -$ cd $HOME/zopen/dev/v8base/v8 -$ export PATH=`pwd`/buildtools/zos:$PATH # for the 'ar' wrapper -$ pushd buildtools/zos -$ ln -s $HOME/zopen/dev/gnport/gn/out/gn . -$ popd -``` - -Do the build. - -``` -$ gn -v gen out/zos_s390x.release --args="is_debug=false treat_warnings_as_errors=false" -$ V=1 ninja -v -j 12 -C out/zos_s390x.release/ -``` - - - - ## z/OS Open Tools Workflow This is the workflow for building v8 using the z/OS Open Tools framework. @@ -335,15 +75,4 @@ $ . ./setenv.sh -resume ``` -``` -cd v8base/v8 -git stash -pushd third_party/abseil-cpp && git stash && popd -pushd third_party/googletest/src && git stash && popd -pushd third_party/fuzztest/src && git stash && popd -pushd third_party/re2/src && git stash && popd -pushd build && git stash && popd -sed -i -f../../patches/DEPS.sed DEPS -``` -