Skip to contentSkip to conversation

package/ripgrep: fix debug build

PATCH New Fabrice Fontaine 4 participants 5 messages Aug 22, 2020 – Aug 28, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/ripgrep: fix debug build

There is no --debug mode for cargo resulting in the following build failure since the addition of this package with commit 4b0d1ef6ac00c5170a3fb9d15d06b3d3172e0c97:

error: Unknown flag: '--debug'

Fixes:
- http://autobuild.buildroot.org/results/58e74bb056ec65680ecebaa559aa14bdebbf5c85
- http://autobuild.buildroot.org/results/28c6364a89a6044d5a036614f7a6e59815efb770

---
 package/ripgrep/ripgrep.mk | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
package/ripgrep/ripgrep.mk +1 -2
index 832c076f26..ac9038945c 100644
@@ -11,12 +11,11 @@ RIPGREP_LICENSE_FILES = LICENSE-MIT
 
 RIPGREP_DEPENDENCIES = host-rustc
 RIPGREP_CARGO_ENV = CARGO_HOME=$(HOST_DIR)/share/cargo
-RIPGREP_CARGO_MODE = $(if $(BR2_ENABLE_DEBUG),debug,release)
 
 RIPGREP_BIN_DIR = target/$(RUSTC_TARGET_NAME)/$(RIPGREP_CARGO_MODE)
 
 RIPGREP_CARGO_OPTS = \
-	--$(RIPGREP_CARGO_MODE) \
+	--release \
 	--target=$(RUSTC_TARGET_NAME) \
 	--manifest-path=$(@D)/Cargo.toml
 
Signature · 1 line
2.28.0
#1 lore raw

PATCH 1/1 package/ripgrep: fix debug build

Fabrice, All,

Question for a cargo expert! See below!

On 2020-08-22 20:22 +0200, Fabrice Fontaine spake thusly:

Quoted 20 lines

There is no --debug mode for cargo resulting in the following build failure since the addition of this package with commit 4b0d1ef6ac00c5170a3fb9d15d06b3d3172e0c97:

error: Unknown flag: '--debug'

Fixes:
- http://autobuild.buildroot.org/results/58e74bb056ec65680ecebaa559aa14bdebbf5c85
- http://autobuild.buildroot.org/results/28c6364a89a6044d5a036614f7a6e59815efb770

---
 package/ripgrep/ripgrep.mk | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
package/ripgrep/ripgrep.mk +0 -0
index 832c076f26..ac9038945c 100644

package/ripgrep/ripgrep.mk RIPGREP_LICENSE_FILES = LICENSE-MIT · line 18

Quoted 10 lines
package/ripgrep/ripgrep.mk +1 -2
@@ -11,12 +11,11 @@ RIPGREP_LICENSE_FILES = LICENSE-MIT
 
 RIPGREP_DEPENDENCIES = host-rustc
 RIPGREP_CARGO_ENV = CARGO_HOME=$(HOST_DIR)/share/cargo
-RIPGREP_CARGO_MODE = $(if $(BR2_ENABLE_DEBUG),debug,release)
 
 RIPGREP_BIN_DIR = target/$(RUSTC_TARGET_NAME)/$(RIPGREP_CARGO_MODE)
 
 RIPGREP_CARGO_OPTS = \
-	--$(RIPGREP_CARGO_MODE) \
+	--release \

Wouldn't we need to pass --release only when in non-debug builds, i.e:

    $(if $(BR2_ENABLE_DEBUG),,--release)

Regards,
Yann E. MORIN.

Quoted 10 lines
package/ripgrep/ripgrep.mk +0 -0
 	--target=$(RUSTC_TARGET_NAME) \
 	--manifest-path=$(@D)/Cargo.toml
 
Signature · 6 lines
2.28.0

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH 1/1 package/ripgrep: fix debug build

Yann, Fabrice,

Quoted 9 lines · Yann E. MORIN

Fabrice, All,

Question for a cargo expert! See below!

On 2020-08-22 20:22 +0200, Fabrice Fontaine spake thusly:

Quoted 3 lines

There is no --debug mode for cargo resulting in the following build failure since the addition of this package with commit 4b0d1ef6ac00c5170a3fb9d15d06b3d3172e0c97:

This also seems to be visible in the manual, in the cargo-based package section. The example manual text will need to be updated to avoid this issue for new packages.

Quoted 24 lines
Quoted 24 lines

error: Unknown flag: '--debug'

Fixes:
- http://autobuild.buildroot.org/results/58e74bb056ec65680ecebaa559aa14bdebbf5c85
- http://autobuild.buildroot.org/results/28c6364a89a6044d5a036614f7a6e59815efb770

---
 package/ripgrep/ripgrep.mk | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
package/ripgrep/ripgrep.mk +0 -1
index 832c076f26..ac9038945c 100644
@@ -11,12 +11,11 @@ RIPGREP_LICENSE_FILES = LICENSE-MIT
 
 RIPGREP_DEPENDENCIES = host-rustc
 RIPGREP_CARGO_ENV = CARGO_HOME=$(HOST_DIR)/share/cargo
-RIPGREP_CARGO_MODE = $(if $(BR2_ENABLE_DEBUG),debug,release)
 
 RIPGREP_BIN_DIR = target/$(RUSTC_TARGET_NAME)/$(RIPGREP_CARGO_MODE)
 
Quoted 7 lines

package/ripgrep/ripgrep.mk RIPGREP_LICENSE_FILES = LICENSE-MIT · line 18

Quoted 3 lines
package/ripgrep/ripgrep.mk +1 -1
 RIPGREP_CARGO_OPTS = \
-     --$(RIPGREP_CARGO_MODE) \
+     --release \

Wouldn't we need to pass --release only when in non-debug builds, i.e:

    $(if $(BR2_ENABLE_DEBUG),,--release)

This seems more than reasonable, however as this patch is likely coming in before the cargo-restructuring[1] patchset, so we should make sure it also works its way back into those patches.

FWIW I agree it should leave the debug/release logic, so that it's possible to enable the debug symbols (most notably not build the 'release' profile instead of the default 'dev' profile[2]). I think for now we should just "set nothing" in the debug case and let the "dev" profile take over, and someday somebody may wish to make it more robust by setting the correct[3] debug flags when appropriate.

Thanks for looking at this!

Sam

1: https://patchwork.ozlabs.org/project/buildroot/patch/20200220160119.3407-1-patrick.havelange at essensium.com/ 2: https://doc.rust-lang.org/cargo/reference/profiles.html#release
3: https://doc.rust-lang.org/cargo/reference/profiles.html#debug

#3 lore raw

PATCH 1/1 package/ripgrep: fix debug build

In reply to Fabrice Fontaine

Fabrice, All,

On 2020-08-22 20:22 +0200, Fabrice Fontaine spake thusly:

Quoted 11 lines

There is no --debug mode for cargo resulting in the following build failure since the addition of this package with commit 4b0d1ef6ac00c5170a3fb9d15d06b3d3172e0c97:

error: Unknown flag: '--debug'

Fixes:
- http://autobuild.buildroot.org/results/58e74bb056ec65680ecebaa559aa14bdebbf5c85
- http://autobuild.buildroot.org/results/28c6364a89a6044d5a036614f7a6e59815efb770

Applied to master, but keeping the default 'dev' mode when in debug, as discussed in the thread, and confirmed by Sam. Thanks.

Regards,
Yann E. MORIN.

Quoted 29 lines
---
 package/ripgrep/ripgrep.mk | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
package/ripgrep/ripgrep.mk +1 -2
index 832c076f26..ac9038945c 100644
@@ -11,12 +11,11 @@ RIPGREP_LICENSE_FILES = LICENSE-MIT
 
 RIPGREP_DEPENDENCIES = host-rustc
 RIPGREP_CARGO_ENV = CARGO_HOME=$(HOST_DIR)/share/cargo
-RIPGREP_CARGO_MODE = $(if $(BR2_ENABLE_DEBUG),debug,release)
 
 RIPGREP_BIN_DIR = target/$(RUSTC_TARGET_NAME)/$(RIPGREP_CARGO_MODE)
 
 RIPGREP_CARGO_OPTS = \
-	--$(RIPGREP_CARGO_MODE) \
+	--release \
 	--target=$(RUSTC_TARGET_NAME) \
 	--manifest-path=$(@D)/Cargo.toml
 
Signature · 6 lines
2.28.0

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#4 lore raw

PATCH 1/1 package/ripgrep: fix debug build

In reply to Fabrice Fontaine
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Fabrice" == Fabrice Fontaine <[email protected]> writes:

There is no --debug mode for cargo resulting in the following build failure since the addition of this package with commit 4b0d1ef6ac00c5170a3fb9d15d06b3d3172e0c97:

Quoted 7 lines

error: Unknown flag: '--debug'

Fixes:
- http://autobuild.buildroot.org/results/58e74bb056ec65680ecebaa559aa14bdebbf5c85
- http://autobuild.buildroot.org/results/28c6364a89a6044d5a036614f7a6e59815efb770

Committed to 2020.02.x and 2020.05.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard