[RFC,2/3] Add example of a rust hello world as isar recipe

Message ID 20260323105332.2721282-3-Quirin.Gylstorff@siemens.com
State Under Review
Headers show
Series Add helper and documentation for rust packaging | expand

Commit Message

Quirin Gylstorff March 23, 2026, 10:52 a.m. UTC
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>

Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
 .../recipes-app/rust-hello-isar/files/rules   | 27 +++++++++++++++++++
 .../files/rust-hello-isar/Cargo.toml          |  6 +++++
 .../files/rust-hello-isar/src/main.rs         |  3 +++
 .../rust-hello-isar/rust-hello-isar_0.1.bb    | 22 +++++++++++++++
 4 files changed, 58 insertions(+)
 create mode 100755 meta-isar/recipes-app/rust-hello-isar/files/rules
 create mode 100644 meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/Cargo.toml
 create mode 100644 meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/src/main.rs
 create mode 100644 meta-isar/recipes-app/rust-hello-isar/rust-hello-isar_0.1.bb

Comments

Jan Kiszka March 23, 2026, 11:21 a.m. UTC | #1
On 23.03.26 11:52, 'Quirin Gylstorff' via isar-users wrote:
> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> 

Was the recipe generated as well, just augmented afterwards? :)

Jan

> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> ---
>  .../recipes-app/rust-hello-isar/files/rules   | 27 +++++++++++++++++++
>  .../files/rust-hello-isar/Cargo.toml          |  6 +++++
>  .../files/rust-hello-isar/src/main.rs         |  3 +++
>  .../rust-hello-isar/rust-hello-isar_0.1.bb    | 22 +++++++++++++++
>  4 files changed, 58 insertions(+)
>  create mode 100755 meta-isar/recipes-app/rust-hello-isar/files/rules
>  create mode 100644 meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/Cargo.toml
>  create mode 100644 meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/src/main.rs
>  create mode 100644 meta-isar/recipes-app/rust-hello-isar/rust-hello-isar_0.1.bb
> 
> diff --git a/meta-isar/recipes-app/rust-hello-isar/files/rules b/meta-isar/recipes-app/rust-hello-isar/files/rules
> new file mode 100755
> index 00000000..213cc876
> --- /dev/null
> +++ b/meta-isar/recipes-app/rust-hello-isar/files/rules
> @@ -0,0 +1,27 @@
> +#!/usr/bin/make -f
> +
> +export DEB_BUILD_MAINT_OPTIONS = hardening=+all
> +DPKG_EXPORT_BUILDFLAGS = 1
> +include /usr/share/dpkg/default.mk
> +include /usr/share/rustc/architecture.mk
> +export DEB_HOST_RUST_TYPE
> +export PATH:=/usr/share/cargo/bin:$(PATH)
> +export CARGO=/usr/share/cargo/bin/cargo
> +export CARGO_HOME=$(CURDIR)/debian/cargo_home
> +export CARGO_REGISTRY=$(CURDIR)/debian/cargo_registry
> +export DEB_CARGO_CRATE=$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM)
> +
> +%:
> +	dh $@ --buildsystem=cargo
> +
> +execute_after_dh_auto_clean:
> +	$(CARGO) clean
> +	rm -rf $(CARGO_HOME)
> +	rm -rf $(CARGO_REGISTRY)
> +	rm -f debian/cargo-checksum.json
> +
> +execute_before_dh_auto_configure:
> +	$(CARGO) prepare-debian $(CARGO_REGISTRY) --link-from-system
> +	rm -f Cargo.lock
> +	touch debian/cargo-checksum.json
> +
> diff --git a/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/Cargo.toml b/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/Cargo.toml
> new file mode 100644
> index 00000000..f761691e
> --- /dev/null
> +++ b/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/Cargo.toml
> @@ -0,0 +1,6 @@
> +[package]
> +name = "rust-hello-isar"
> +version = "0.1.0"
> +edition = "2024"
> +
> +[dependencies]
> diff --git a/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/src/main.rs b/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/src/main.rs
> new file mode 100644
> index 00000000..50469bdf
> --- /dev/null
> +++ b/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/src/main.rs
> @@ -0,0 +1,3 @@
> +fn main() {
> +    println!("Hello, isar!");
> +}
> diff --git a/meta-isar/recipes-app/rust-hello-isar/rust-hello-isar_0.1.bb b/meta-isar/recipes-app/rust-hello-isar/rust-hello-isar_0.1.bb
> new file mode 100644
> index 00000000..2d57b8c8
> --- /dev/null
> +++ b/meta-isar/recipes-app/rust-hello-isar/rust-hello-isar_0.1.bb
> @@ -0,0 +1,22 @@
> +# Sample application
> +#
> +# This software is a part of ISAR.
> +# Copyright (C) 2026 Siemens AG
> +
> +inherit dpkg
> +
> +DESCRIPTION = "Hello world example for Rust"
> +MAINTAINER = "isar-users <isar-users@googlegroups.com>"
> +
> +SRC_URI = "file://${PN} \
> +           file://rules"
> +
> +DEBIAN_BUILD_DEPENDS += "dh-cargo"
> +
> +S = "${WORKDIR}/${PN}"
> +
> +do_prepare_build() {
> +    deb_debianize
> +    install  -m 644 ${WORKDIR}/rules ${S}/debian/rules
> +}
> +
Quirin Gylstorff March 23, 2026, 12:03 p.m. UTC | #2
On 3/23/26 12:21 PM, Jan Kiszka wrote:
> On 23.03.26 11:52, 'Quirin Gylstorff' via isar-users wrote:
>> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
>>
> 
> Was the recipe generated as well, just augmented afterwards? :)

