Skip to content

Commit c665784

Browse files
committed
Extract an asm-cleanup library for reuse
1 parent dae947f commit c665784

File tree

10 files changed

+31
-8
lines changed

10 files changed

+31
-8
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ jobs:
185185
run: cargo fmt --manifest-path top-crates/Cargo.toml --check
186186
- name: Build backend
187187
run: |-
188-
mkdir -p ui/target; docker run --rm -v $PWD/compiler/base/modify-cargo-toml:/compiler/base/modify-cargo-toml -v $PWD/ui:/ui -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry --workdir /ui rust:alpine sh -c '
188+
mkdir -p ui/target; docker run --rm -v $PWD/compiler/base/asm-cleanup:/compiler/base/asm-cleanup -v $PWD/compiler/base/modify-cargo-toml:/compiler/base/modify-cargo-toml -v $PWD/ui:/ui -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry --workdir /ui rust:alpine sh -c '
189189
apk add musl-dev openssl-dev openssl-libs-static
190190
191191
# Adding -C relocation-model=static due to

ci/workflows.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ workflows:
288288
docker
289289
run
290290
--rm
291+
-v $PWD/compiler/base/asm-cleanup:/compiler/base/asm-cleanup
291292
-v $PWD/compiler/base/modify-cargo-toml:/compiler/base/modify-cargo-toml
292293
-v $PWD/ui:/ui
293294
-v ~/.cargo/git:/root/.cargo/git

compiler/base/.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
asm-cleanup/target
12
modify-cargo-toml/target

compiler/base/asm-cleanup/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Cargo.lock
2+
target/

compiler/base/asm-cleanup/Cargo.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[package]
2+
name = "asm-cleanup"
3+
version = "0.1.0"
4+
edition = "2018"
5+
6+
[workspace]
7+
8+
[dependencies]
9+
lazy_static = "1.0.0"
10+
petgraph = "0.6.0"
11+
regex = "1.0.0"
12+
rustc-demangle = "0.1.5"
File renamed without changes.

ui/Cargo.lock

Lines changed: 11 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,16 @@ default = ['fork-bomb-prevention']
99
fork-bomb-prevention = []
1010

1111
[dependencies]
12+
asm-cleanup = { path = "../compiler/base/asm-cleanup" }
1213
async-trait = "0.1.52"
1314
axum = { version = "0.6", features = ["headers", "ws"] }
1415
dotenv = "0.15.0"
1516
futures = "0.3.21"
1617
lazy_static = "1.0.0"
1718
octocrab = "0.25"
1819
openssl-probe = "0.1.2"
19-
petgraph = "0.6.0"
2020
prometheus = "0.13.0"
2121
regex = "1.0.0"
22-
rustc-demangle = "0.1.5"
2322
serde = { version = "1.0", features = ["rc"] }
2423
serde_derive = "1.0"
2524
serde_json = "1.0"

ui/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use tracing::{error, info, warn};
1414
const DEFAULT_ADDRESS: &str = "127.0.0.1";
1515
const DEFAULT_PORT: u16 = 5000;
1616

17-
mod asm_cleanup;
1817
mod env;
1918
mod gist;
2019
mod metrics;

ui/src/sandbox.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,11 @@ impl Sandbox {
314314

315315
if let CompileTarget::Assembly(_, demangle, process) = req.target {
316316
if demangle == DemangleAssembly::Demangle {
317-
code = crate::asm_cleanup::demangle_asm(&code);
317+
code = asm_cleanup::demangle_asm(&code);
318318
}
319319

320320
if process == ProcessAssembly::Filter {
321-
code = crate::asm_cleanup::filter_asm(&code);
321+
code = asm_cleanup::filter_asm(&code);
322322
}
323323
} else if CompileTarget::Hir == req.target {
324324
// TODO: Run rustfmt on the generated HIR.

0 commit comments

Comments
 (0)