Skip to content

Commit cd6d8fd

Browse files
authored
Merge branch 'main' into fix/issue-10436-yaml-frontmatter
2 parents 90fccfe + f14ae36 commit cd6d8fd

8 files changed

Lines changed: 35 additions & 94 deletions

File tree

.github/workflows/actions/quarto-dev/action.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ runs:
1212
restore-keys: |
1313
${{ runner.os }}-deno_std-2-
1414
15-
- name: Install Rust for typst-gather
16-
uses: dtolnay/rust-toolchain@master
17-
with:
18-
toolchain: stable
19-
2015
- name: Cache Cargo dependencies
2116
uses: actions/cache@v4
2217
with:

.github/workflows/create-release.yml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,6 @@ jobs:
133133
if: ${{ inputs.publish-release }}
134134
uses: ./.github/workflows/actions/prevent-rerun
135135

136-
- name: Install Rust for typst-gather
137-
uses: dtolnay/rust-toolchain@master
138-
with:
139-
toolchain: stable
140-
141136
- name: Configure
142137
run: |
143138
./configure.sh
@@ -266,11 +261,6 @@ jobs:
266261
if: ${{ inputs.publish-release }}
267262
uses: ./.github/workflows/actions/prevent-rerun
268263

269-
- name: Install Rust for typst-gather
270-
uses: dtolnay/rust-toolchain@master
271-
with:
272-
toolchain: stable
273-
274264
- name: Configure
275265
run: |
276266
./configure.sh
@@ -370,11 +360,6 @@ jobs:
370360
if: ${{ inputs.publish-release }}
371361
uses: ./.github/workflows/actions/prevent-rerun
372362

373-
- name: Install Rust for typst-gather and launcher
374-
uses: dtolnay/rust-toolchain@master
375-
with:
376-
toolchain: stable
377-
378363
- name: Configure
379364
run: |
380365
.\configure.cmd
@@ -503,11 +488,6 @@ jobs:
503488
if: ${{ inputs.publish-release }}
504489
uses: ./.github/workflows/actions/prevent-rerun
505490

506-
- name: Install Rust for typst-gather
507-
uses: dtolnay/rust-toolchain@master
508-
with:
509-
toolchain: stable
510-
511491
- name: Configure
512492
run: |
513493
./configure.sh

configure.cmd

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,10 @@ IF EXIST !QUARTO_BIN_PATH!\quarto.cmd (
8989
ECHO NOTE: To use quarto please use quarto.cmd (located in this folder) or add the following path to your PATH
9090
ECHO !QUARTO_BIN_PATH!
9191

92-
REM Build typst-gather if cargo is available
93-
where cargo >nul 2>nul
94-
if %ERRORLEVEL% EQU 0 (
95-
ECHO Building typst-gather...
96-
cargo build --release --manifest-path package\typst-gather\Cargo.toml
97-
) else (
98-
ECHO Note: Rust/cargo not found, skipping typst-gather build
99-
ECHO Install Rust to use 'quarto call typst-gather'
100-
)
92+
REM Build typst-gather and install to tools directory
93+
ECHO Building typst-gather...
94+
cargo build --release --manifest-path package\typst-gather\Cargo.toml
95+
COPY package\typst-gather\target\release\typst-gather.exe "!QUARTO_BIN_PATH!\tools\x86_64\"
10196

10297
endlocal & set QUARTO_BIN_DEV=%QUARTO_BIN_PATH%
10398

configure.sh

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,7 @@ else
103103
quarto --version
104104
fi
105105

106-
# Build typst-gather if cargo is available
107-
if command -v cargo &> /dev/null; then
108-
echo "Building typst-gather..."
109-
cargo build --release --manifest-path package/typst-gather/Cargo.toml
110-
else
111-
echo "Note: Rust/cargo not found, skipping typst-gather build"
112-
echo "Install Rust to use 'quarto call typst-gather'"
113-
fi
106+
# Build typst-gather and install to tools directory
107+
echo "Building typst-gather..."
108+
cargo build --release --manifest-path package/typst-gather/Cargo.toml
109+
cp package/typst-gather/target/release/typst-gather "$QUARTO_BIN_PATH/tools/$DENO_ARCH_DIR/"

package/src/common/prepare-dist.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export async function prepareDist(
100100
}
101101
}
102102

