-
Notifications
You must be signed in to change notification settings - Fork 74
fix(binary): move logging into main thread for binary compatibility. #1804
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
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
0bfd18a
fix(logger): move logger to main thread to have compatibility with co…
e753b37
fix(root): ensure any initialization errors are logged
d45048d
feat(ci): add compile step to ci that verifies binary
1c5ee77
refactor(logging): rename declaration file to use camelCase
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,5 +31,3 @@ jobs: | |
| if: always() | ||
| - run: bun pm pack | ||
| if: always() | ||
| - run: bun run compile | ||
| if: always() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # Compiles native binaries for each platform and verifies they run. | ||
| name: compile-binaries | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| ref: | ||
| required: true | ||
| type: string | ||
|
|
||
| jobs: | ||
| smoke-test: | ||
| name: Compile (${{ matrix.name }}) | ||
| runs-on: ${{ fromJSON(matrix.runner) }} | ||
| permissions: | ||
| contents: read | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - name: Linux | ||
| runner: '["codebuild-agentcore-e2e-${{ github.run_id }}-${{ github.run_attempt }}"]' | ||
| target: linux-x64 | ||
| binary: ./dist/bin/agentcore-linux-x64 | ||
| - name: Windows | ||
| runner: '["codebuild-agentcore-e2e-${{ github.run_id }}-${{ github.run_attempt }}", "image:windows-1.0"]' | ||
| target: windows-x64 | ||
| binary: ./dist/bin/agentcore-windows-x64.exe | ||
| # CodeBuild does not support macOS. | ||
| - name: macOS | ||
| runner: '["macos-latest"]' | ||
| target: darwin-arm64 | ||
| binary: ./dist/bin/agentcore-darwin-arm64 | ||
| steps: | ||
| - uses: actions/checkout@v7 | ||
| with: | ||
| ref: ${{ inputs.ref }} | ||
| persist-credentials: false | ||
| - uses: oven-sh/setup-bun@v2 | ||
| - run: bun install --frozen-lockfile | ||
| - name: Compile binary | ||
| run: bun run compile:${{ matrix.target }} | ||
| - name: Verify binary runs | ||
| run: | | ||
| ${{ matrix.binary }} --help | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| // Type declarations for pino-roll, which does not ship its own types. | ||
| // Source of truth: https://github.com/mcollina/pino-roll/blob/master/pino-roll.js | ||
| declare module "pino-roll" { | ||
| import type { SonicBoom, SonicBoomOpts } from "sonic-boom"; | ||
|
|
||
| interface LimitOptions { | ||
| count?: number; | ||
| } | ||
|
|
||
| interface PinoRollOptions extends Omit<SonicBoomOpts, "dest"> { | ||
| /** Absolute or relative path to the log file. */ | ||
| file: string; | ||
| /** Maximum size before rotation (e.g. "10m", "1g"). */ | ||
| size?: string | number; | ||
| /** Rotation frequency ("daily", "hourly", or milliseconds). */ | ||
| frequency?: string | number; | ||
| /** File extension appended after the number (e.g. ".log"). */ | ||
| extension?: string; | ||
| /** Whether to create a symlink to the current log file. */ | ||
| symlink?: boolean; | ||
| /** Date format string appended to the file name. */ | ||
| dateFormat?: string; | ||
| /** Strategy for removing old log files. */ | ||
| limit?: LimitOptions; | ||
| /** Create parent directories if they don't exist. */ | ||
| mkdir?: boolean; | ||
| } | ||
|
|
||
| /** | ||
| * Creates a Pino transport (a SonicBoom stream) that writes to files | ||
| * and automatically rotates based on size, frequency, or both. | ||
| */ | ||
| export default function pinoRoll(options: PinoRollOptions): Promise<SonicBoom>; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would a simpler way of doing all this just be to call
make? Bun can cross-compile.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to do it individually since the matrix is parallelizing across runners so each runner needs its own binary.