Skip to content

Commit

Permalink
fix #13563 and #12440 (#13575)
Browse files Browse the repository at this point in the history
  • Loading branch information
dylan-conway authored Aug 28, 2024
1 parent f520715 commit 1976e5b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/install/bin.zig
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,11 @@ pub const Bin = extern struct {
const abs_exe_file: [:0]const u16 = dest_buf[0 .. abs_dest_w.len + ".exe".len :0];

bun.sys.File.writeFile(bun.invalid_fd, abs_exe_file, WinBinLinkingShim.embedded_executable_data).unwrap() catch |err| {
if (err == error.EBUSY) {
// exe is most likely running. bunx file has already been updated, ignore error
return;
}

this.err = err;
return;
};
Expand Down
7 changes: 6 additions & 1 deletion src/install/install.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1207,8 +1207,13 @@ pub fn NewPackageInstall(comptime kind: PkgInstallKind) type {
if (!package_json_checker.has_found_version and resolution_tag != .workspace) return false;

const found_version = package_json_checker.found_version;

// exclude build tags from comparsion
// https://github.com/oven-sh/bun/issues/13563
const found_version_end = strings.lastIndexOfChar(found_version, '+') orelse found_version.len;
const expected_version_end = strings.lastIndexOfChar(this.package_version, '+') orelse this.package_version.len;
// Check if the version matches
if (!strings.eql(found_version, this.package_version)) {
if (!strings.eql(found_version[0..found_version_end], this.package_version[0..expected_version_end])) {
const offset = brk: {
// ASCII only.
for (0..found_version.len) |c| {
Expand Down

0 comments on commit 1976e5b

Please sign in to comment.