mirror of
https://ghproxy.cflmy.top/https://github.com/deepseek-ai/deepseek-harness.git
synced 2026-11-29 16:49:35 +08:00
LibreOffice Kit 0.2.4 publishes its Linux engines as linux-x64-glibc and linux-arm64-glibc, but the sidecar and Desktop packaging looked for linux-<arch>, so a Linux target always fell back to WASM even when the kit declared a native engine. DSH's Linux distributions are glibc builds, so a Linux target now selects the glibc engine for its CPU. The third-party notices accept the two Linux engine packages under the same MPL-2.0 identity rule as the other engines. The web app and office-kit take Kit 0.2.4, the first release with those engines. Its release-age exclusions name the API and the six native engines; WASM is no longer an optional dependency of the kit and is no longer excluded. Because DSH no longer installs WASM, packaging now requires the target's declared native engine and rejects a target without one, naming its platform and CPU, instead of selecting a WASM package that cannot be present. The Python runtime smoke derives the same glibc package name and checks that the Office sidecar holds exactly that native engine. The Office provider, subsystem, package-surface and Desktop packaging documents describe Kit 0.2.4 and the native-only rule.
30 lines
1.9 KiB
TypeScript
30 lines
1.9 KiB
TypeScript
import { expect, it } from 'vitest'
|
|
import { selectOfficeEngine } from './libreoffice-packages.mjs'
|
|
|
|
it.each([
|
|
['darwin', 'arm64', 'darwin-arm64'], ['darwin', 'x64', 'darwin-x64'],
|
|
['win32', 'arm64', 'win32-arm64'], ['win32', 'x64', 'win32-x64'],
|
|
['linux', 'x64', 'linux-x64-glibc'], ['linux', 'arm64', 'linux-arm64-glibc'],
|
|
])('selects the declared native engine for %s/%s', (platform, arch, expected) => {
|
|
const optionalDependencies = Object.fromEntries(
|
|
['darwin-arm64', 'darwin-x64', 'win32-arm64', 'win32-x64', 'linux-x64-glibc', 'linux-arm64-glibc']
|
|
.map(engine => [`@deepseek-ai/libreoffice-kit-${engine}`, '0.0.1']),
|
|
)
|
|
expect(selectOfficeEngine({ optionalDependencies }, { platform, arch })).toBe(expected)
|
|
})
|
|
|
|
it('rejects a Linux target whose glibc engine the kit does not declare', () => {
|
|
expect(() => selectOfficeEngine({ optionalDependencies: { '@deepseek-ai/libreoffice-kit-linux-x64': '1' } },
|
|
{ platform: 'linux', arch: 'x64' })).toThrow('Office engine @deepseek-ai/libreoffice-kit-linux-x64-glibc is not declared for linux/x64.')
|
|
expect(() => selectOfficeEngine({ optionalDependencies: { '@deepseek-ai/libreoffice-kit-linux-x64-glibc': '1' } },
|
|
{ platform: 'linux', arch: 'arm64' })).toThrow('Office engine @deepseek-ai/libreoffice-kit-linux-arm64-glibc is not declared for linux/arm64.')
|
|
})
|
|
|
|
it('rejects targets without a declared native engine even when WASM is declared', () => {
|
|
const optionalDependencies = { '@deepseek-ai/libreoffice-kit-wasm': '0.0.1' }
|
|
expect(() => selectOfficeEngine({ optionalDependencies }, { platform: 'freebsd', arch: 'x64' }))
|
|
.toThrow('Office engine @deepseek-ai/libreoffice-kit-freebsd-x64 is not declared for freebsd/x64.')
|
|
expect(() => selectOfficeEngine({}, { platform: 'darwin', arch: 'x64' }))
|
|
.toThrow('Office engine @deepseek-ai/libreoffice-kit-darwin-x64 is not declared for darwin/x64.')
|
|
})
|