Skip to content

Add Support for Linux Arm64 #4264

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

Merged
merged 35 commits into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
8621ed2
Update dependencies
dragonstyle Oct 18, 2022
23e1930
Add asciidoc template to updating pandoc
dragonstyle Feb 2, 2023
5b3e0d7
deno_dom vendor: 0.1.20 -> 0.1.35
cscheid Feb 6, 2023
23e2bf8
update to deno_com 1.35 (including arm64)
jjallaire Feb 6, 2023
6d1737c
Address dart warnings
dragonstyle Feb 6, 2023
c7b475b
Move os/arch into configuration
dragonstyle Feb 6, 2023
66e7ebc
Allow setting os/arch for build commands on cmd line
dragonstyle Feb 6, 2023
9cf8ffa
prepare-dist into a working folder separate from dist
dragonstyle Feb 6, 2023
8106fd8
installer work off working dir
dragonstyle Feb 6, 2023
0d747c4
create tarball from correct dir
dragonstyle Feb 6, 2023
c78bf83
fetch deno for prepare-dist
dragonstyle Feb 6, 2023
f64bf27
Move to working directory
dragonstyle Feb 7, 2023
16053b5
use proper directory for deno
dragonstyle Feb 7, 2023
70c069e
Use proper arch when preparing
dragonstyle Feb 7, 2023
dcb7bf3
use specified archtiecture when building deb packages
dragonstyle Feb 7, 2023
b725420
correct arch
dragonstyle Feb 7, 2023
bc90c3a
improve printing of config
dragonstyle Feb 7, 2023
0a41376
properly make tarball
dragonstyle Feb 7, 2023
0c75dd7
Update create-release.yml
dragonstyle Feb 7, 2023
d6cd213
Add to release
dragonstyle Feb 7, 2023
176e24f
fix ids
dragonstyle Feb 7, 2023
0d1b3f0
Update create-release.yml
dragonstyle Feb 7, 2023
d65ac8b
correct names
dragonstyle Feb 7, 2023
1920ade
Improve create release
dragonstyle Feb 7, 2023
2b65d87
Don’t use a deno directory on linux
dragonstyle Feb 7, 2023
271b2ae
Update create-release.yml
dragonstyle Feb 7, 2023
1dd2ee9
Configure support for arm64
dragonstyle Feb 7, 2023
353b1b9
correct url
dragonstyle Feb 7, 2023
8534c21
add hack
dragonstyle Feb 7, 2023
b3e6134
fix space
dragonstyle Feb 7, 2023
ab51708
improve test bundle
dragonstyle Feb 7, 2023
f4e9487
Update performance-check.yml
dragonstyle Feb 7, 2023
146813b
Update test-bundle.yml
dragonstyle Feb 7, 2023
48a241d
Update performance-check.yml
dragonstyle Feb 7, 2023
8e167b5
Update performance-check.yml
dragonstyle Feb 7, 2023
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
100 changes: 96 additions & 4 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ jobs:
- name: Make Tarball
run: |
pushd package/
mv dist quarto-${{needs.configure.outputs.version}}
mv pkg-working quarto-${{needs.configure.outputs.version}}
tar -cvf quarto-${{needs.configure.outputs.version}}-linux-amd64.tar quarto-${{needs.configure.outputs.version}}
gzip quarto-${{needs.configure.outputs.version}}-linux-amd64.tar
mv quarto-${{needs.configure.outputs.version}} dist
mv quarto-${{needs.configure.outputs.version}} pkg-working
popd

- name: Upload Artifact
Expand All @@ -110,6 +110,38 @@ jobs:
name: Deb Zip
path: ./package/quarto-${{needs.configure.outputs.version}}-linux-amd64.tar.gz

make-arm64-tarball:
runs-on: ubuntu-latest
needs: [configure]

steps:
- uses: actions/checkout@v3

- name: Configure
run: |
./configure.sh

