termux-packages icon indicating copy to clipboard operation
termux-packages copied to clipboard

[Package]: Bun

Open leap0x7b opened this issue 2 years ago • 10 comments

Package description

Bun is a new JavaScript runtime with a native bundler, transpiler, task runner and npm client built-in.

Home page URL

https://bun.sh

Source code URL

https://github.com/Jarred-Sumner/bun

Packaging policy acknowledgement

Additional information

No response

leap0x7b avatar Jul 07 '22 10:07 leap0x7b

Bun now supports Linux aarch64. From oven-sh/bun#75.

However, downloading and using it results in error.

bash: ./bun: No such file or directory

That's because it will need to be an Android aarch64 build.

Same if using npm to install.

npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for [email protected]: wanted {"os":"darwin,linux","arch":"arm64,x64"} (current: {"os":"android","arch":"arm64"})
npm ERR! notsup Valid OS:    darwin,linux
npm ERR! notsup Valid Arch:  arm64,x64
npm ERR! notsup Actual OS:   android
npm ERR! notsup Actual Arch: arm64

npm ERR! A complete log of this run can be found in:
npm ERR!     /data/data/com.termux/files/home/.npm/_logs/2023-02-10T08_22_51_052Z-debug-0.log

joshcangit avatar Jul 13 '22 14:07 joshcangit

Bun has released support for aarch64 so I hope this will get added soon!

EAGLE1309 avatar Jul 24 '22 15:07 EAGLE1309

Any update?

SunPodder avatar Dec 06 '22 05:12 SunPodder

you should use grun (glibc for termux) to run bun aarch64, use grun ./bun ...

PeterHackz avatar Jan 31 '23 17:01 PeterHackz

you should use grun (glibc for termux) to run bun aarch64, use grun ./bun ...

How to get the grun(glibc), i have try to pkg install glibc and it not found

holiq avatar Apr 17 '23 22:04 holiq

How to get the grun(glibc), i have try to pkg install glibc and it not found

https://wiki.termux.com/wiki/Switching_package_manager

https://github.com/termux-pacman/glibc-packages

2096779623 avatar Apr 17 '23 22:04 2096779623

How to get the grun(glibc), i have try to pkg install glibc and it not found

https://wiki.termux.com/wiki/Switching_package_manager

https://github.com/termux-pacman/glibc-packages

If you only want to use pacman for the gpkg-dev repo, then it is not necessary to completely switch to pacman as the default package manager.

Maxython avatar Apr 18 '23 05:04 Maxython

It's work, thanks @2096779623 @Maxython

holiq avatar Apr 18 '23 06:04 holiq

Maybe bun should be added to the TUR repository.

joshcangit avatar Apr 19 '23 09:04 joshcangit

Bun cannot be added to termux yet. I don’t know what’s that grun thing is. But I tried building bun and it requires latest zig which has some breaking changes from what we have in termux. Ig we need to update zig first.

This is the error