103-
// Stage typst-gather binary if it exists (built by configure.sh)
103+
// Stage typst-gather binary (built by configure.sh)
104104
// Only stage if the build machine architecture matches the target architecture
105105
// (cross-compilation is not currently supported)
106106
const buildArch = Deno.build.arch === "aarch64" ? "aarch64" : "x86_64";
@@ -111,15 +111,17 @@ export async function prepareDist(
111111
"package/typst-gather/target/release",
112112
typstGatherBinaryName,
113113
);
114-
if (existsSync(typstGatherSrc)) {
115-
info("\nStaging typst-gather binary");
116-
const typstGatherDest = join(targetDir, config.arch, typstGatherBinaryName);
117-
ensureDirSync(join(targetDir, config.arch));
118-
copySync(typstGatherSrc, typstGatherDest, { overwrite: true });
119-
info(`Copied ${typstGatherSrc} to ${typstGatherDest}`);
120-
} else {
121-
info("\nNote: typst-gather binary not found, skipping staging");
114+
if (!existsSync(typstGatherSrc)) {
115+
throw new Error(
116+
`typst-gather binary not found at ${typstGatherSrc}\n` +
117+
"Run ./configure.sh to build it.",
118+
);
122119
}
120+
info("\nStaging typst-gather binary");
121+
const typstGatherDest = join(targetDir, config.arch, typstGatherBinaryName);
122+
ensureDirSync(join(targetDir, config.arch));
123+
copySync(typstGatherSrc, typstGatherDest, { overwrite: true });
124+
info(`Copied ${typstGatherSrc} to ${typstGatherDest}`);
123125
} else {
124126
info(`\nNote: Skipping typst-gather staging (build arch ${buildArch} != target arch ${config.arch})`);
125127
}

src/command/call/typst-gather/cmd.ts

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -452,36 +452,15 @@ export const typstGatherCommand = new Command()
452452
Deno.exit(1);
453453
}
454454

455-
// Find typst-gather binary
456-
// First try architecture-specific path, then fall back to PATH
457-
let typstGatherBinary: string;
455+
// Find typst-gather binary in standard tools location
458456
const binaryName = isWindows ? "typst-gather.exe" : "typst-gather";
459-
460-
const archPath = architectureToolsPath(binaryName);
461-
if (existsSync(archPath)) {
462-
typstGatherBinary = archPath;
463-
} else {
464-
// Try to find in PATH or use development location
465-
const quartoRoot = Deno.env.get("QUARTO_ROOT");
466-
if (quartoRoot) {
467-
const devPath = join(
468-
quartoRoot,
469-
"package/typst-gather/target/release",
470-
binaryName,
471-
);
472-
if (existsSync(devPath)) {
473-
typstGatherBinary = devPath;
474-
} else {
475-
console.error(
476-
`typst-gather binary not found.\n` +
477-
`Build it with: cd package/typst-gather && cargo build --release`,
478-
);
479-
Deno.exit(1);
480-
}
481-
} else {
482-
console.error("typst-gather binary not found.");
483-
Deno.exit(1);
484-
}
457+
const typstGatherBinary = architectureToolsPath(binaryName);
458+
if (!existsSync(typstGatherBinary)) {
459+
console.error(
460+
`typst-gather binary not found.\n` +
461+
`Run ./configure.sh to build and install it.`,
462+
);
463+
Deno.exit(1);
485464
}
486465

487466
// Determine config file to use

src/command/dev-call/typst-gather/cmd.ts

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
*/
66

77
import { Command } from "cliffy/command/mod.ts";
8+
import { existsSync } from "../../../deno_ral/fs.ts";
89
import { error, info } from "../../../deno_ral/log.ts";
910
import { join } from "../../../deno_ral/path.ts";
1011
import { isWindows } from "../../../deno_ral/platform.ts";
12+
import { architectureToolsPath } from "../../../core/resources.ts";
1113

1214
export const typstGatherCommand = new Command()
1315
.name("typst-gather")
@@ -33,21 +35,13 @@ export const typstGatherCommand = new Command()
3335
"src/command/dev-call/typst-gather/typst-gather.toml",
3436
);
3537

36-
// Path to the typst-gather binary
38+
// Find typst-gather binary in standard tools location
3739
const binaryName = isWindows ? "typst-gather.exe" : "typst-gather";
38-
const typstGatherBinary = join(
39-
quartoRoot,
40-
"package/typst-gather/target/release",
41-
binaryName,
42-
);
43-
44-
// Check if binary exists
45-
try {
46-
await Deno.stat(typstGatherBinary);
47-
} catch {
40+
const typstGatherBinary = architectureToolsPath(binaryName);
41+
if (!existsSync(typstGatherBinary)) {
4842
error(
49-
`typst-gather binary not found at ${typstGatherBinary}\n` +
50-
"Build it with: cd package/typst-gather && cargo build --release",
43+
`typst-gather binary not found.\n` +
44+
"Run ./configure.sh to build and install it.",
5145
);
5246
Deno.exit(1);
5347
}

tests/docs/smoke-all/pdf-standard/pdfversion-numeric.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "PDF version (numeric YAML)"
33
lang: en
4-
pdf-standard: 2.0
4+
pdf-standard: "2.0"
55
keep-tex: true
66
keep-typ: true
77
_quarto:

0 commit comments

Comments
 (0)