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

bun/1.1.43 package update #39096

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

octo-sts[bot]
Copy link
Contributor

@octo-sts octo-sts bot commented Jan 8, 2025

@octo-sts octo-sts bot added request-version-update request for a newer version of a package automated pr bincapz/pass bincapz/pass Bincapz (aka. malcontent) scan didn't detect any CRITICALs on the scanned packages. auto-approver-bot/initial-checks-failed labels Jan 8, 2025
Copy link
Contributor Author

octo-sts bot commented Jan 12, 2025

⚠️ EXPERIMENTAL

Please use 👍 or 👎 on this comment to indicate if you agree or disagree with the recommendation.

To provide more detailed feedback please comment on the recommendation prefixed with /ai-verify:

e.g. /ai-verify partially helpful but I also added bash to the build environment

Gen AI suggestions to solve the build error:

• Detected Error: "ninja: subcommand failed" followed by "error: script "build:release" exited with code 1"

• Error Category: Build

• Failure Point: The bun run build:release command in the pipeline

• Root Cause Analysis: The build is failing during the ninja build process, likely due to missing or incompatible dependencies. The error occurs after package installation and during the actual build step.

• Suggested Fix:

  1. Add these additional build dependencies to the environment.contents.packages section:
- python3
- libstdc++-dev
- linux-headers
  1. Add explicit environment variables to control the build:
environment:
  contents:
    packages:
      # existing packages...
  variables:
    CXXFLAGS: "-fPIC"
    LDFLAGS: "-fuse-ld=lld"
    CC: "clang-18"
    CXX: "clang++-18"

• Explanation:

  • Bun's build process requires Python 3 for some build scripts
  • The C++ standard library headers are needed for compilation
  • Linux headers are required for system calls
  • The environment variables ensure consistent compiler usage and proper linking
  • Using LLD as the linker can help avoid GNU ld issues

• Additional Notes:

  • The build is completing package installation but failing during native code compilation
  • The error occurs after successful dependency installation indicating it's a build-time issue
  • Consider adding --verbose to the build command for more detailed error output
  • May need to increase resource limits if build is memory-intensive

• References:

@octo-sts octo-sts bot added the ai/skip-comment Stop AI from commenting on PR label Jan 12, 2025
@Dentrax Dentrax force-pushed the wolfictl-f400944f-78de-4c05-903a-ce10b7143024 branch from 2fb8d4e to 6ac4098 Compare January 12, 2025 19:35
@Dentrax Dentrax force-pushed the wolfictl-f400944f-78de-4c05-903a-ce10b7143024 branch from 6ac4098 to 09fd6d3 Compare January 12, 2025 19:36
@Dentrax
Copy link
Member

Dentrax commented Jan 12, 2025

I found the following ninja error:

[3/410] cd /home/build && /usr/bin/bun run /home/build/src/codegen/bindgen.ts --debug=OFF --codegen-root=/home/build/build/release/codegen
ninja: job failed: cd /home/build && /usr/bin/bun run /home/build/src/codegen/bindgen.ts --debug=OFF --codegen-root=/home/build/build/release/codegen
884 |   }
885 |   throw new Error("Couldn't find caller location in stack trace");
886 | }
887 | 
888 | function stackTraceFileName(line: string): string {
889 |   return / \(((?:[A-Za-z]:)?.*?)[:)]/.exec(line)![1].replaceAll("\\", "/");
                                                     ^
TypeError: null is not an object (evaluating '/ \(((?:[A-Za-z]:)?.*?)[:)]/.exec(line)[1]')
      at stackTraceFileName (/home/build/src/codegen/bindgen-lib-internal.ts:889:48)
      at new TypeImpl (/home/build/src/codegen/bindgen-lib-internal.ts:121:36)
      at default (/home/build/src/codegen/bindgen-lib-internal.ts:593:12)
      at /home/build/src/bun.js/api/BunObject.bind.ts:4:23
      at /home/build/src/codegen/bindgen.ts:1094:31

It seems the issue at the bindgen-lib-internal.ts of the codegen package, function named stackTraceFileName. If we update it to:

function stackTraceFileName(line: string): string {
  // Attempt to match lines with parentheses
  let regex = / \(((?:[A-Za-z]:)?.*?)[:)]/;
  let match = regex.exec(line);
  if (match && match[1]) {
    return match[1].replace(/\\/g, "/");
  }

  // Attempt to match lines without parentheses
  regex = /at\s+(.+?):\d+:\d+/;
  match = regex.exec(line);
  if (match && match[1]) {
    return match[1].replace(/\\/g, "/");
  }

  // If both regex attempts fail, log the problematic line and throw an error
  console.error("Failed to parse stack trace line:", line);
  throw new Error("Couldn't find caller location in stack trace");
}

then this exists with 0:

cd /home/build && /usr/bin/bun run /home/build/src/codegen/bindgen.ts --debug=OFF --codegen-root=/home/build/build/release/codegen

Maybe this might helpful? oven-sh/bun@487da0a

Update: Yes, build now passes but test fails with Aborted (core dumped)

/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14/../../../../include/c++/14/span:286: reference std::span<const unsigned char>::operator[](size_type) const [_Type = const unsigned char, _Extent = 18446744073709551615]: Assertion '__idx < size()' failed.

I think this is also a regession.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ai/skip-comment Stop AI from commenting on PR auto-approver-bot/initial-checks-failed automated pr bincapz/pass bincapz/pass Bincapz (aka. malcontent) scan didn't detect any CRITICALs on the scanned packages. manual/review-needed request-version-update request for a newer version of a package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants