Skip to content

Commit

Permalink
Add node's --inspect debugger to port detection (#2981)
Browse files Browse the repository at this point in the history
* change get_port to return Vec instead of Option

* Adjust calls to get_port to accept Vec

* Add changelog

* Add tests for node inspector port detection

* Various

* Change get_ports to take get_env fn

* Allow MIRRORD_IGNORE_DEBUGGER_PORTS to contain multiple port numbers

* Fix comment

* Various

* Add default inspector port as fallback

* Allow detection of multiple ports for inspector

* Fix tests and format

* Clippy

* Change Detected to Single variant

* Move port parsing logic to impl FromStr and impl Display

* Use FromStr and Display to set env var

* Make DebuggerPorts FromStr infallible
  • Loading branch information
gememma authored Dec 19, 2024
1 parent 7a67518 commit 254f7cc
Show file tree
Hide file tree
Showing 3 changed files with 347 additions and 132 deletions.
1 change: 1 addition & 0 deletions changelog.d/2936.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added debugger port detection type for the node `--inspect`, `--inspect-wait` and `--inspect-brk` flags
14 changes: 8 additions & 6 deletions mirrord/layer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,22 @@ workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
mirrord-config = { path = "../config"}
mirrord-protocol = { path = "../protocol"}
mirrord-layer-macro = { path = "./macro"}
mirrord-config = { path = "../config" }
mirrord-protocol = { path = "../protocol" }
mirrord-layer-macro = { path = "./macro" }
mirrord-console = { path = "../console" }
mirrord-intproxy-protocol = { path = "../intproxy/protocol", features = ["codec"] }
mirrord-intproxy-protocol = { path = "../intproxy/protocol", features = [
"codec",
] }

ctor = "0.2"
libc.workspace = true
bincode.workspace = true
nix = { workspace = true, features = ["net", "process", "signal"]}
nix = { workspace = true, features = ["net", "process", "signal"] }
tracing.workspace = true
tracing-subscriber.workspace = true
frida-gum = { version = "0.15", features = ["auto-download"] }
hyper = { workspace = true }

serde_json.workspace = true

Expand Down Expand Up @@ -60,7 +63,6 @@ mirrord-intproxy = { path = "../intproxy" }
k8s-openapi.workspace = true
chrono = { workspace = true, features = ["clock"] }
http-body = { workspace = true }
hyper = { workspace = true }
rstest.workspace = true
tempfile.workspace = true
test-cdylib = "*"
Expand Down
Loading

0 comments on commit 254f7cc

Please sign in to comment.