helia-examples icon indicating copy to clipboard operation
helia-examples copied to clipboard

feat: test on bun runtime

Open whizzzkid opened this issue 2 years ago • 11 comments

In this PR:

  • adding support to run bun as a supported runtime.

Currently failing:

Added file contents: Hello World 101
1 | // createRequire is native in node version >= 12
2 | import { createRequire } from 'module';
3 | const require = createRequire(import.meta.url);
4 | 
5 | const nodeDataChannel = require('../build/Release/node_datachannel.node');
                            ^
TypeError: /home/runner/work/helia-examples/helia-examples/node_modules/node-datachannel/build/Release/node_datachannel.node: undefined symbol: _ZTVN10__cxxabiv117__class_type_infoE
      at /home/runner/work/helia-examples/helia-examples/node_modules/node-datachannel/lib/node-datachannel.js:5:25

whizzzkid avatar Aug 03 '23 00:08 whizzzkid

This looks promising, but everything is broken?

achingbrain avatar Aug 07 '23 10:08 achingbrain

Also - we don't need to run every single example on bun as this will expose us to having to make sure every framework etc in every example also runs on bun.

Just make it run the helia-101 example on bun as well as node, that should be enough.

achingbrain avatar Aug 07 '23 11:08 achingbrain

Depends on:

  • [x] https://github.com/ipfs-examples/test-ipfs-example/pull/18

achingbrain avatar Feb 08 '24 15:02 achingbrain

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
verified-fetch ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 24, 2024 7:15pm

vercel[bot] avatar Apr 23 '24 13:04 vercel[bot]

I think we need to pull in [email protected] here for things to work?

SgtPooki avatar Apr 24 '24 18:04 SgtPooki

seems like bun is not trusting some deps' postinstall scripts.

so node-datachannel is not being found: https://github.com/ipfs-examples/helia-examples/actions/runs/8821723588/job/24218234527?pr=101#step:6:13

Running locally shows:

╰─ ✔ ❯ bun pm untrusted
bun pm untrusted v1.1.4 (fbe2fe0c)

./node_modules/@nestjs/core @10.3.0
 » [postinstall]: opencollective || exit 0

./node_modules/protobufjs @7.2.6
 » [postinstall]: node scripts/postinstall

./node_modules/node-datachannel @0.5.3
 » [install]: prebuild-install -r napi || (npm install --ignore-scripts --production=false && npm run _prebuild)

These dependencies had their lifecycle scripts blocked during install.

If you trust them and wish to run their scripts, use `bun pm trust`.

SgtPooki avatar Apr 24 '24 19:04 SgtPooki

helia-101 on bun passes now: https://github.com/ipfs-examples/helia-examples/actions/runs/8822048749/job/24219321434?pr=101

SgtPooki avatar Apr 24 '24 19:04 SgtPooki

removal of CustomEvent polyfill from libp2p broke bun build: https://github.com/ipfs-examples/helia-examples/actions/runs/11505470232/job/32027234171?pr=101#step:6:30

SgtPooki avatar Oct 24 '24 18:10 SgtPooki

removal of CustomEvent polyfill from libp2p broke bun build: ipfs-examples/helia-examples/actions/runs/11505470232/job/32027234171?pr=101#step:6:30

With bun v1.1.33, the tests pass for me fine, but they seem to fail in CI.. maybe macOS vs linux?

SgtPooki avatar Oct 24 '24 18:10 SgtPooki

bun tests passed when I explicitly installed node>20.. https://github.com/ipfs-examples/helia-examples/actions/runs/11505990080/job/32028925951?pr=101

is bun calling node or are we calling it somehow? testing if we can alias node to bun in github CI: 26415bd (#101)

SgtPooki avatar Oct 24 '24 19:10 SgtPooki

FYI: bun is not running successfully due to some crypto errors

SgtPooki avatar Oct 24 '24 20:10 SgtPooki