tauri-apps / tauri-apps/tauri-docs
Defining triple for sidecar in CI/CD on intel mac
Nobody has claimed this yet.
- Dominant language
- MDX
- Stars
- 1.1k
- Forks
- 887
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 48
Description
Hey,
I'm working on fluster and everything was going great until I decided to add a Flask api as a sidecar. Things are working well on all platforms except Intel based macs as the triple isn't being appended properly and the build fails on intel macs telling me that the file with the appended triple cannot be found.
This is what my script looks like:
#!/usr/bin/env node
import fs from 'fs';
import path from 'path';
import { execSync } from "child_process";
console.log("dirName: ", import.meta.dirname)
const sidecarDir = path.join(
import.meta.dirname,
"..",
"apps",
"fluster",
"src-python",
"fluster_sidecar_api"
)
const extension = process.platform === "win32" ? ".exe" : "";
const installScript = `uv sync --directory ${sidecarDir}`
const res = execSync(installScript, {
encoding: "utf-8"
})
console.log(res)
const uvPath = path.join(sidecarDir, ".venv", process.platform === "win32" ? "Scripts" : "bin", `pyinstaller${extension}`);
const compileScript = `${uvPath} --name fluster_python_sidecar --onefile --distpath ${path.join(sidecarDir, "dist")} --workpath ${path.join(sidecarDir, "build")} --specpath ${sidecarDir} ${path.join(sidecarDir, "main.py")}`
const res2 = execSync(compileScript, {
encoding: "utf-8"
})
console.log(res2)
// -- Rename Python Binary --
const existingPath = path.join(
sidecarDir,
"dist",
`fluster_python_sidecar`
);
const rustInfo = execSync("rustc -vV");
const targetTriple = /host: (\S+)/g.exec(rustInfo)[1];
if (!targetTriple) {
console.error("Failed to determine platform target triple");
}
console.log("process.architecture: ", process.architecture)
console.log("process.platform: ", process.platform)
if (process.platform === "darwin" && process.architecture === "x64") {
fs.renameSync(
`${existingPath}${extension}`,
`${existingPath}-x86_64-apple-darwin${extension}`
)
} else {
fs.renameSync(
`${existingPath}${extension}`,
`${existingPath}-${targetTriple}${extension}`
);
}
I had originally copied the 'rename' function directly from the documentation, I've since modified it slightly to the above with no success in either form.
Is there a known issue with this approach in this line in particular?
if (process.platform === "darwin" && process.architecture === "x64") {
For the life of me I can't see why that block is not being executed and the file being renamed.
Thanks in advance!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the provided Node script, especially the rename block and the values printed for process.platform, process.architecture, and rustc -vV. Reproduce the sidecar build on an Intel Mac in CI and compare the generated filename with the expected triple-suffixed path. Done means the cause is documented and the correct binary name is produced consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- flask, javascript, python, rust
- Domain
- backend, build-system, ci-cd
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100