Fork Temporal SDK Typescript

Hi, I’m trying to fork the Temporal SDK Typescript repository to run my own fork of the package, but running into some issues. For context, I’m on a M1 Mac, but my containers will be running on linux, and so will my build process.

I’m working on a solution for (Worker error with .mul is not a function - #20 by rifruf) where since we don’t install devDependencies when we build our container, it seems like the long package isn’t being installed for temporalio.

I followed along sdk-typescript/CONTRIBUTING.md at main · brianlu-scale/sdk-typescript · GitHub, but I don’t see the built files anywhere? I was planning on just having the package live on this forked repository and then pulling it with yarn from my own repository by having somthing like "@temporalio": "https://github.com/rifruf/sdk-typescript" in my package.json, so I need the built files to exist in the repository. I’m also wondering how I should be specifying this forked package in my repositories package.json, since I’m specifying the packages separately similar to

    "@temporalio/client": "~1.0.1",
    "@temporalio/common": "~1.0.1",
    "@temporalio/worker": "~1.0.1",
    "@temporalio/workflow": "~1.0.1",

. Do I point these to the specific file on github where the packages are located, "@temporalio": "https://github.com/rifruf/sdk-typescript/packages/client"? Actually it seems like I can just do ```
yarn add '@https://github.com//#head=&workspace=client

1 Like

Running yarn add '@temporalio/client@https://github.com/brianlu-scale/sdk-typescript#head=brianlu/include-long&workspace=client' got me:

Packing @temporalio/client@https://github.com/brianlu-scale/sdk-typescript.git#workspace=client&commit=24432c135501c2e2cad5f9fc16ca55e809129038 from sources
Using npm for bootstrap. Reason: found npm's "package-lock.json" lockfile

8.4.0
npm ERR! code 1
npm ERR! path /private/var/folders/wc/_1fzmnz53011qqzgwy5_0mzc0000gn/T/xfs-f71388d6/packages/core-bridge
npm ERR! command failed
npm ERR! command sh -c node ./scripts/build.js
npm ERR! Compiling bridge { target: undefined, buildRelease: false }
npm ERR! Running /private/var/folders/wc/_1fzmnz53011qqzgwy5_0mzc0000gn/T/xfs-f71388d6/node_modules/.bin/cargo-cp-artifact [
npm ERR!   '--artifact',
npm ERR!   'cdylib',
npm ERR!   'temporal_sdk_typescript_bridge',
npm ERR!   'default-build/index.node',
npm ERR!   '--',
npm ERR!   'cargo',
npm ERR!   'build',
npm ERR!   '--message-format=json-render-diagnostics'
npm ERR! ]
npm ERR! No prebuilt module found at /private/var/folders/wc/_1fzmnz53011qqzgwy5_0mzc0000gn/T/xfs-f71388d6/packages/core-bridge/releases/aarch64-apple-darwin/index.node
npm ERR! error: failed to get `temporal-client` as a dependency of package `temporal-sdk-typescript-bridge v0.1.0 (/private/var/folders/wc/_1fzmnz53011qqzgwy5_0mzc0000gn/T/xfs-f71388d6/packages/core-bridge)`
npm ERR! 
npm ERR! Caused by:
npm ERR!   failed to load source for dependency `temporal-client`
npm ERR! 
npm ERR! Caused by:
npm ERR!   Unable to update /private/var/folders/wc/_1fzmnz53011qqzgwy5_0mzc0000gn/T/xfs-f71388d6/packages/core-bridge/sdk-core/client
npm ERR! 
npm ERR! Caused by:
npm ERR!   failed to read `/private/var/folders/wc/_1fzmnz53011qqzgwy5_0mzc0000gn/T/xfs-f71388d6/packages/core-bridge/sdk-core/client/Cargo.toml`
npm ERR! 
npm ERR! Caused by:
npm ERR!   No such file or directory (os error 2)
npm ERR! Did not copy "cdylib:temporal_sdk_typescript_bridge"
npm ERR! /private/var/folders/wc/_1fzmnz53011qqzgwy5_0mzc0000gn/T/xfs-f71388d6/packages/core-bridge/scripts/build.js:88
npm ERR!     throw new Error(`Failed to build${target ? ' for ' + target : ''}`);
npm ERR!     ^
npm ERR! 
npm ERR! Error: Failed to build
npm ERR!     at compile (/private/var/folders/wc/_1fzmnz53011qqzgwy5_0mzc0000gn/T/xfs-f71388d6/packages/core-bridge/scripts/build.js:88:11)
npm ERR!     at Object.<anonymous> (/private/var/folders/wc/_1fzmnz53011qqzgwy5_0mzc0000gn/T/xfs-f71388d6/packages/core-bridge/scripts/build.js:105:9)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1101:14)
npm ERR!     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:981:32)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:822:12)
npm ERR!     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
npm ERR!     at node:internal/main/run_main_module:17:47

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/brianlu/.npm/_logs/2022-08-09T20_50_01_662Z-debug-0.log

This is my fork GitHub - brianlu-scale/sdk-typescript at brianlu/include-long.

I’m not sure, but if there’s no prebuilt module, then the machine needs to have the rust toolchain so that it can build the rust part itself. Hopefully this will resolve the original issue: Worker error with .mul is not a function - #21 by loren