diff mbox series

Cargo: build failure on 32-bit machine when DEBUG enabled

Message ID 20230529094211.756085-1-sundeep.kokkonda@gmail.com
State New
Headers show
Series Cargo: build failure on 32-bit machine when DEBUG enabled | expand

Commit Message

Sundeep KOKKONDA May 29, 2023, 9:42 a.m. UTC
Cargo build is failing on 32-bit machines with a 'signal: 11, SIGSEGV: invalid memory reference error'.
This is a workaround to disable the Debug builds for 32-bit machines.

Signed-off-by: Sundeep KOKKONDA <sundeep.kokkonda@windriver.com>
---
 meta/classes-recipe/cargo.bbclass | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Richard Purdie May 29, 2023, 12:38 p.m. UTC | #1
On Mon, 2023-05-29 at 15:12 +0530, Sundeep KOKKONDA wrote:
> Cargo build is failing on 32-bit machines with a 'signal: 11, SIGSEGV: invalid memory reference error'.
> This is a workaround to disable the Debug builds for 32-bit machines.
> 
> Signed-off-by: Sundeep KOKKONDA <sundeep.kokkonda@windriver.com>
> ---
>  meta/classes-recipe/cargo.bbclass | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/meta/classes-recipe/cargo.bbclass b/meta/classes-recipe/cargo.bbclass
> index 7a8cc1e751..bc5ca4fdc6 100644
> --- a/meta/classes-recipe/cargo.bbclass
> +++ b/meta/classes-recipe/cargo.bbclass
> @@ -38,6 +38,11 @@ CARGO_SRC_DIR ??= ""
>  MANIFEST_PATH ??= "${S}/${CARGO_SRC_DIR}/Cargo.toml"
>  
>  RUSTFLAGS ??= ""
> +DEBUG_BUILD:qemuarm = '0'
> +DEBUG_BUILD:qemuppc = '0'
> +DEBUG_BUILD:qemumips = '0'
> +DEBUG_BUILD:qemux86 = '0'
> +DEBUG_BUILD:virtclass-multilib-lib32 = '0'
>  BUILD_MODE = "${@['--release', ''][d.getVar('DEBUG_BUILD') == '1']}"
>  CARGO_BUILD_FLAGS = "-v --offline --target ${RUST_HOST_SYS} ${BUILD_MODE} --manifest-path=${MANIFEST_PATH}"
> 

Whilst I understand the intent here, I'm not sure this is a good idea,
The reasons coming to mind are:

a) We don't set DEBUG_BUILD in OE-Core or do testing of that afaik
b) We should really be fixing cargo, not hacking around it
c) This "fixes" those machines but not any other 32 bit machine. Should
it be target-arch specific if we do want to do it?

Do we know why this is breaking?

Cheers,

Richard
Sundeep KOKKONDA May 30, 2023, 4:26 a.m. UTC | #2
I still did not get this reproduced on rust sources (Since it is occurring only on 32-bit builds, the rust build is giving some unknown errors which are yet to be analyzed...).
Until then, to avoid DEBUG_BUILD failures this workaround is sent.
diff mbox series

Patch

diff --git a/meta/classes-recipe/cargo.bbclass b/meta/classes-recipe/cargo.bbclass
index 7a8cc1e751..bc5ca4fdc6 100644
--- a/meta/classes-recipe/cargo.bbclass
+++ b/meta/classes-recipe/cargo.bbclass
@@ -38,6 +38,11 @@  CARGO_SRC_DIR ??= ""
 MANIFEST_PATH ??= "${S}/${CARGO_SRC_DIR}/Cargo.toml"
 
 RUSTFLAGS ??= ""
+DEBUG_BUILD:qemuarm = '0'
+DEBUG_BUILD:qemuppc = '0'
+DEBUG_BUILD:qemumips = '0'
+DEBUG_BUILD:qemux86 = '0'
+DEBUG_BUILD:virtclass-multilib-lib32 = '0'
 BUILD_MODE = "${@['--release', ''][d.getVar('DEBUG_BUILD') == '1']}"
 CARGO_BUILD_FLAGS = "-v --offline --target ${RUST_HOST_SYS} ${BUILD_MODE} --manifest-path=${MANIFEST_PATH}"