32 bit builds (#32)

* Support 32-bit Linux builds

* Update README and correct scripts

* Use npm run instead of npx
This commit is contained in:
Peter Squicciarini 2018-10-04 18:05:05 -04:00 committed by GitHub
parent 1a85464271
commit ae47b31091
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 75 additions and 28 deletions

View file

@ -2,6 +2,9 @@ matrix:
include: include:
- os: linux - os: linux
sudo: required sudo: required
- os: linux
sudo: required
env: BUILDARCH=ia32
- os: osx - os: osx
language: node_js language: node_js
@ -28,6 +31,8 @@ deploy:
file: file:
- ./*.zip - ./*.zip
- ./*.tar.gz - ./*.tar.gz
- vscode/.build/linux/deb/i386/deb/*.deb
- vscode/.build/linux/rpm/i386/*.rpm
- vscode/.build/linux/deb/amd64/deb/*.deb - vscode/.build/linux/deb/amd64/deb/*.deb
- vscode/.build/linux/rpm/x86_64/*.rpm - vscode/.build/linux/rpm/x86_64/*.rpm
on: on:

View file

@ -50,10 +50,11 @@ Microsoft's build process does download additional files. This was brought up in
## <a id="supported-os"></a>Supported OS ## <a id="supported-os"></a>Supported OS
- [x] OSX x64 (zipped app file) - [x] OSX x64 (zipped app file)
- [x] Linux x64 (`.deb`, `.rpm`, and `.tar.gz` files) - [x] Linux x64 (`.deb`, `.rpm`, and `.tar.gz` files)
- [ ] Windows x64 - [x] Linux x86 (`.deb`, `.rpm`, and `.tar.gz` files)
- [ ] Windows
- The plan is to build the Windows executable with [AppVeyor](https://appveyor.com). PRs are welcome :blue_heart: - The plan is to build the Windows executable with [AppVeyor](https://appveyor.com). PRs are welcome :blue_heart:
32-bit x86 and ARM architectures are not currently supported. If you know of a way to do this with Travis or any other free CI/CD platform please put in an issue or a PR. The ARM architecture is not currently supported. If you know of a way to do this with Travis or any other free CI/CD platform please put in an issue or a PR.
## <a id="extensions-marketplace"></a>Extensions + Marketplace ## <a id="extensions-marketplace"></a>Extensions + Marketplace
Until something more open comes around, we use the Microsoft Marketplace/Extensions in the `product.json` file. Those links are licensed under MIT as per [the comments on this issue.](https://github.com/Microsoft/vscode/issues/31168#issuecomment-317319063) Until something more open comes around, we use the Microsoft Marketplace/Extensions in the `product.json` file. Those links are licensed under MIT as per [the comments on this issue.](https://github.com/Microsoft/vscode/issues/31168#issuecomment-317319063)

View file

@ -2,23 +2,36 @@
if [[ "$SHOULD_BUILD" == "yes" ]]; then if [[ "$SHOULD_BUILD" == "yes" ]]; then
cd vscode cd vscode
if [[ "$BUILDARCH" == "ia32" ]]; then
export npm_config_arch=ia32
fi
yarn yarn
mv product.json product.json.bak mv product.json product.json.bak
cat product.json.bak | jq 'setpath(["extensionsGallery"]; {"serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery", "cacheUrl": "https://vscode.blob.core.windows.net/gallery/index", "itemUrl": "https://marketplace.visualstudio.com/items"}) | setpath(["nameShort"]; "VSCodium") | setpath(["nameLong"]; "VSCodium") | setpath(["applicationName"]; "vscodium") | setpath(["win32MutexName"]; "vscodium") | setpath(["win32DirName"]; "VSCodium") | setpath(["win32NameVersion"]; "VSCodium") | setpath(["win32RegValueName"]; "VSCodium") | setpath(["win32AppUserModelId"]; "Microsoft.VSCodium") | setpath(["win32ShellNameShort"]; "V&SCodium") | setpath(["urlProtocol"]; "vscodium")' > product.json cat product.json.bak | jq 'setpath(["extensionsGallery"]; {"serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery", "cacheUrl": "https://vscode.blob.core.windows.net/gallery/index", "itemUrl": "https://marketplace.visualstudio.com/items"}) | setpath(["nameShort"]; "VSCodium") | setpath(["nameLong"]; "VSCodium") | setpath(["applicationName"]; "vscodium") | setpath(["win32MutexName"]; "vscodium") | setpath(["win32DirName"]; "VSCodium") | setpath(["win32NameVersion"]; "VSCodium") | setpath(["win32RegValueName"]; "VSCodium") | setpath(["win32AppUserModelId"]; "Microsoft.VSCodium") | setpath(["win32ShellNameShort"]; "V&SCodium") | setpath(["urlProtocol"]; "vscodium")' > product.json
cat product.json cat product.json
export NODE_ENV=production export NODE_ENV=production
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then
npx gulp vscode-darwin-min
else
# microsoft adds their apt repo to sources # microsoft adds their apt repo to sources
# unless the app name is code-oss # unless the app name is code-oss
# as we are renaming the application to vscodium # as we are renaming the application to vscodium
# we need to edit a line in the post install template # we need to edit a line in the post install template
sed -i "s/code-oss/vscodium/" resources/linux/debian/postinst.template sed -i "s/code-oss/vscodium/" resources/linux/debian/postinst.template
npx gulp vscode-linux-x64-min fi
npx gulp vscode-linux-x64-build-deb
npx gulp vscode-linux-x64-build-rpm if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
npm run gulp vscode-darwin-min
elif [[ "$BUILDARCH" == "ia32" ]]; then
npm run gulp vscode-linux-ia32-min
npm run gulp vscode-linux-ia32-build-deb
npm run gulp vscode-linux-ia32-build-rpm
unset npm_config_arch
else
npm run gulp vscode-linux-x64-min
npm run gulp vscode-linux-x64-build-deb
npm run gulp vscode-linux-x64-build-rpm
fi fi
cd .. cd ..

View file

@ -14,37 +14,56 @@ if [ "$GITHUB_TOKEN" != "" ]; then
echo "Building on Mac because we have no ZIP" echo "Building on Mac because we have no ZIP"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
fi fi
else elif [[ $BUILDARCH == "ia32" ]]; then
HAVE_RPM=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["rpm"])') HAVE_IA32_RPM=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["i386.rpm"])')
HAVE_DEB=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["deb"])') HAVE_IA32_DEB=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["i386.deb"])')
HAVE_TAR=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["tar.gz"])') HAVE_IA32_TAR=$(echo $VSCODIUM_ASSETS | jq --arg suffix "ia32-$LATEST_MS_TAG.tar.gz" 'map(.name) | contains([$suffix])')
if [[ "$HAVE_RPM" != "true" ]]; then if [[ "$HAVE_IA32_RPM" != "true" ]]; then
echo "Building on Linux because we have no RPM" echo "Building on Linux ia32 because we have no RPM"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
fi fi
if [[ "$HAVE_DEB" != "true" ]]; then if [[ "$HAVE_IA32_DEB" != "true" ]]; then
echo "Building on Linux because we have no DEB" echo "Building on Linux ia32 because we have no DEB"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
fi fi
if [[ "$HAVE_TAR" != "true" ]]; then if [[ "$HAVE_IA32_TAR" != "true" ]]; then
echo "Building on Linux because we have no TAR" echo "Building on Linux ia32 because we have no TAR"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
fi fi
if [[ "$SHOULD_BUILD" != "yes" ]]; then if [[ "$SHOULD_BUILD" != "yes" ]]; then
echo "Already have all the Linux builds" echo "Already have all the Linux ia32 builds"
fi
else
HAVE_64_RPM=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["x86_64.rpm"])')
HAVE_64_DEB=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["amd64.deb"])')
HAVE_64_TAR=$(echo $VSCODIUM_ASSETS | jq --arg suffix "x64-$LATEST_MS_TAG.tar.gz" 'map(.name) | contains([$suffix])')
if [[ "$HAVE_64_RPM" != "true" ]]; then
echo "Building on Linux x64 because we have no RPM"
export SHOULD_BUILD="yes"
fi
if [[ "$HAVE_64_DEB" != "true" ]]; then
echo "Building on Linux x64 because we have no DEB"
export SHOULD_BUILD="yes"
fi
if [[ "$HAVE_64_TAR" != "true" ]]; then
echo "Building on Linux x64 because we have no TAR"
export SHOULD_BUILD="yes"
fi
if [[ "$SHOULD_BUILD" != "yes" ]]; then
echo "Already have all the Linux x64 builds"
fi fi
fi fi
else else
echo "Release assets do not exist at all, continuing build" echo "Release assets do not exist at all, continuing build"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
if git rev-parse $LATEST_MS_TAG >/dev/null 2>&1 fi
then if git rev-parse $LATEST_MS_TAG >/dev/null 2>&1
export TRAVIS_TAG=$LATEST_MS_TAG then
else export TRAVIS_TAG=$LATEST_MS_TAG
git config --local user.name "Travis CI" else
git config --local user.email "builds@travis-ci.com" git config --local user.name "Travis CI"
git tag $LATEST_MS_TAG git config --local user.email "builds@travis-ci.com"
fi git tag $LATEST_MS_TAG
fi fi
fi fi

View file

@ -4,6 +4,9 @@ if [[ "$SHOULD_BUILD" == "yes" ]]; then
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
cd VSCode-darwin cd VSCode-darwin
zip -r ../VSCode-darwin-${LATEST_MS_TAG}.zip ./* zip -r ../VSCode-darwin-${LATEST_MS_TAG}.zip ./*
elif [[ "$BUILDARCH" == "ia32" ]]; then
cd VSCode-linux-ia32
tar czf ../VSCode-linux-ia32-${LATEST_MS_TAG}.tar.gz .
else else
cd VSCode-linux-x64 cd VSCode-linux-x64
tar czf ../VSCode-linux-x64-${LATEST_MS_TAG}.tar.gz . tar czf ../VSCode-linux-x64-${LATEST_MS_TAG}.tar.gz .

View file

@ -7,4 +7,10 @@ if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
else else
sudo apt-get update sudo apt-get update
sudo apt-get install libx11-dev libxkbfile-dev libsecret-1-dev fakeroot rpm sudo apt-get install libx11-dev libxkbfile-dev libsecret-1-dev fakeroot rpm
if [[ "$BUILDARCH" == "ia32" ]]; then
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6-dev-i386 gcc-multilib g++-multilib
sudo apt-get install libx11-dev:i386 libxkbfile-dev:i386
fi
fi fi