./build.zig:51:9: error: no member named 'source' in struct 'std.build.Pkg'
[460](https://github.com/SunPodder/termux-packages/actions/runs/4214755107/jobs/7315425240#step:6:461)
        .source = pkgPath("src/bun_redirect.zig"),
[461](https://github.com/SunPodder/termux-packages/actions/runs/4214755107/jobs/7315425240#step:6:462)
        ^
[462](https://github.com/SunPodder/termux-packages/actions/runs/4214755107/jobs/7315425240#step:6:463)
./build.zig:323:32: note: called from here
[463](https://github.com/SunPodder/termux-packages/actions/runs/4214755107/jobs/7315425240#step:6:464)
        try addInternalPackages(
[464](https://github.com/SunPodder/termux-packages/actions/runs/4214755107/jobs/7315425240#step:6:465)
                               ^
[465](https://github.com/SunPodder/termux-packages/actions/runs/4214755107/jobs/7315425240#step:6:466)
./build.zig:207:43: note: called from here
[466](https://github.com/SunPodder/termux-packages/actions/runs/4214755107/jobs/7315425240#step:6:467)
pub fn build(b: *std.build.Builder) !void {
[467](https://github.com/SunPodder/termux-packages/actions/runs/4214755107/jobs/7315425240#step:6:468)
                                          ^
[468](https://github.com/SunPodder/termux-packages/actions/runs/4214755107/jobs/7315425240#step:6:469)
./build.zig:178:79: error: no member named 'mode' in struct 'std.fs.file.OpenFlags'
[469](https://github.com/SunPodder/termux-packages/actions/runs/4214755107/jobs/7315425240#step:6:470)
    var runtime_out_file = try std.fs.cwd().openFile("src/runtime.out.js", .{ .mode = .read_only });
[470](https://github.com/SunPodder/termux-packages/actions/runs/4214755107/jobs/7315425240#step:6:471)
                                                                              ^
[471](https://github.com/SunPodder/termux-packages/actions/runs/4214755107/jobs/7315425240#step:6:472)
./build.zig:12:9: error: no member named 'addIncludePath' in struct 'std.build.LibExeObjStep'
[472](https://github.com/SunPodder/termux-packages/actions/runs/4214755107/jobs/7315425240#step:6:473)
    step.addIncludePath("src/deps");
[473](https://github.com/SunPodder/termux-packages/actions/runs/4214755107/jobs/7315425240#step:6:474)
        ^
[474](https://github.com/SunPodder/termux-packages/actions/runs/4214755107/jobs/7315425240#step:6:475)
./build.zig:320:20: note: called from here
[475](https://github.com/SunPodder/termux-packages/actions/runs/4214755107/jobs/7315425240#step:6:476)
        addPicoHTTP(obj, false);
[476](https://github.com/SunPodder/termux-packages/actions/runs/4214755107/jobs/7315425240#step:6:477)
                   ^
[477](https://github.com/SunPodder/termux-packages/actions/runs/4214755107/jobs/7315425240#step:6:478)
./build.zig:207:43: note: called from here
[478](https://github.com/SunPodder/termux-packages/actions/runs/4214755107/jobs/7315425240#step:6:479)
pub fn build(b: *std.build.Builder) !void {

https://devlog.hexops.com/2023/zig-0-11-breaking-build-changes/

SunPodder avatar Apr 20 '23 04:04 SunPodder

Any updates? I need the package too

nacho00112 avatar Jun 18 '23 20:06 nacho00112

Any updates? I need the package too

If see from Bun release, it can install with npm, but idk it work on termux or not

holiq avatar Jun 19 '23 03:06 holiq

No, bun must be built from source into a package to be able to be installed in Termux.

Using npm will error out if used to install bun that way.

npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for [email protected]: wanted {"os":"darwin,linux","cpu":"arm64,x64"} (current: {"os":"android","cpu":"arm64"})
npm ERR! notsup Valid os:   darwin,linux
npm ERR! notsup Actual os:  android
npm ERR! notsup Valid cpu:  arm64,x64
npm ERR! notsup Actual cpu: arm64

npm ERR! A complete log of this run can be found in: /data/data/com.termux/files/home/.npm/_logs/2023-06-20T05_55_23_614Z-debug-0.log

joshcangit avatar Jun 20 '23 05:06 joshcangit

No, bun must be built from source into a package to be able to be installed in Termux.

Using npm will error out if used to install bun that way.

npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for [email protected]: wanted {"os":"darwin,linux","cpu":"arm64,x64"} (current: {"os":"android","cpu":"arm64"})
npm ERR! notsup Valid os:   darwin,linux
npm ERR! notsup Actual os:  android
npm ERR! notsup Valid cpu:  arm64,x64
npm ERR! notsup Actual cpu: arm64

npm ERR! A complete log of this run can be found in: /data/data/com.termux/files/home/.npm/_logs/2023-06-20T05_55_23_614Z-debug-0.log

I just downloaded it from their releases and it work ig. idk how I got grun, I installed it over a year ago. but it provides glibc runtime iirc Screenshot_20230620-090734

PeterHackz avatar Jun 20 '23 06:06 PeterHackz

thanks @Maxython got it working and made an alias alias bun='grun ~/.bun/bin/bun'

neuthral avatar Aug 16 '23 23:08 neuthral

Bun cannot be added to termux yet. I don’t know what’s that grun thing is. But I tried building bun and it requires latest zig which has some breaking changes from what we have in termux. Ig we need to update zig first.

Latest version of zig is available on termux now. zig_Termux

n-ce avatar Sep 07 '23 14:09 n-ce

Bun cannot be added to termux yet. I don’t know what’s that grun thing is. But I tried building bun and it requires latest zig which has some breaking changes from what we have in termux. Ig we need to update zig first.

Latest version of zig is available on termux now. zig_Termux

Yeah I have looked into it. Currently there's no official way to cross compile bun. Moreover, building bun requires a pre-built bun executable. So there's no way to build it on-device either.

SunPodder avatar Sep 07 '23 15:09 SunPodder

@HaccerCat @holiq does grun bun install work for you? I'm using bun 1.0.0 and it doesn't work.

bun install glob
bun add v1.0.0 (822a00c4)

 installed [email protected] with binaries:
  - glob

Failed to install 41 packages
error: AccessDenied installing bun-types
error: AccessDenied installing glob
error: AccessDenied installing foreground-child
error: AccessDenied installing jackspeak
error: AccessDenied installing minimatch
error: AccessDenied installing minipass
error: AccessDenied installing path-scurry
error: AccessDenied installing cross-spawn
...

SunPodder avatar Sep 09 '23 11:09 SunPodder

According to the official docs...

Bun must be installed to compile Bun

Bun depends on ESBuild

Wow, just wow. Why the heck don't the Bun devs directly use ESBuild to bundle and minify those files instead?

PoneyClairDeLune avatar Sep 09 '23 11:09 PoneyClairDeLune

@HaccerCat @holiq does grun bun install work for you? I'm using bun 1.0.0 and it doesn't work.

bun install glob
bun add v1.0.0 (822a00c4)

 installed [email protected] with binaries:
  - glob

Failed to install 41 packages
error: AccessDenied installing bun-types
error: AccessDenied installing glob
error: AccessDenied installing foreground-child
error: AccessDenied installing jackspeak
error: AccessDenied installing minimatch
error: AccessDenied installing minipass
error: AccessDenied installing path-scurry
error: AccessDenied installing cross-spawn
...

Try this:

bun install --backend=copyfile glob

Maxython avatar Sep 09 '23 11:09 Maxython

@HaccerCat @holiq does grun bun install work for you? I'm using bun 1.0.0 and it doesn't work.

bun install glob
bun add v1.0.0 (822a00c4)

 installed [email protected] with binaries:
  - glob

Failed to install 41 packages
error: AccessDenied installing bun-types
error: AccessDenied installing glob
error: AccessDenied installing foreground-child
error: AccessDenied installing jackspeak
error: AccessDenied installing minimatch
error: AccessDenied installing minipass
error: AccessDenied installing path-scurry
error: AccessDenied installing cross-spawn
...

that's because bun tries to create hardlinks

romanovj avatar Sep 09 '23 15:09 romanovj

@HaccerCat @holiq does grun bun install work for you? I'm using bun 1.0.0 and it doesn't work.

bun install glob
bun add v1.0.0 (822a00c4)

 installed [email protected] with binaries:
  - glob

Failed to install 41 packages
error: AccessDenied installing bun-types
error: AccessDenied installing glob
error: AccessDenied installing foreground-child
error: AccessDenied installing jackspeak
error: AccessDenied installing minimatch
error: AccessDenied installing minipass
error: AccessDenied installing path-scurry
error: AccessDenied installing cross-spawn
...

I did not try 1.0 and actually did not use bun since a long time, but last time I used bun install I got a kernel or syscall error I forgot 😆

PeterHackz avatar Sep 10 '23 07:09 PeterHackz

@HaccerCat @holiq does grun bun install work for you? I'm using bun 1.0.0 and it doesn't work.

bun install glob
bun add v1.0.0 (822a00c4)

 installed [email protected] with binaries:
  - glob

Failed to install 41 packages
error: AccessDenied installing bun-types
error: AccessDenied installing glob
error: AccessDenied installing foreground-child
error: AccessDenied installing jackspeak
error: AccessDenied installing minimatch
error: AccessDenied installing minipass
error: AccessDenied installing path-scurry
error: AccessDenied installing cross-spawn
...

No bro, I haven't tried it

holiq avatar Sep 10 '23 08:09 holiq

It's work, thanks @2096779623 @Maxython

Can u please tell me also, what I have to do.

I am very beginner in linux (in termux too)

** Please provide step by step guide, (commends if possible)**

# my state
bun
exec: Failed to execute process '/data/data/com.termux/files/home/.bun/bin/bun': The file exists and is executable. Check the interpreter or linker?

kaushiksahu18 avatar Mar 02 '24 19:03 kaushiksahu18