No that was written manually. I was thinking about adding a generator 
but that should be discussed.

Quirin

> 
> Jan
> 
>> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
>> ---
>>   .../recipes-app/rust-hello-isar/files/rules   | 27 +++++++++++++++++++
>>   .../files/rust-hello-isar/Cargo.toml          |  6 +++++
>>   .../files/rust-hello-isar/src/main.rs         |  3 +++
>>   .../rust-hello-isar/rust-hello-isar_0.1.bb    | 22 +++++++++++++++
>>   4 files changed, 58 insertions(+)
>>   create mode 100755 meta-isar/recipes-app/rust-hello-isar/files/rules
>>   create mode 100644 meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/Cargo.toml
>>   create mode 100644 meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/src/main.rs
>>   create mode 100644 meta-isar/recipes-app/rust-hello-isar/rust-hello-isar_0.1.bb
>>
>> diff --git a/meta-isar/recipes-app/rust-hello-isar/files/rules b/meta-isar/recipes-app/rust-hello-isar/files/rules
>> new file mode 100755
>> index 00000000..213cc876
>> --- /dev/null
>> +++ b/meta-isar/recipes-app/rust-hello-isar/files/rules
>> @@ -0,0 +1,27 @@
>> +#!/usr/bin/make -f
>> +
>> +export DEB_BUILD_MAINT_OPTIONS = hardening=+all
>> +DPKG_EXPORT_BUILDFLAGS = 1
>> +include /usr/share/dpkg/default.mk
>> +include /usr/share/rustc/architecture.mk
>> +export DEB_HOST_RUST_TYPE
>> +export PATH:=/usr/share/cargo/bin:$(PATH)
>> +export CARGO=/usr/share/cargo/bin/cargo
>> +export CARGO_HOME=$(CURDIR)/debian/cargo_home
>> +export CARGO_REGISTRY=$(CURDIR)/debian/cargo_registry
>> +export DEB_CARGO_CRATE=$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM)
>> +
>> +%:
>> +	dh $@ --buildsystem=cargo
>> +
>> +execute_after_dh_auto_clean:
>> +	$(CARGO) clean
>> +	rm -rf $(CARGO_HOME)
>> +	rm -rf $(CARGO_REGISTRY)
>> +	rm -f debian/cargo-checksum.json
>> +
>> +execute_before_dh_auto_configure:
>> +	$(CARGO) prepare-debian $(CARGO_REGISTRY) --link-from-system
>> +	rm -f Cargo.lock
>> +	touch debian/cargo-checksum.json
>> +
>> diff --git a/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/Cargo.toml b/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/Cargo.toml
>> new file mode 100644
>> index 00000000..f761691e
>> --- /dev/null
>> +++ b/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/Cargo.toml
>> @@ -0,0 +1,6 @@
>> +[package]
>> +name = "rust-hello-isar"
>> +version = "0.1.0"
>> +edition = "2024"
>> +
>> +[dependencies]
>> diff --git a/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/src/main.rs b/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/src/main.rs
>> new file mode 100644
>> index 00000000..50469bdf
>> --- /dev/null
>> +++ b/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/src/main.rs
>> @@ -0,0 +1,3 @@
>> +fn main() {
>> +    println!("Hello, isar!");
>> +}
>> diff --git a/meta-isar/recipes-app/rust-hello-isar/rust-hello-isar_0.1.bb b/meta-isar/recipes-app/rust-hello-isar/rust-hello-isar_0.1.bb
>> new file mode 100644
>> index 00000000..2d57b8c8
>> --- /dev/null
>> +++ b/meta-isar/recipes-app/rust-hello-isar/rust-hello-isar_0.1.bb
>> @@ -0,0 +1,22 @@
>> +# Sample application
>> +#
>> +# This software is a part of ISAR.
>> +# Copyright (C) 2026 Siemens AG
>> +
>> +inherit dpkg
>> +
>> +DESCRIPTION = "Hello world example for Rust"
>> +MAINTAINER = "isar-users <isar-users@googlegroups.com>"
>> +
>> +SRC_URI = "file://${PN} \
>> +           file://rules"
>> +
>> +DEBIAN_BUILD_DEPENDS += "dh-cargo"
>> +
>> +S = "${WORKDIR}/${PN}"
>> +
>> +do_prepare_build() {
>> +    deb_debianize
>> +    install  -m 644 ${WORKDIR}/rules ${S}/debian/rules
>> +}
>> +
>
Quirin Gylstorff March 23, 2026, 12:06 p.m. UTC | #3
On 3/23/26 1:03 PM, 'Quirin Gylstorff' via isar-users wrote:
> 
> 
> On 3/23/26 12:21 PM, Jan Kiszka wrote:
>> On 23.03.26 11:52, 'Quirin Gylstorff' via isar-users wrote:
>>> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
>>>
>>
>> Was the recipe generated as well, just augmented afterwards? :)
> 
> No that was written manually. I was thinking about adding a generator 
> but that should be discussed.