- name: Prepare Distribution
run: |
pushd package/src/
./quarto-bld prepare-dist --set-version ${{needs.configure.outputs.version}} --arch aarch64 --log-level info
popd

- name: Make Tarball
run: |
pushd package/
mv pkg-working quarto-${{needs.configure.outputs.version}}
tar -cvf quarto-${{needs.configure.outputs.version}}-linux-arm64.tar quarto-${{needs.configure.outputs.version}}
gzip quarto-${{needs.configure.outputs.version}}-linux-arm64.tar
mv quarto-${{needs.configure.outputs.version}} pkg-working
popd

- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: Deb Arm64 Zip
path: ./package/quarto-${{needs.configure.outputs.version}}-linux-arm64.tar.gz

make-tarball-rhel:
runs-on: ubuntu-latest
needs: [configure]
Expand Down Expand Up @@ -153,6 +185,34 @@ jobs:
name: RHEL Zip
path: ./package/quarto-${{needs.configure.outputs.version}}-linux-rhel7-amd64.tar.gz

make-installer-arm64-deb:
runs-on: ubuntu-latest
needs: [configure]

steps:
- uses: actions/checkout@v3

- name: Configure
run: |
./configure.sh

- name: Prepare Distribution
run: |
pushd package/src/
./quarto-bld prepare-dist --set-version ${{needs.configure.outputs.version}} --arch aarch64 --log-level info
popd

- name: Make Installer
run: |
pushd package/src/
./quarto-bld make-installer-deb --set-version ${{needs.configure.outputs.version}} --arch aarch64 --log-level info
popd

- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: Deb Arm64 Installer
path: ./package/out/quarto-${{needs.configure.outputs.version}}-linux-arm64.deb


make-installer-deb:
Expand Down Expand Up @@ -201,7 +261,7 @@ jobs:
quarto check
quarto --paths
quarto --version

make-installer-win:
runs-on: windows-latest
needs: [configure]
Expand All @@ -228,7 +288,7 @@ jobs:
- name: Build Launcher
run: |
cargo build --release --all-features --manifest-path package/launcher/Cargo.toml
cp package/launcher/target/release/quarto.exe package/dist/bin/quarto.exe
cp package/launcher/target/release/quarto.exe package/pkg-working/bin/quarto.exe

- name: Make Installer
run: |
Expand Down Expand Up @@ -355,9 +415,11 @@ jobs:
[
configure,
make-installer-deb,
make-installer-arm64-deb,
make-installer-win,
make-installer-mac,
make-tarball-rhel,
make-arm64-tarball,
make-tarball,
make-source-tarball,
test-zip-win,
Expand Down Expand Up @@ -404,6 +466,17 @@ jobs:
asset_name: quarto-${{needs.configure.outputs.version}}-linux-amd64.tar.gz
asset_content_type: application/gzip

- name: Attach Arm64 Release Tarball
id: attach-arm4-release-tarball
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Deb Arm64 Zip/quarto-${{needs.configure.outputs.version}}-linux-arm64.tar.gz
asset_name: quarto-${{needs.configure.outputs.version}}-linux-arm64.tar.gz
asset_content_type: application/gzip

- name: Attach RHEL Tarball
id: attach-rhel-tarball
uses: actions/upload-release-asset@v1
Expand All @@ -426,6 +499,17 @@ jobs:
asset_name: quarto-${{needs.configure.outputs.version}}-linux-amd64.deb
asset_content_type: application/deb

- name: Attach Arm64 Debian Installer
id: attach-arm64-deb-installer
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Deb Arm64 Installer/quarto-${{needs.configure.outputs.version}}-linux-arm64.deb
asset_name: quarto-${{needs.configure.outputs.version}}-linux-arm64.deb
asset_content_type: application/deb

- name: Attach Windows Installer
id: attach-win-installer
uses: actions/upload-release-asset@v1
Expand Down Expand Up @@ -507,10 +591,18 @@ jobs:
pushd Deb\ Zip
sha256sum quarto-${{needs.configure.outputs.version}}-linux-amd64.tar.gz >> ../quarto-${{needs.configure.outputs.version}}-checksums.txt
popd

pushd Deb\ Arm64\ Zip
sha256sum quarto-${{needs.configure.outputs.version}}-linux-arm64.tar.gz >> ../quarto-${{needs.configure.outputs.version}}-checksums.txt
popd

pushd Deb\ Installer
sha256sum quarto-${{needs.configure.outputs.version}}-linux-amd64.deb >> ../quarto-${{needs.configure.outputs.version}}-checksums.txt
popd

pushd Deb\ Arm64\ Installer
sha256sum quarto-${{needs.configure.outputs.version}}-linux-arm64.deb >> ../quarto-${{needs.configure.outputs.version}}-checksums.txt
popd

pushd Source
sha256sum quarto-${{needs.configure.outputs.version}}.tar.gz >> ../quarto-${{needs.configure.outputs.version}}-checksums.txt
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/performance-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,23 @@ jobs:

# move the TS file so quarto command will use bundled JS
mv src/quarto.ts src/quarto1.ts

pushd package/pkg-working/bin

# test a bare quarto command
q_start=$(date +%s.%3N)
quarto
./quarto
q_end=$(date +%s.%3N)
q_elapsed=$(printf '%.3f\n' $(echo "scale=3; $q_end - $q_start" | bc))

# test a quarto render
q_render_start=$(date +%s.%3N)
quarto render tests/docs/test.qmd --to html
./quarto render ../../../tests/docs/test.qmd --to html
q_render_end=$(date +%s.%3N)
q_render_elapsed=$(printf '%.3f\n' $(echo "scale=3; $q_render_end - $q_render_start" | bc))

popd

# return the measures
echo "bundle_time=$bundle_elapsed" >> $GITHUB_OUTPUT
echo "q_time=$q_elapsed" >> $GITHUB_OUTPUT
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ jobs:
pushd package/src
./quarto-bld prepare-dist
mv ../../src/quarto.ts ../../src/quarto1.ts
quarto
pushd ../pkg-working/bin
./quarto check
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ src/resources/deno_std/cache
src/vendor-*

# windows configuration file
win_configuration.bat
win_configuration.bat
/package/pkg-working
4 changes: 2 additions & 2 deletions configuration
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

# Binary dependencies
export DENO=v1.28.2
export DENO_DOM=v0.1.23-alpha-artifacts
export DENO_DOM=v0.1.35-alpha-artifacts
export PANDOC=2.19.2
export DARTSASS=1.32.8
export DARTSASS=1.55.0
export ESBUILD=0.15.6

# Bootstrap dependencies from bslib
Expand Down
7 changes: 5 additions & 2 deletions configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,15 @@ if [[ "${QUARTO_VENDOR_BINARIES}" = "true" ]]; then
cd $QUARTO_BIN_PATH/tools

# Download Deno
DENOURL=https://github.com/denoland/deno/releases/download

for DENOFILE in $DENOFILES; do
download "$DENOURL/$DENO/$DENOFILE" "$DENOFILE"
unzip -o $DENOFILE
DENO_ARCH_DIR=$(basename $DENOFILE .zip)

if [[ "${DENO_ARCH_DIR}" = "deno-linux-arm64" ]]; then
DENO_ARCH_DIR="deno-aarch64-unknown-linux-gnu"
fi

mkdir $DENO_ARCH_DIR
mv deno $DENO_ARCH_DIR
rm $DENOFILE
Expand Down
12 changes: 11 additions & 1 deletion package/scripts/common/quarto
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,20 @@ if [ "$QUARTO_DENO" == "" ]; then
echo "quarto script failed: unrecognized architecture " ${FULLARCH}
exit 1
fi

else
DENO_DIR=deno-x86_64-unknown-linux-gnu
NIXARCH=$(uname -m)
if [[ $NIXARCH == "x86_64" ]]; then
DENO_DIR=deno-x86_64-unknown-linux-gnu
elif [[ $NIXARCH == "aarch64" ]]; then
DENO_DIR=deno-aarch64-unknown-linux-gnu
else
echo "configure script failed: unrecognized architecture " ${NIXARCH}
exit 1
fi
fi
export QUARTO_DENO="${SCRIPT_PATH}/tools/${DENO_DIR}/deno"

fi

export DENO_NO_UPDATE_CHECK=1
Expand Down
17 changes: 15 additions & 2 deletions package/scripts/common/utils.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# DENOFILES is only required at configure.sh, but DENO_DIR is used in many places

if [[ $OSTYPE == 'darwin'* ]]; then
DENOURL=https://github.com/denoland/deno/releases/download
FULLARCH=$(uname -sm)
DENOFILES="deno-x86_64-apple-darwin.zip deno-aarch64-apple-darwin.zip"

Expand All @@ -13,6 +14,18 @@ if [[ $OSTYPE == 'darwin'* ]]; then
exit 1
fi
else
DENOFILES=deno-x86_64-unknown-linux-gnu.zip
DENO_DIR=deno-x86_64-unknown-linux-gnu

NIXARCH=$(uname -m)
if [[ $NIXARCH == "x86_64" ]]; then
DENOURL=https://github.com/denoland/deno/releases/download
DENOFILES=deno-x86_64-unknown-linux-gnu.zip
DENO_DIR=deno-x86_64-unknown-linux-gnu
elif [[ $NIXARCH == "aarch64" ]]; then
DENOURL=https://github.com/LukeChannings/deno-arm64/releases/download
DENOFILES=deno-linux-arm64.zip
DENO_DIR=deno-aarch64-unknown-linux-gnu
else
echo "configure script failed: unrecognized architecture " ${NIXARCH}
exit 1
fi
fi
58 changes: 38 additions & 20 deletions package/src/cmd/pkg-cmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ import { Command } from "cliffy/command/mod.ts";
import { join } from "path/mod.ts";
import { info } from "log/mod.ts";

import { Configuration, readConfiguration } from "../common/config.ts";
import { printConfiguration } from "../common/config.ts"

import {
Configuration,
kValidArch,
kValidOS,
readConfiguration,
} from "../common/config.ts";

export const kLogLevel = "logLevel";
export const kVersion = "setVersion";
Expand All @@ -17,24 +24,35 @@ export function packageCommand(run: (config: Configuration) => Promise<void>) {
return new Command().option(
"-sv, --set-version [version:string]",
"Version to set when preparing this distribution",
).option(
"-o, --os [os:string]",
"Operating system for this command (" + kValidOS.join(", ") + ")",
)
.option(
"-a, --arch [arch:string]",
"Architecture for this command (" + kValidArch.join(", ") + ")",
)
// deno-lint-ignore no-explicit-any
).action(async (args: Record<string, any>) => {
const version = args[kVersion];

// Read the version and configuration
const config = readConfiguration(version);

// Set up the bin and share environment for any downstream code
Deno.env.set("QUARTO_BIN_PATH", config.directoryInfo.bin);
Deno.env.set(
"QUARTO_SHARE_PATH",
join(config.directoryInfo.src, "resources"),
);
Deno.env.set("QUARTO_DEBUG", "true");

// Run the command
info("Using configuration:");
info(config);
await run(config);
});
.action(async (args: Record<string, any>) => {
const version = args[kVersion];
const os = args["os"];
const arch = args["arch"];

// Read the version and configuration
const config = readConfiguration(version, os, arch);

// Set up the bin and share environment for any downstream code
Deno.env.set("QUARTO_BIN_PATH", config.directoryInfo.bin);
Deno.env.set(
"QUARTO_SHARE_PATH",
join(config.directoryInfo.src, "resources"),
);
Deno.env.set("QUARTO_DEBUG", "true");

// Print the configuration
printConfiguration(config);

// Run the command
await run(config);
});
}
Loading