Skip to content

Commit 9db64b5

Browse files
committed
chore: remove cross-rs references
1 parent 9b6c90d commit 9db64b5

File tree

5 files changed

+12
-85
lines changed

5 files changed

+12
-85
lines changed

Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ build-%:
2929
@echo "Building $* with mode: $(BUILD_MODE), bin $(BIN) and arch: $(ARCH)"
3030
ARCH=$(ARCH) BUILD_MODE=$(BUILD_MODE) BIN="newrelic-$(*)" PKG="newrelic_agent_control" ./build/scripts/build_binary.sh
3131

32-
cross-build-%:
33-
@echo "Building $* using cross-rs with mode: $(BUILD_MODE), bin $(BIN) and arch: $(ARCH)"
34-
ARCH=$(ARCH) BUILD_MODE=$(BUILD_MODE) BIN="newrelic-$(*)" PKG="newrelic_agent_control" ./build/scripts/build_binary_cross.sh
35-
3632
.PHONY: tilt-up
3733
tilt-up:
3834
tilt up ; tilt down

Tiltfile

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ cluster = os.getenv('CLUSTER', "")
1717
chartmuseum_basic_auth = os.getenv('CHARTMUSEUM_BASIC_AUTH', "")
1818

1919
# build_with options:
20-
# cargo: No crosscompilation, faster than cross
21-
# cross: Supports crosscompilaton
20+
# cargo: No crosscompilation, faster than cargo-zigbuild
21+
# zig: Supports crosscompilaton
2222
build_with = os.getenv('BUILD_WITH','zig')
2323
arch = os.getenv('ARCH','arm64')
2424
target_tuple = os.getenv('TARGET_TUPLE', 'aarch64-unknown-linux-musl')
@@ -39,15 +39,6 @@ if build_with == 'cargo':
3939
'./agent-control',
4040
]
4141
)
42-
elif build_with == 'cross':
43-
local_resource(
44-
'build-binary',
45-
cmd="make BUILD_MODE=debug ARCH=%s cross-build-agent-control-cli" % arch +
46-
"&& make BUILD_MODE=debug ARCH=%s cross-build-agent-control-k8s" % arch ,
47-
deps=[
48-
'./agent-control',
49-
]
50-
)
5142
elif build_with == 'zig':
5243
local_resource(
5344
'build-binary',

agent-control/tests/k8s/Tiltfile

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ helm_resource(
3434
)
3535

3636
# build_with options:
37-
# cargo: No crosscompilation, faster than cross
38-
# cross: Supports crosscompilaton
37+
# cargo: No crosscompilation, faster than cargo-zigbuild
38+
# zig: Supports crosscompilaton
3939
build_with = os.getenv('BUILD_WITH','zig')
4040
arch = os.getenv('ARCH','arm64')
4141
target_tuple = os.getenv('TARGET_TUPLE', 'aarch64-unknown-linux-musl')
@@ -49,13 +49,6 @@ if build_with == 'cargo':
4949
cmd="cargo build --package newrelic_agent_control --bin newrelic-agent-control-k8s && mkdir -p bin && rm -f bin/newrelic-agent-control-"+arch+" && mv target/debug/newrelic-agent-control-k8s bin/newrelic-agent-control-"+arch,
5050
deps=["../../../agent-control/src"]
5151
)
52-
elif build_with == 'cross':
53-
local_resource(
54-
'build-binary',
55-
dir="../../../",
56-
cmd="make BUILD_MODE=debug ARCH=%s cross-build-agent-control-k8s" % arch,
57-
deps=["../../../agent-control/src"]
58-
)
5952
elif build_with == 'zig':
6053
local_resource(
6154
'build-binary',

build/scripts/build_binary_cross.sh

Lines changed: 0 additions & 46 deletions
This file was deleted.

docs/DEVELOPMENT.md

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22

33
## Compiling and running Agent Control
44

5-
As of now, Agent Control is supported on Linux (x86_64 and aarch64). The program is written in Rust, and for multiplatform compilation we leverage [`cross`](https://github.com/cross-rs/cross).
5+
As of now, Agent Control is supported on Linux (x86_64 and aarch64). The program is written in Rust, and for multiplatform compilation we leverage [`cargo-zigbuild`](https://github.com/rust-cross/cargo-zigbuild) and musl libc.
66

77
### On-host
88

99
To compile and run locally:
1010

11-
1. Install the [Rust toolchain](https://www.rust-lang.org/tools/install) for your system.
12-
2. Run `cargo build --bin newrelic-agent-control-onhost`
13-
3. `newrelic-agent-control-onhost` binary will be generated at `./target/debug/newrelic-agent-control-onhost`
14-
4. Prepare a `config.yaml` file in `/etc/newrelic-agent-control/`, example:
11+
1. Install the [Rust toolchain](https://www.rust-lang.org/tools/install) for your system, also add the relevant target for your system, e.g. (`rustup target add x86_64-unknown-linux-musl`).
12+
2. Install `cargo-zigbuild` with `cargo install --locked cargo-zigbuild`.
13+
3. Run `cargo zigbuild --bin newrelic-agent-control --target <ARCH>-unknown-linux-musl`, where `<ARCH>` is either `x86_64` or `aarch64`, depending on your system.
14+
4. `newrelic-agent-control` binary will be generated at `./target/<ARCH>-unknown-linux-musl/debug/newrelic-agent-control`
15+
5. Prepare a `config.yaml` file in `/etc/newrelic-agent-control/`, example:
1516

1617
```yaml
1718
fleet_control:
@@ -23,7 +24,7 @@ To compile and run locally:
2324
agent_type: "newrelic/io.opentelemetry.collector:0.1.0"
2425
```
2526
26-
5. Place values files in the folder `/etc/newrelic-agent-control/fleet/agents.d/{AGENT-ID}/` where `AGENT-ID` is a key in the
27+
6. Place values files in the folder `/etc/newrelic-agent-control/fleet/agents.d/{AGENT-ID}/` where `AGENT-ID` is a key in the
2728
`agents:` list. Example:
2829

2930
```yaml
@@ -34,7 +35,7 @@ To compile and run locally:
3435
# pipelines:
3536
```
3637

37-
6. Execute the binary with the config file with `sudo ./target/debug/newrelic-agent-control`
38+
7. Execute the binary with the config file with `sudo ./target/debug/newrelic-agent-control`
3839

3940
#### Filesystem layout and persistence
4041

@@ -95,14 +96,6 @@ We use [`minikube`](https://minikube.sigs.k8s.io/docs/) and [`tilt`](https://til
9596
- Ensure you have `tilt` installed for managing local development environments.
9697
- Add an Agent Control values file in `local/agent-control-tilt.yml`.
9798

98-
> [!CAUTION]
99-
> Be aware that `cross` 0.2.5 [broke cross-compilation](https://github.com/cross-rs/cross/issues/1214). If you are using
100-
> it, run the following command.
101-
>
102-
> ```sh
103-
> docker pull ghcr.io/cross-rs/aarch64-unknown-linux-musl:0.2.5 --platform linux/x86_64
104-
> ```
105-
10699
Note: Adding the `'chart_repo'` setting, pointing to the [New Relic charts](https://github.com/newrelic/helm-charts/tree/master/charts) on a local path, allows using local helm charts.
107100

108101
#### Steps

0 commit comments

Comments
 (0)