With an additional use case the next point of discussion would be not to 
use a bash script and build something more extensible.

Quirin

> 
> Quirin
> 
>>
>> Jan
>>
>>> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
>>> ---
>>>   .../recipes-app/rust-hello-isar/files/rules   | 27 +++++++++++++++++++
>>>   .../files/rust-hello-isar/Cargo.toml          |  6 +++++
>>>   .../files/rust-hello-isar/src/main.rs         |  3 +++
>>>   .../rust-hello-isar/rust-hello-isar_0.1.bb    | 22 +++++++++++++++
>>>   4 files changed, 58 insertions(+)
>>>   create mode 100755 meta-isar/recipes-app/rust-hello-isar/files/rules
>>>   create mode 100644 meta-isar/recipes-app/rust-hello-isar/files/ 
>>> rust-hello-isar/Cargo.toml
>>>   create mode 100644 meta-isar/recipes-app/rust-hello-isar/files/ 
>>> rust-hello-isar/src/main.rs
>>>   create mode 100644 meta-isar/recipes-app/rust-hello-isar/rust- 
>>> hello-isar_0.1.bb
>>>
>>> diff --git a/meta-isar/recipes-app/rust-hello-isar/files/rules b/ 
>>> meta-isar/recipes-app/rust-hello-isar/files/rules
>>> new file mode 100755
>>> index 00000000..213cc876
>>> --- /dev/null
>>> +++ b/meta-isar/recipes-app/rust-hello-isar/files/rules
>>> @@ -0,0 +1,27 @@
>>> +#!/usr/bin/make -f
>>> +
>>> +export DEB_BUILD_MAINT_OPTIONS = hardening=+all
>>> +DPKG_EXPORT_BUILDFLAGS = 1
>>> +include /usr/share/dpkg/default.mk
>>> +include /usr/share/rustc/architecture.mk
>>> +export DEB_HOST_RUST_TYPE
>>> +export PATH:=/usr/share/cargo/bin:$(PATH)
>>> +export CARGO=/usr/share/cargo/bin/cargo
>>> +export CARGO_HOME=$(CURDIR)/debian/cargo_home
>>> +export CARGO_REGISTRY=$(CURDIR)/debian/cargo_registry
>>> +export DEB_CARGO_CRATE=$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM)
>>> +
>>> +%:
>>> +    dh $@ --buildsystem=cargo
>>> +
>>> +execute_after_dh_auto_clean:
>>> +    $(CARGO) clean
>>> +    rm -rf $(CARGO_HOME)
>>> +    rm -rf $(CARGO_REGISTRY)
>>> +    rm -f debian/cargo-checksum.json
>>> +
>>> +execute_before_dh_auto_configure:
>>> +    $(CARGO) prepare-debian $(CARGO_REGISTRY) --link-from-system
>>> +    rm -f Cargo.lock
>>> +    touch debian/cargo-checksum.json
>>> +
>>> diff --git a/meta-isar/recipes-app/rust-hello-isar/files/rust-hello- 
>>> isar/Cargo.toml b/meta-isar/recipes-app/rust-hello-isar/files/rust- 
>>> hello-isar/Cargo.toml
>>> new file mode 100644
>>> index 00000000..f761691e
>>> --- /dev/null
>>> +++ b/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/ 
>>> Cargo.toml
>>> @@ -0,0 +1,6 @@
>>> +[package]
>>> +name = "rust-hello-isar"
>>> +version = "0.1.0"
>>> +edition = "2024"
>>> +
>>> +[dependencies]
>>> diff --git a/meta-isar/recipes-app/rust-hello-isar/files/rust-hello- 
>>> isar/src/main.rs b/meta-isar/recipes-app/rust-hello-isar/files/rust- 
>>> hello-isar/src/main.rs
>>> new file mode 100644
>>> index 00000000..50469bdf
>>> --- /dev/null
>>> +++ b/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/ 
>>> src/main.rs
>>> @@ -0,0 +1,3 @@
>>> +fn main() {
>>> +    println!("Hello, isar!");
>>> +}
>>> diff --git a/meta-isar/recipes-app/rust-hello-isar/rust-hello- 
>>> isar_0.1.bb b/meta-isar/recipes-app/rust-hello-isar/rust-hello- 
>>> isar_0.1.bb
>>> new file mode 100644
>>> index 00000000..2d57b8c8
>>> --- /dev/null
>>> +++ b/meta-isar/recipes-app/rust-hello-isar/rust-hello-isar_0.1.bb
>>> @@ -0,0 +1,22 @@
>>> +# Sample application
>>> +#
>>> +# This software is a part of ISAR.
>>> +# Copyright (C) 2026 Siemens AG
>>> +
>>> +inherit dpkg
>>> +
>>> +DESCRIPTION = "Hello world example for Rust"
>>> +MAINTAINER = "isar-users <isar-users@googlegroups.com>"
>>> +
>>> +SRC_URI = "file://${PN} \
>>> +           file://rules"
>>> +
>>> +DEBIAN_BUILD_DEPENDS += "dh-cargo"
>>> +
>>> +S = "${WORKDIR}/${PN}"
>>> +
>>> +do_prepare_build() {
>>> +    deb_debianize
>>> +    install  -m 644 ${WORKDIR}/rules ${S}/debian/rules
>>> +}
>>> +
>>
>
MOESSBAUER, Felix March 24, 2026, 9:17 a.m. UTC | #4
On Mon, 2026-03-23 at 11:52 +0100, 'Quirin Gylstorff' via isar-users
wrote:
> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> 
> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> ---
>  .../recipes-app/rust-hello-isar/files/rules   | 27 +++++++++++++++++++
>  .../files/rust-hello-isar/Cargo.toml          |  6 +++++
>  .../files/rust-hello-isar/src/main.rs         |  3 +++
>  .../rust-hello-isar/rust-hello-isar_0.1.bb    | 22 +++++++++++++++
>  4 files changed, 58 insertions(+)
>  create mode 100755 meta-isar/recipes-app/rust-hello-isar/files/rules
>  create mode 100644 meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/Cargo.toml
>  create mode 100644 meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/src/main.rs
>  create mode 100644 meta-isar/recipes-app/rust-hello-isar/rust-hello-isar_0.1.bb
> 
> diff --git a/meta-isar/recipes-app/rust-hello-isar/files/rules b/meta-isar/recipes-app/rust-hello-isar/files/rules
> new file mode 100755
> index 00000000..213cc876
> --- /dev/null
> +++ b/meta-isar/recipes-app/rust-hello-isar/files/rules
> @@ -0,0 +1,27 @@
> +#!/usr/bin/make -f
> +
> +export DEB_BUILD_MAINT_OPTIONS = hardening=+all
> +DPKG_EXPORT_BUILDFLAGS = 1
> +include /usr/share/dpkg/default.mk
> +include /usr/share/rustc/architecture.mk
> +export DEB_HOST_RUST_TYPE
> +export PATH:=/usr/share/cargo/bin:$(PATH)
> +export CARGO=/usr/share/cargo/bin/cargo
> +export CARGO_HOME=$(CURDIR)/debian/cargo_home
> +export CARGO_REGISTRY=$(CURDIR)/debian/cargo_registry
> +export DEB_CARGO_CRATE=$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM)

