Archived
1
0

Stop bundling libraries in release

- Instead we now use CentOS 7 for the static build to guarantee
  that we only depend on libc v2.17

- For macOS we now pull in a static node binary and bundle that instead.
This commit is contained in:
Anmol Sethi
2020-06-03 11:41:13 -04:00
parent 02a77b528b
commit 11d7932968
12 changed files with 35 additions and 111 deletions

View File

@ -17,14 +17,6 @@ main() {
mkdir -p "$RELEASE_PATH/bin"
rsync ./ci/build/code-server.sh "$RELEASE_PATH/bin/code-server"
rsync "$node_path" "$RELEASE_PATH/lib/node"
if [[ $OS == "linux" ]]; then
bundle_dynamic_lib libstdc++
bundle_dynamic_lib libgcc_s
elif [[ $OS == "macos" ]]; then
bundle_dynamic_lib libicui18n
bundle_dynamic_lib libicuuc
bundle_dynamic_lib libicudata
fi
ln -s "./bin/code-server" "$RELEASE_PATH/code-server"
ln -s "./lib/node" "$RELEASE_PATH/node"
@ -33,17 +25,4 @@ main() {
yarn --production --frozen-lockfile
}
bundle_dynamic_lib() {
local lib_name="$1"
local lib_path
if [[ $OS == "linux" ]]; then
lib_path="$(ldd "$RELEASE_PATH/lib/node" | grep "$lib_name" | awk '{print $3 }')"
elif [[ $OS == "macos" ]]; then
lib_path="$(otool -L "$RELEASE_PATH/lib/node" | grep "$lib_name" | awk '{print $1 }')"
fi
cp "$lib_path" "$RELEASE_PATH/lib"
}
main "$@"

View File

@ -12,10 +12,10 @@ _realpath() {
# See https://github.com/cdr/code-server/issues/1537
if [ "$(uname)" = "Darwin" ]; then
# We read the symlink, which may be relative from $1.
script="$1"
if [ -L "$script" ]; then
while [ -L "$script" ]; do
# We recursively read the symlink, which may be relative from $script.
script="$(readlink "$script")"
cd "$(dirname "$script")"
done
@ -32,9 +32,4 @@ _realpath() {
}
ROOT="$(dirname "$(dirname "$(_realpath "$0")")")"
if [ "$(uname)" = "Linux" ]; then
export LD_LIBRARY_PATH="$ROOT/lib:${LD_LIBRARY_PATH-}"
elif [ "$(uname)" = "Darwin" ]; then
export DYLD_LIBRARY_PATH="$ROOT/lib:${DYLD_LIBRARY_PATH-}"
fi
exec "$ROOT/lib/node" "$ROOT" "$@"

View File

@ -15,7 +15,8 @@ main() {
./release-standalone/bin/code-server --extensions-dir "$EXTENSIONS_DIR" --install-extension ms-python.python
local installed_extensions
installed_extensions="$(./release-standalone/bin/code-server --extensions-dir "$EXTENSIONS_DIR" --list-extensions 2>&1)"
if [[ $installed_extensions != "ms-python.python" ]]; then
if [[ "$installed_extensions" != "info Using config file ~/.config/code-server/config.yaml
ms-python.python" ]]; then
echo "Unexpected output from listing extensions:"
echo "$installed_extensions"
exit 1