Skip to content

Commit 06306fe

Browse files
authored
Merge pull request #446 from hatoo/pgojs
pgo using bun
2 parents 53f6451 + 28deaeb commit 06306fe

File tree

5 files changed

+51
-25
lines changed

5 files changed

+51
-25
lines changed

.github/workflows/release-pgo.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ jobs:
4343
with:
4444
targets: ${{ matrix.target }}
4545
components: llvm-tools-preview
46-
- run: cargo install cargo-pgo
47-
- uses: taiki-e/install-action@just
48-
- run: just pgo '--target ${{ matrix.target }} ${{ matrix.additional_args }}'
46+
- run: cargo install cargo-pgo --version 0.2.6
47+
- uses: oven-sh/setup-bun@v1
48+
- run: bun run pgo.js --target ${{ matrix.target }} ${{ matrix.additional_args }}
4949
- name: Upload binaries to release
5050
uses: svenstaro/upload-release-action@v1-release
5151
with:

Cargo.lock

+25-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ tokio-vsock = { version = "0.5.0", optional = true }
7373
rlimit = "0.10.0"
7474
jemallocator = "0.5.0"
7575

76+
[target.x86_64-unknown-linux-musl.dependencies]
77+
# Workaround for release CI
78+
aws-lc-rs = { version = "1.0.0", features = ["bindgen"] }
79+
7680
[dev-dependencies]
7781
assert_cmd = "2.0.2"
7882
axum = { version = "0.7", features = ["http2"] }

justfile

-20
This file was deleted.

pgo.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { $ } from "bun";
2+
3+
let additional = [];
4+
5+
if (Bun.argv.length >= 3) {
6+
additional = Bun.argv.slice(2);
7+
}
8+
9+
let server = null;
10+
11+
try {
12+
server = Bun.spawn(['cargo', 'run', '--release', '--manifest-path', 'pgo/server/Cargo.toml']);
13+
await $`cargo pgo run -- --profile pgo ${additional} -- -z 3m -c 900 --no-tui http://localhost:8888`;
14+
await $`cargo pgo optimize build -- --profile pgo ${additional}`
15+
} finally {
16+
if (server !== null) {
17+
server.kill();
18+
}
19+
}

0 commit comments

Comments
 (0)