Please also add fake proxies to ensure nothing is pulled directly from
upstream. Or is this already taken by debcargo?

> +
> +%:
> +	dh $@ --buildsystem=cargo
> +
> +execute_after_dh_auto_clean:
> +	$(CARGO) clean
> +	rm -rf $(CARGO_HOME)
> +	rm -rf $(CARGO_REGISTRY)
> +	rm -f debian/cargo-checksum.json
> +
> +execute_before_dh_auto_configure:
> +	$(CARGO) prepare-debian $(CARGO_REGISTRY) --link-from-system
> +	rm -f Cargo.lock
> +	touch debian/cargo-checksum.json
> +
> diff --git a/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/Cargo.toml b/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/Cargo.toml
> new file mode 100644
> index 00000000..f761691e
> --- /dev/null
> +++ b/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/Cargo.toml
> @@ -0,0 +1,6 @@
> +[package]
> +name = "rust-hello-isar"
> +version = "0.1.0"
> +edition = "2024"
> +
> +[dependencies]
> diff --git a/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/src/main.rs b/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/src/main.rs
> new file mode 100644
> index 00000000..50469bdf
> --- /dev/null
> +++ b/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/src/main.rs
> @@ -0,0 +1,3 @@
> +fn main() {
> +    println!("Hello, isar!");
> +}
> diff --git a/meta-isar/recipes-app/rust-hello-isar/rust-hello-isar_0.1.bb b/meta-isar/recipes-app/rust-hello-isar/rust-hello-isar_0.1.bb
> new file mode 100644
> index 00000000..2d57b8c8
> --- /dev/null
> +++ b/meta-isar/recipes-app/rust-hello-isar/rust-hello-isar_0.1.bb
> @@ -0,0 +1,22 @@
> +# Sample application
> +#
> +# This software is a part of ISAR.
> +# Copyright (C) 2026 Siemens AG
> +
> +inherit dpkg
> +
> +DESCRIPTION = "Hello world example for Rust"
> +MAINTAINER = "isar-users <isar-users@googlegroups.com>"
> +
> +SRC_URI = "file://${PN} \

