oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.31k stars 2.78k forks source link

Bun doesn't install the baseline version #7607

Open Pigges opened 11 months ago

Pigges commented 11 months ago

What version of Bun is running?

1.0.17+5e60861c3

What platform is your computer?

Linux 6.1.0-13-amd64 x86_64 unknown

What steps can reproduce the bug?

Installing Bun using the recommended installation method on the website curl -fsSL https://bun.sh/install | bash

What is the expected behavior?

Install the baseline version of Bun.

What do you see instead?

It just throws Illegal instruction at me whenever I try to run a script, bun upgrade or bun install.

Additional information

I've tried to manually download the baseline version from the releases on Github and this seem to work perfectly. To my knowledge, only the AVX512 features should be unavailable, as it is a VPS with an emulated x86-64-v3-model.

paperdave commented 11 months ago

it seems the dection in the install script does not work. can you test this for me in a terminal

cat /proc/cpuinfo | grep avx2
paperdave commented 11 months ago
image

in the install script we do this, so something has gone wrong

Pigges commented 11 months ago

After running cat /proc/cpuinfo | grep avx2, I get this:

flags       : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c hypervisor lahf_lm abm cpuid_fault pti bmi1 avx2 bmi2
Jarred-Sumner commented 11 months ago

We currently target Haswell which is within the x86-64-v3 list

I wish there was a way to get the list of required cpu flags from an executable just compare that

Pigges commented 11 months ago

I found pkgw/elfx86exts, which should give me the instruction set extensions a binary uses.

Using the latest release v1.0.18, I got this result for the binaries:

Instruction set extensions used: 3DNow, ADX, AES, AVX, AVX2, AVX512, BMI, BMI2, BWI, CMOV, DQI, MODE64, NOT64BITMODE, NOVLX, PCLMUL, SHA, SSE1, SSE2, SSE3, SSE41, SSE42, SSSE3, VLX

Not sure if this helps, but trying to be useful.

Pigges commented 10 months ago

Update: By manually changing the ~/.bun/bin/bun binary to the baseline version seem to work. I used bun upgrade to get the latest version. It appears to be installing the new baseline version and it works to execute files now. Not sure if this way have any issues, but it appears to work as far as I am aware.