Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updates for patches #11

Merged
merged 11 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean you have the v8port patches directly under $HOME/zopen/dev/patches/? Because this line indicates there is a $HOME/zopen/dev/v8port/ that should contain the patches directory.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the dir structure is like this:

v8port
  \_ v8base
       \_ v8

```

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
Expand All @@ -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
```

Expand All @@ -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
Expand Down Expand Up @@ -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
```



21 changes: 21 additions & 0 deletions buildenv
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,30 @@ 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, you can use $ZOPEN_ROOT instead of relative directories

# 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


# return to v8port/v8base/v8 level
cd ../../../..



Expand Down
74 changes: 74 additions & 0 deletions setenv.sh
Original file line number Diff line number Diff line change
@@ -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
Loading