Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions lib/bacalhau.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@ import execa from 'execa'
import { fetch } from 'undici'
import Sentry from '@sentry/node'
import { installBinaryModule, getBinaryModuleExecutable } from './modules.js'
import os from 'node:os'

const DIST_TAG = 'v1.0.3'
const { TARGET_ARCH = os.arch() } = process.env

export async function install () {
await installBinaryModule({
module: 'bacalhau',
repo: 'bacalhau-project/bacalhau',
executable: 'bacalhau',
distTag: DIST_TAG,
arch: TARGET_ARCH,
targets: [
{ platform: 'darwin', arch: 'x64', asset: `bacalhau_${DIST_TAG}_darwin_amd64.tar.gz` },
{ platform: 'darwin', arch: 'arm64', asset: `bacalhau_${DIST_TAG}_darwin_arm64.tar.gz` },
Expand Down
4 changes: 2 additions & 2 deletions lib/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export const installBinaryModule = async ({
repo,
distTag,
executable,
arch = os.arch(),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this argument wasn't being used any more

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am concerned about setting the arch deep inside this file. When reading the top-level post-install script, it's not clear that we may be downloading different files based on some environment variables.

Would you mind keeping arch here, maybe as a required argument, and setting it from env vars in the file where we are calling getBinaryModuleExecutable?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea, like this?

targets
targets,
arch
}) => {
console.log(
`[${module}] GitHub client: ${authorization ? 'authorized' : 'anonymous'}`
Expand Down
3 changes: 3 additions & 0 deletions lib/zinnia.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import execa from 'execa'
import Sentry from '@sentry/node'
import { installBinaryModule, downloadSourceFiles, getBinaryModuleExecutable } from './modules.js'
import { moduleBinaries } from './paths.js'
import os from 'node:os'

const ZINNIA_DIST_TAG = 'v0.10.1'
const ZINNIA_MODULES = [
Expand All @@ -12,6 +13,7 @@ const ZINNIA_MODULES = [
distTag: 'v0.1.1'
}
]
const { TARGET_ARCH = os.arch() } = process.env

export async function install () {
await Promise.all([
Expand All @@ -20,6 +22,7 @@ export async function install () {
repo: 'filecoin-station/zinnia',
distTag: ZINNIA_DIST_TAG,
executable: 'zinniad',
arch: TARGET_ARCH,
targets: [
{ platform: 'darwin', arch: 'arm64', asset: 'zinniad-macos-arm64.zip' },
{ platform: 'darwin', arch: 'x64', asset: 'zinniad-macos-x64.zip' },
Expand Down