You probably want ${BPN}

> +           file://rules"
> +
> +DEBIAN_BUILD_DEPENDS += "dh-cargo"
> +
> +S = "${WORKDIR}/${PN}"

Same here.

Felix

> +
> +do_prepare_build() {
> +    deb_debianize
> +    install  -m 644 ${WORKDIR}/rules ${S}/debian/rules
> +}
> +
> --
> 2.53.0
> 
> --
> You received this message because you are subscribed to the Google Groups "isar-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/isar-users/20260323105332.2721282-3-Quirin.Gylstorff%40siemens.com.
Quirin Gylstorff March 24, 2026, 10:03 a.m. UTC | #5
On 3/24/26 10:17 AM, Moessbauer, Felix (FT RPD CED OES-DE) wrote:
> On Mon, 2026-03-23 at 11:52 +0100, 'Quirin Gylstorff' via isar-users
> wrote:
>> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
>>
>> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
>> ---
>>   .../recipes-app/rust-hello-isar/files/rules   | 27 +++++++++++++++++++
>>   .../files/rust-hello-isar/Cargo.toml          |  6 +++++
>>   .../files/rust-hello-isar/src/main.rs         |  3 +++
>>   .../rust-hello-isar/rust-hello-isar_0.1.bb    | 22 +++++++++++++++
>>   4 files changed, 58 insertions(+)
>>   create mode 100755 meta-isar/recipes-app/rust-hello-isar/files/rules
>>   create mode 100644 meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/Cargo.toml
>>   create mode 100644 meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/src/main.rs
>>   create mode 100644 meta-isar/recipes-app/rust-hello-isar/rust-hello-isar_0.1.bb
>>
>> diff --git a/meta-isar/recipes-app/rust-hello-isar/files/rules b/meta-isar/recipes-app/rust-hello-isar/files/rules
>> new file mode 100755
>> index 00000000..213cc876
>> --- /dev/null
>> +++ b/meta-isar/recipes-app/rust-hello-isar/files/rules
>> @@ -0,0 +1,27 @@
>> +#!/usr/bin/make -f
>> +
>> +export DEB_BUILD_MAINT_OPTIONS = hardening=+all
>> +DPKG_EXPORT_BUILDFLAGS = 1
>> +include /usr/share/dpkg/default.mk
>> +include /usr/share/rustc/architecture.mk
>> +export DEB_HOST_RUST_TYPE
>> +export PATH:=/usr/share/cargo/bin:$(PATH)
>> +export CARGO=/usr/share/cargo/bin/cargo
>> +export CARGO_HOME=$(CURDIR)/debian/cargo_home
>> +export CARGO_REGISTRY=$(CURDIR)/debian/cargo_registry
>> +export DEB_CARGO_CRATE=$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM)
> 
> Please also add fake proxies to ensure nothing is pulled directly from
> upstream. Or is this already taken by debcargo?

The build uses a wrapper around 
cargo(https://salsa.debian.org/rust-team/rust/-/blob/debian/sid/debian/bin/cargo?ref_type=heads) 
which replaces crates.io with the local registry. In my opinion the 
Proxy should not be necessary.



> 
>> +
>> +%:
>> +	dh $@ --buildsystem=cargo
>> +
>> +execute_after_dh_auto_clean:
>> +	$(CARGO) clean
>> +	rm -rf $(CARGO_HOME)
>> +	rm -rf $(CARGO_REGISTRY)
>> +	rm -f debian/cargo-checksum.json
>> +
>> +execute_before_dh_auto_configure:
>> +	$(CARGO) prepare-debian $(CARGO_REGISTRY) --link-from-system
>> +	rm -f Cargo.lock
>> +	touch debian/cargo-checksum.json
>> +
>> diff --git a/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/Cargo.toml b/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/Cargo.toml
>> new file mode 100644
>> index 00000000..f761691e
>> --- /dev/null
>> +++ b/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/Cargo.toml
>> @@ -0,0 +1,6 @@
>> +[package]
>> +name = "rust-hello-isar"
>> +version = "0.1.0"
>> +edition = "2024"
>> +
>> +[dependencies]
>> diff --git a/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/src/main.rs b/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/src/main.rs
>> new file mode 100644
>> index 00000000..50469bdf
>> --- /dev/null
>> +++ b/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/src/main.rs
>> @@ -0,0 +1,3 @@
>> +fn main() {
>> +    println!("Hello, isar!");
>> +}
>> diff --git a/meta-isar/recipes-app/rust-hello-isar/rust-hello-isar_0.1.bb b/meta-isar/recipes-app/rust-hello-isar/rust-hello-isar_0.1.bb
>> new file mode 100644
>> index 00000000..2d57b8c8
>> --- /dev/null
>> +++ b/meta-isar/recipes-app/rust-hello-isar/rust-hello-isar_0.1.bb
>> @@ -0,0 +1,22 @@
>> +# Sample application
>> +#
>> +# This software is a part of ISAR.
>> +# Copyright (C) 2026 Siemens AG
>> +
>> +inherit dpkg
>> +
>> +DESCRIPTION = "Hello world example for Rust"
>> +MAINTAINER = "isar-users <isar-users@googlegroups.com>"
>> +
>> +SRC_URI = "file://${PN} \
> 
> You probably want ${BPN}
> 
Good catch will fix in the next version.

Quirin
>> +           file://rules"
>> +
>> +DEBIAN_BUILD_DEPENDS += "dh-cargo"
>> +
>> +S = "${WORKDIR}/${PN}"
> 
> Same here.
> 
> Felix
> 
>> +
>> +do_prepare_build() {
>> +    deb_debianize
>> +    install  -m 644 ${WORKDIR}/rules ${S}/debian/rules
>> +}
>> +
>> --
>> 2.53.0
>>
>> --
>> You received this message because you are subscribed to the Google Groups "isar-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
>> To view this discussion visit https://groups.google.com/d/msgid/isar-users/20260323105332.2721282-3-Quirin.Gylstorff%40siemens.com.
>

Patch

diff --git a/meta-isar/recipes-app/rust-hello-isar/files/rules b/meta-isar/recipes-app/rust-hello-isar/files/rules
new file mode 100755
index 00000000..213cc876
--- /dev/null
+++ b/meta-isar/recipes-app/rust-hello-isar/files/rules
@@ -0,0 +1,27 @@ 
+#!/usr/bin/make -f
+
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+DPKG_EXPORT_BUILDFLAGS = 1
+include /usr/share/dpkg/default.mk
+include /usr/share/rustc/architecture.mk
+export DEB_HOST_RUST_TYPE
+export PATH:=/usr/share/cargo/bin:$(PATH)
+export CARGO=/usr/share/cargo/bin/cargo
+export CARGO_HOME=$(CURDIR)/debian/cargo_home
+export CARGO_REGISTRY=$(CURDIR)/debian/cargo_registry
+export DEB_CARGO_CRATE=$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM)
+
+%:
+	dh $@ --buildsystem=cargo
+
+execute_after_dh_auto_clean:
+	$(CARGO) clean
+	rm -rf $(CARGO_HOME)
+	rm -rf $(CARGO_REGISTRY)
+	rm -f debian/cargo-checksum.json
+
+execute_before_dh_auto_configure:
+	$(CARGO) prepare-debian $(CARGO_REGISTRY) --link-from-system
+	rm -f Cargo.lock
+	touch debian/cargo-checksum.json
+
diff --git a/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/Cargo.toml b/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/Cargo.toml
new file mode 100644
index 00000000..f761691e
--- /dev/null
+++ b/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/Cargo.toml
@@ -0,0 +1,6 @@ 
+[package]
+name = "rust-hello-isar"
+version = "0.1.0"
+edition = "2024"
+
+[dependencies]
diff --git a/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/src/main.rs b/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/src/main.rs
new file mode 100644
index 00000000..50469bdf
--- /dev/null
+++ b/meta-isar/recipes-app/rust-hello-isar/files/rust-hello-isar/src/main.rs
@@ -0,0 +1,3 @@ 
+fn main() {
+    println!("Hello, isar!");
+}
diff --git a/meta-isar/recipes-app/rust-hello-isar/rust-hello-isar_0.1.bb b/meta-isar/recipes-app/rust-hello-isar/rust-hello-isar_0.1.bb
new file mode 100644
index 00000000..2d57b8c8
--- /dev/null
+++ b/meta-isar/recipes-app/rust-hello-isar/rust-hello-isar_0.1.bb
@@ -0,0 +1,22 @@ 
+# Sample application
+#
+# This software is a part of ISAR.
+# Copyright (C) 2026 Siemens AG
+
+inherit dpkg
+
+DESCRIPTION = "Hello world example for Rust"
+MAINTAINER = "isar-users <isar-users@googlegroups.com>"
+
+SRC_URI = "file://${PN} \
+           file://rules"
+
+DEBIAN_BUILD_DEPENDS += "dh-cargo"
+
+S = "${WORKDIR}/${PN}"
+
+do_prepare_build() {
+    deb_debianize
+    install  -m 644 ${WORKDIR}/rules ${S}/debian/rules
+}
+