Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canary Dockerfile bun build --compile is weird #16942

Open
Gobd opened this issue Jan 31, 2025 · 2 comments
Open

Canary Dockerfile bun build --compile is weird #16942

Gobd opened this issue Jan 31, 2025 · 2 comments
Labels
bug Something isn't working bundler Something to do with the bundler

Comments

@Gobd
Copy link
Contributor

Gobd commented Jan 31, 2025

What version of Bun is running?

1.2.1-canary.37+d4ce42198

What platform is your computer?

No response

What steps can reproduce the bug?

docker run --pull=always --platform=linux/amd64 -it oven/bun:canary sh
bun --revision
# 1.2.1-canary.37+d4ce42198
echo "console.log(Bun.revision)" > a.ts
bun build --compile --target=bun-linux-x64-modern ./a.ts --outfile modern
./modern
# ce532901ceb43e94f9aa0f5b19a19b8b8b404ae1
bun build --compile --target=bun-linux-x64-baseline ./a.ts --outfile baseline
./baseline
# d4ce421982edc531b0f8ae61f32d06cd9319be02

What is the expected behavior?

Every build uses the same revision, or at least a relatively new one. Baseline matches the docker iamges I'm running, but modern is very old.

Canary is not that useful for testing if it's not up to date, and weird for testing if the results are not predictable.

@Gobd Gobd added bug Something isn't working needs triage labels Jan 31, 2025
@RiskyMH
Copy link
Member

RiskyMH commented Feb 1, 2025

So the modern commit hash is the release of 1.2.1. I am going to assume for versions other then itself (ie if it has to download off internet), it does either latest or maybe same version (and forgetting about canary).

Note there is only "one" canary release that gets replaced, so even if this was fixed to pull latest canary it has chance of desyncing still.

@RiskyMH RiskyMH added bundler Something to do with the bundler and removed needs triage labels Feb 1, 2025
@RiskyMH
Copy link
Member

RiskyMH commented Feb 3, 2025

Makes sense now, it installs the other binaries through npm. Not sure best way to use same canary though (there is a nightly canary publish on npm so maybe).

pub fn toNPMRegistryURLWithURL(this: *const CompileTarget, buf: []u8, registry_url: []const u8) ![]const u8 {
return switch (this.os) {
inline else => |os| switch (this.arch) {
inline else => |arch| switch (this.libc) {
inline else => |libc| switch (this.baseline) {
// https://registry.npmjs.org/@oven/bun-linux-x64/-/bun-linux-x64-0.1.6.tgz
inline else => |is_baseline| try std.fmt.bufPrint(buf, comptime "{s}/@oven/bun-" ++
os.npmName() ++ "-" ++ arch.npmName() ++
libc.npmName() ++
(if (is_baseline) "-baseline" else "") ++
"/-/bun-" ++
os.npmName() ++ "-" ++ arch.npmName() ++
libc.npmName() ++
(if (is_baseline) "-baseline" else "") ++
"-" ++
"{d}.{d}.{d}.tgz", .{
registry_url,
this.version.major,
this.version.minor,
this.version.patch,
}),
},
},
},
};
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bundler Something to do with the bundler
Projects
None yet
Development

No branches or pull requests

2 participants