Skip to content

Commit

Permalink
Release 0.2.0 with glibc fix, mac name fix, and build version fix (#15)
Browse files Browse the repository at this point in the history
1. Release 0.2.0.
    1. Only doing Linux and Windows to start due to unexplained build issues right now with MacOS/
    2. Only doing 14.x and 16.x to start due to 12.x failing build on Windows.
2. Improved build process
    1. Increased build timeout to 120 minutes.
    2. Removed patch version pinning on GitHub `actions/cache`.
    3. Set actions cache to be resolved to version of Node.js being built.
3. Converted Linux build to use Centos7 docker container with devtoolset-8 to achieve builds with GCC 8 and a maximum glibc version of 2.17. 
4. If builds fails with Python3 for configuration step they fall back to trying Python2.
5. Bumped `.nvmrc` to Node.js 16.13.0.
  • Loading branch information
code-ape authored Oct 29, 2021
1 parent e5bc120 commit 41c6e4e
Show file tree
Hide file tree
Showing 11 changed files with 125 additions and 28 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/nexe-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ jobs:
build_and_publish:
name: Build nexe
runs-on: ${{ matrix.os }}
timeout-minutes: 90
timeout-minutes: 120
defaults:
run:
shell: bash
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node_version: ['12.21.0', '12.22.6', '14.16.0', '14.18.0', '16.11.0']
#os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest]
#node_version: ['12.21.0', '12.22.6', '14.16.0', '14.18.0', '14.18.1', '16.11.0', '16.13.0']
node_version: ['14.16.0', '14.18.0', '14.18.1', '16.11.0', '16.13.0']

steps:
- uses: actions/checkout@v2
Expand All @@ -29,11 +31,11 @@ jobs:
with:
node-version: ${{ steps.get_node_details.outputs.version }}
- name: Declare caches for build
uses: actions/cache@v2.1.4
uses: actions/cache@v2
with:
path: |
~/.ccache/
key: ${{ matrix.os }}
key: ${{ matrix.os }}-${{ matrix.node_version }}
- run: npm ci
- name: Run nexe CD build
id: run_cd
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/nexe-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ jobs:
shell: bash
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node_version: ['12.21.0', '12.22.6', '14.16.0', '14.18.0', '16.11.0']
#os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest]
#node_version: ['12.21.0', '12.22.6', '14.16.0', '14.18.0', '14.18.1', '16.11.0', '16.13.0']
node_version: ['14.16.0', '14.18.0', '14.18.1', '16.11.0', '16.13.0']

steps:
- uses: actions/checkout@v2
Expand All @@ -29,11 +31,11 @@ jobs:
with:
node-version: ${{ steps.get_node_details.outputs.version }}
- name: Declare caches for build
uses: actions/cache@v2.1.4
uses: actions/cache@v2
with:
path: |
~/.ccache/
key: ${{ matrix.os }}
key: ${{ matrix.os }}-${{ matrix.node_version }}

- run: npm ci
- name: Run nexe CD build
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# From CI/CD process
/RELEASE_ID
/NEXE_ASSET_NAME
/index.js

# Logs
logs
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.16.0
16.13.0
18 changes: 17 additions & 1 deletion RELEASE_LOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
# urbdyn/nexe_builds release log

## 0.2.0

* Created on: 2021-10-29
* Nexe version: 4.0.0-beta.19
* Set Linux build to run in Centos7 container and thus require GLIBC version 2.17 instead of 2.25 that is currently in Linux runner.
* Added `14.18.1` and `16.13.0` (current LTS as of release)
* Fixed bug where all build versions were actually the version in `.nvmrc`.
* Temporarily removing MacOS and 12.x builds to get partial PR complete for this release.
* Build matrix:
* OS: `linux`, `windows`
* Node Version: `14.16.0`, `14.18.0`, `14.18.1`, `16.11.0`, `16.13.0`

## 0.1.1

**DEPRECATED: This resulted in only building the version in .nvmrc, do not use!**

* Created on: 2021-10-10
* Nexe version: 4.0.0-beta.19
* Initial release.
* Updated dependencies
* Build matrix:
* OS: `linux`, `macos`, `windows`
* Node Version: `12.21.0`, `12.22.6`, `14.16.0`, `14.18.0`, `16.11.0`

## 0.1.0

**DEPRECATED: This resulted in only building the version in .nvmrc, do not use!**

* Created on: 2021-03-17
* Nexe version: 4.0.0-beta.18
* Initial release.
Expand Down
6 changes: 6 additions & 0 deletions bin/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM centos:7

RUN yum install -y which python3 centos-release-scl epel-release
RUN yum install -y ccache devtoolset-8

RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
45 changes: 36 additions & 9 deletions bin/build_nexe
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,22 @@ function main(){
echo "No existing build detected. Compiling now."
fi

if command -v ccache &> /dev/null; then
echo "ccache detected!"
export CC="ccache gcc"
export CXX="ccache g++"
if [ "$os_env" = "linux" ]; then
echo "Running: source /opt/rh/devtoolset-8/enable"
source /opt/rh/devtoolset-8/enable

export CC="$(which gcc)"
export CXX="$(which g++)"
echo "$CC --version = $($CC --version)"
echo "$CXX --version = $($CXX --version)"

if command -v ccache &> /dev/null; then
echo "ccache detected!"
export CC="ccache $CC"
export CXX="ccache $CXX"
echo "CC=$CC"
echo "CXX=$CXX"
fi
fi

echo "Creating build directory ($build_dir) ..."
Expand All @@ -89,13 +101,28 @@ function main(){
;;
esac

nexe_cmd="nexe --build --verbose --no-mange --target='$nexe_target' --make=-j$cpu_core_count"
nexe_cmd="$nexe_cmd -o $nexe_no_mangle_path '$repo_dir/index.js'"
python2_path="$(which python2)"
python3_path="$(which python3)"
echo "python2_path=$python2_path"
echo "python3_path=$python3_path"
nexe_part_1_cmd="nexe --build --verbose --no-mange --target=$nexe_target --make=-j$cpu_core_count"
nexe_part_3_cmd="-o $nexe_no_mangle_path '$repo_dir/index.js'"

echo "console.log()" > "$repo_dir/index.js"
echo "Building $nexe_no_mangle_name"
echo "console.log('TEST NEXE SCRIPT'); console.log(process.version); var os = require('os'); console.log('os.userInfo() =', os.userInfo());" > "$repo_dir/index.js"
echo "Building $nexe_no_mangle_name (python 3)"
nexe_cmd="$nexe_part_1_cmd --python=$python3_path $nexe_part_3_cmd"
echo " $nexe_cmd"
time npx $nexe_cmd
set +e
time npx $nexe_cmd || build_failed="true"
set -e
if [ "$build_failed" = "true" ]; then
echo "Trying fallback to python2 ..."
echo "Building $nexe_no_mangle_name (python 2)"
nexe_cmd="$nexe_part_1_cmd --python=$python2_path $nexe_part_3_cmd"
echo " $nexe_cmd"
time npx $nexe_cmd
fi
echo "Build finished."
rm "$repo_dir/index.js"
# Not compressing right now because nexe currently doesn't support downloading
# compressed prebuilt binaries.
Expand Down
7 changes: 3 additions & 4 deletions bin/install_dependencies
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

set -e

repo_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." >/dev/null 2>&1 && pwd )"
script_dir="$repo_dir/bin"
source "$script_dir/bash_utils.sh"
Expand All @@ -14,10 +16,7 @@ case "$os_env" in
set +x
;;
"linux")
echo "Installing Ubuntu dependencies ..."
set -x
sudo apt-get install -y ccache
set +x
echo "Dependencies installed via container (skipping)"
;;
# Temporarily disabling as it was causing build to fail for unknown reasons
#"macos")
Expand Down
45 changes: 44 additions & 1 deletion bin/run_cd
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ set -e

repo_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." >/dev/null 2>&1 && pwd )"
script_dir="$repo_dir/bin"
source "$script_dir/bash_utils.sh"
os_env="$(get_os_type)"

if [ "$NODE_VERSION" = "" ]; then
echo "Please set NODE_VERSION env. var."
Expand All @@ -12,15 +14,55 @@ else
echo "NODE_VERSION=$NODE_VERSION"
fi

if [ "$GITHUB_TOKEN" = "" ]; then
echo "Please set GITHUB_TOKEN env. var."
exit 1
else
echo "GITHUB_TOKEN found"
fi

if [ "$CREATE_RELEASE" = "false" ]; then
check_asset_flags="--no-create-release"
fi
echo "CREATE_RELEASE=$CREATE_RELEASE"

echo "Getting commit hash ..."
GIT_COMMIT="$(git rev-parse HEAD)"
if [ "$GIT_COMMIT" = "" ]; then
export GIT_COMMIT="$(git rev-parse HEAD)"
fi
echo "GIT_COMMIT=$GIT_COMMIT"
echo ""

if [ "$os_env" = "linux" ]; then
if [ "$IN_DOCKER" != "true" ]; then
echo "Doing linux build in docker container ..."
docker build --tag nexe_build_centos_7 "$script_dir/"
echo "Creating container ..."
docker create -t --name nexe_build_centos_7_container \
-v "$repo_dir/bin/:/nexe_build/bin/" -v "$repo_dir/dist/:/nexe_build/dist/" -v "$HOME/.ccache/:/root/.ccache/" \
--env IN_DOCKER=true --env CREATE_RELEASE --env NODE_VERSION --env GIT_COMMIT --env GITHUB_TOKEN \
nexe_build_centos_7 /nexe_build/bin/run_cd || true
# -v "$HOME/.nexe/:/root/.nexe/" \
docker cp "$repo_dir/package.json" "nexe_build_centos_7_container:/nexe_build/package.json"
docker cp "$repo_dir/package-lock.json" "nexe_build_centos_7_container:/nexe_build/package-lock.json"
echo "Starting docker container build ..."
time docker start -a nexe_build_centos_7_container
echo "Completed docker container build."
echo "Copying out files ..."
docker cp "nexe_build_centos_7_container:/nexe_build/NEXE_ASSET_NAME" "$repo_dir/NEXE_ASSET_NAME"
docker cp "nexe_build_centos_7_container:/nexe_build/RELEASE_ID" "$repo_dir/RELEASE_ID"
exit 0
else
echo "Installing desired version of node.js ..."
source ~/.bashrc
nvm install "$NODE_VERSION"
chown -R root:root ~/.nvm/
echo "Running: npm ci"
cd /nexe_build/
npm ci
fi
fi

echo "Running: bin/check_asset"
set +e
$script_dir/check_asset "$NODE_VERSION" "$GIT_COMMIT" $check_asset_flags
Expand All @@ -37,6 +79,7 @@ case "$exit_code" in
$script_dir/install_dependencies || exit 2
echo "Running: bin/build_nexe build $NODE_VERSION"
$script_dir/build_nexe build "$NODE_VERSION" || exit 3
echo "Finished: bin/build_nexe build $NODE_VERSION"
;;
*)
echo "Error exit code detected ($exit_code) from check_asset script! Crashing."
Expand Down
5 changes: 3 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nexe_builds",
"version": "0.1.1",
"version": "0.2.0",
"description": "Cached nexe builds for public use",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 41c6e4e

Please sign in to comment.