Skip to content

feat: test on bun runtime#101

Open
whizzzkid wants to merge 31 commits into
mainfrom
feat/bun-run
Open

feat: test on bun runtime#101
whizzzkid wants to merge 31 commits into
mainfrom
feat/bun-run

Conversation

@whizzzkid
Copy link
Copy Markdown
Contributor

@whizzzkid whizzzkid commented Aug 3, 2023

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

Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>
Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>
Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>
@whizzzkid whizzzkid marked this pull request as ready for review August 3, 2023 00:49
@whizzzkid whizzzkid marked this pull request as draft August 3, 2023 00:57
Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>
Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>
@achingbrain
Copy link
Copy Markdown
Contributor

This looks promising, but everything is broken?

@achingbrain
Copy link
Copy Markdown
Contributor

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 achingbrain changed the title feat(runtime): ➕ Adding bun runtime feat: test on bun runtime Feb 8, 2024
@achingbrain
Copy link
Copy Markdown
Contributor

achingbrain commented Feb 8, 2024

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 23, 2024

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

Comment thread .github/workflows/ci.yml Outdated
@SgtPooki
Copy link
Copy Markdown
Contributor

SgtPooki commented Apr 24, 2024

I think we need to pull in test-ipfs-example@1.3.0 here for things to work?

@SgtPooki
Copy link
Copy Markdown
Contributor

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
Copy link
Copy Markdown
Contributor

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

@SgtPooki SgtPooki marked this pull request as ready for review April 24, 2024 19:16
SgtPooki
SgtPooki previously approved these changes Apr 24, 2024
Copy link
Copy Markdown
Contributor

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

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

lgtm

@SgtPooki SgtPooki requested a review from achingbrain April 24, 2024 19:16
@SgtPooki
Copy link
Copy Markdown
Contributor

@SgtPooki
Copy link
Copy Markdown
Contributor

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
Copy link
Copy Markdown
Contributor

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
Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

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

self review

Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
@SgtPooki SgtPooki self-requested a review October 25, 2024 18:13
@SgtPooki
Copy link
Copy Markdown
Contributor

SgtPooki commented May 4, 2026

@achingbrain do you need me to. do anything here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants