Skip to content

Commit

Permalink
Build yara-x with increased memory, --target-dir for cargo-c, and opt…
Browse files Browse the repository at this point in the history
…imizations (#38392)

I had some local Melange changes that made #38328 appear valid when in
fact the build artifacts for `cargo-c` were still landing in `/tmp`.

This PR specifies `--target-dir` to redirect `cargo-c`'s build artifacts
to a non-`/tmp` directory to avoid running in to QEMU's `noexec` tmpfs.

Once this was fixed, the `cargo-c` install was OOM'ing with the default
`-m 4000000k` configuration so I added a memory requirement of `6Gi`
which allowed the build to succeed. Finally, I added `opt-level=3` to
build the `yara-x-capi` with all available optimizations.

---------

Signed-off-by: egibs <[email protected]>
  • Loading branch information
egibs authored Dec 26, 2024
1 parent a283072 commit bd3fdfd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions yara-x.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package:
name: yara-x
version: 0.12.0
epoch: 1
epoch: 2
description: "A rewrite of YARA in Rust."
copyright:
- license: BSD-3-Clause
resources:
memory: 6Gi

environment:
contents:
Expand All @@ -15,6 +17,8 @@ environment:
- perl
- rust
- wolfi-base
environment:
RUSTFLAGS: "-C opt-level=3"

pipeline:
- uses: git-checkout
Expand All @@ -23,7 +27,7 @@ pipeline:
expected-commit: d2b8358879c009f41f0e14847681f2f8dbe624cf
tag: v${{package.version}}

- runs: cargo install cargo-c --features=vendored-openssl --root $HOME/.cargo
- runs: cargo install cargo-c --features=vendored-openssl --root $HOME/.cargo --target-dir $HOME/.cargo

- runs: cargo cinstall -p yara-x-capi --release --prefix=/usr --pkgconfigdir=/usr/lib/pkgconfig --includedir=/usr/include --libdir=/usr/lib

Expand Down

0 comments on commit bd3fdfd

Please sign in to comment.