public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* Ignore a dependency
@ 2022-09-13 11:55 Roberto A. Foglietta
  2022-09-13 12:53 ` Uladzimir Bely
  0 siblings, 1 reply; 12+ messages in thread
From: Roberto A. Foglietta @ 2022-09-13 11:55 UTC (permalink / raw)
  To: isar-users

[-- Attachment #1: Type: text/plain, Size: 231 bytes --]

I wish to ignore a package that it is listed ad dependency. Just that
package and its dependencies.

mainpackage nothis-

Notice the minus at the end.

I tried this approach with different options buy broke the building

Thank,
-R

[-- Attachment #2: Type: text/html, Size: 522 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Ignore a dependency
  2022-09-13 11:55 Ignore a dependency Roberto A. Foglietta
@ 2022-09-13 12:53 ` Uladzimir Bely
  2022-09-13 12:58   ` Roberto A. Foglietta
  0 siblings, 1 reply; 12+ messages in thread
From: Uladzimir Bely @ 2022-09-13 12:53 UTC (permalink / raw)
  To: isar-users; +Cc: Roberto A. Foglietta

In the email from Tuesday, 13 September 2022 14:55:58 +03 user Roberto A. 
Foglietta wrote:
> I wish to ignore a package that it is listed ad dependency. Just that
> package and its dependencies.
> 
> mainpackage nothis-
> 
> Notice the minus at the end.
> 
> I tried this approach with different options buy broke the building
> 
> Thank,
> -R

Hello Roberto

Could you please clarify what exactly do you mean?

Is it pure Isar dependency (custom packages), or you might want to install 
some Debian package and ignore some of it's dependencies?

Any example of what you've tried already would be great.

-- 
Uladzimir Bely




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Ignore a dependency
  2022-09-13 12:53 ` Uladzimir Bely
@ 2022-09-13 12:58   ` Roberto A. Foglietta
  2022-09-13 13:09     ` Baurzhan Ismagulov
                       ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Roberto A. Foglietta @ 2022-09-13 12:58 UTC (permalink / raw)
  To: Uladzimir Bely; +Cc: isar-users

[-- Attachment #1: Type: text/plain, Size: 854 bytes --]

Il Mar 13 Set 2022, 14:53 Uladzimir Bely <ubely@ilbers.de> ha scritto:

> In the email from Tuesday, 13 September 2022 14:55:58 +03 user Roberto A.
> Foglietta wrote:
> > I wish to ignore a package that it is listed ad dependency. Just that
> > package and its dependencies.
> >
> > mainpackage nothis-
> >
> > Notice the minus at the end.
> >
> > I tried this approach with different options buy broke the building
> >
> > Thank,
> > -R
>
> Hello Roberto
>
> Could you please clarify what exactly do you mean?
>
> Is it pure Isar dependency (custom packages), or you might want to install
> some Debian package and ignore some of it's dependencies?
>

The 2nd you wrote: a debian package.


> Any example of what you've tried already would be great.
>

As example you can choose any .deb that has a dependency and try to install
without it.

Thanks, R-

[-- Attachment #2: Type: text/html, Size: 1739 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Ignore a dependency
  2022-09-13 12:58   ` Roberto A. Foglietta
@ 2022-09-13 13:09     ` Baurzhan Ismagulov
  2022-09-13 13:09     ` Uladzimir Bely
  2022-09-13 13:53     ` Henning Schild
  2 siblings, 0 replies; 12+ messages in thread
From: Baurzhan Ismagulov @ 2022-09-13 13:09 UTC (permalink / raw)
  To: isar-users

On Tue, Sep 13, 2022 at 02:58:52PM +0200, Roberto A. Foglietta wrote:
> > > I wish to ignore a package that it is listed ad dependency. Just that
> > > package and its dependencies.
> >
> > Is it pure Isar dependency (custom packages), or you might want to install
> > some Debian package and ignore some of it's dependencies?
> 
> The 2nd you wrote: a debian package.
...
> As example you can choose any .deb that has a dependency and try to install
> without it.

IIUC, there is no easy way in stock Isar to achieve that. In fact, Debian is
exactly about cleanly installing all dependencies, introducing apt over dpkg.

Technically, skipping a dep might be achievable via dpkg manipulations, but I
wonder why you'd like to do that. What is the "main" package and the one you'd
like to skip?

The clean way of doing that would be to rebuild mainpackage from sources
without the dependency.

With kind regards,
Baurzhan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Ignore a dependency
  2022-09-13 12:58   ` Roberto A. Foglietta
  2022-09-13 13:09     ` Baurzhan Ismagulov
@ 2022-09-13 13:09     ` Uladzimir Bely
  2022-09-13 13:53     ` Henning Schild
  2 siblings, 0 replies; 12+ messages in thread
From: Uladzimir Bely @ 2022-09-13 13:09 UTC (permalink / raw)
  To: Roberto A. Foglietta; +Cc: isar-users

In the email from Tuesday, 13 September 2022 15:58:52 +03 user Roberto A. 
Foglietta wrote:
> Il Mar 13 Set 2022, 14:53 Uladzimir Bely <ubely@ilbers.de> ha scritto:
> > In the email from Tuesday, 13 September 2022 14:55:58 +03 user Roberto A.
> > 
> > Foglietta wrote:
> > > I wish to ignore a package that it is listed ad dependency. Just that
> > > package and its dependencies.
> > > 
> > > mainpackage nothis-
> > > 
> > > Notice the minus at the end.
> > > 
> > > I tried this approach with different options buy broke the building
> > > 
> > > Thank,
> > > -R
> > 
> > Hello Roberto
> > 
> > Could you please clarify what exactly do you mean?
> > 
> > Is it pure Isar dependency (custom packages), or you might want to install
> > some Debian package and ignore some of it's dependencies?
> 
> The 2nd you wrote: a debian package.
> 
> > Any example of what you've tried already would be great.
> 
> As example you can choose any .deb that has a dependency and try to install
> without it.
> 
> Thanks, R-

This is not supported by Isar out of the box.

Packages are installed to rootfs using apt that resolves their dependencies 
and this is can't be changed.

What you could try is write a custom recipe that somehow repacks the .deb file 
so that all deps would be stripped from it.

For example, "deb2targz" could be used ant resulting .tar file could be 
debianized again, without any deps.

-- 
Uladzimir Bely




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Ignore a dependency
  2022-09-13 12:58   ` Roberto A. Foglietta
  2022-09-13 13:09     ` Baurzhan Ismagulov
  2022-09-13 13:09     ` Uladzimir Bely
@ 2022-09-13 13:53     ` Henning Schild
  2022-09-13 18:59       ` Roberto A. Foglietta
  2 siblings, 1 reply; 12+ messages in thread
From: Henning Schild @ 2022-09-13 13:53 UTC (permalink / raw)
  To: Roberto A. Foglietta; +Cc: Uladzimir Bely, isar-users

Am Tue, 13 Sep 2022 14:58:52 +0200
schrieb "Roberto A. Foglietta" <roberto.foglietta@gmail.com>:

> Il Mar 13 Set 2022, 14:53 Uladzimir Bely <ubely@ilbers.de> ha scritto:
> 
> > In the email from Tuesday, 13 September 2022 14:55:58 +03 user
> > Roberto A. Foglietta wrote:  
> > > I wish to ignore a package that it is listed ad dependency. Just
> > > that package and its dependencies.
> > >
> > > mainpackage nothis-
> > >
> > > Notice the minus at the end.
> > >
> > > I tried this approach with different options buy broke the
> > > building
> > >
> > > Thank,
> > > -R  
> >
> > Hello Roberto
> >
> > Could you please clarify what exactly do you mean?
> >
> > Is it pure Isar dependency (custom packages), or you might want to
> > install some Debian package and ignore some of it's dependencies?
> >  
> 
> The 2nd you wrote: a debian package.

You could use dpkg-deb to unpack and repack. Or build it from source
and apply a patch, however patching the debian/ folder is not trivial
even if the patch will be.

You could also write an empty package with the same name, your package
should win over the one from debian.

But whatever you do ... do not do any of that! You would need a _very_
good reason to not install what you get from debian. If a dep can
really be dropped you should discuss that with the debian maintainer.
If not, you likely want to install what is apparently "needed".

Anything you change will be on you and eventually come back to you. Any
"i need to save 3MB", or "i do not want the package because of a
license" likely does not qualify as a good reason to "fork".

Henning

> 
> > Any example of what you've tried already would be great.
> >  
> 
> As example you can choose any .deb that has a dependency and try to
> install without it.
> 
> Thanks, R-
> 


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Ignore a dependency
  2022-09-13 13:53     ` Henning Schild
@ 2022-09-13 18:59       ` Roberto A. Foglietta
  2022-09-14  8:34         ` Henning Schild
  0 siblings, 1 reply; 12+ messages in thread
From: Roberto A. Foglietta @ 2022-09-13 18:59 UTC (permalink / raw)
  To: Henning Schild; +Cc: Uladzimir Bely, isar-users

[-- Attachment #1: Type: text/plain, Size: 791 bytes --]

Dear Uladzimir and Henning,

First of all thanks for your answers.

I confirm that I did not found a straight forward way to do it. After all,
it is not necessary also. Mainly because two reasons: 1. debian packages
dependencies are sane and do not require any bypass; 2. the dpkg database
is left with a unsatisfied dependency and this get bothering forever.

Unfortunately, it is about a thirty party proprietary deb packages source.

I am testing a fake .deb in which the postinst unpack the target .deb and
it uses install to deploy the content in the rootfs. I hate to use this
trick but I need just one file from that package.

In brief, it does such a thing:

set the resolv.conf
apt update
apt download
dpkg -x
install
rm all

Every suggestion will be appreciated.

Best regards, R-

[-- Attachment #2: Type: text/html, Size: 1287 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Ignore a dependency
  2022-09-13 18:59       ` Roberto A. Foglietta
@ 2022-09-14  8:34         ` Henning Schild
  2022-09-14 18:42           ` Roberto A. Foglietta
  2022-10-01 22:14           ` Roberto A. Foglietta
  0 siblings, 2 replies; 12+ messages in thread
From: Henning Schild @ 2022-09-14  8:34 UTC (permalink / raw)
  To: Roberto A. Foglietta; +Cc: Uladzimir Bely, isar-users

Am Tue, 13 Sep 2022 20:59:51 +0200
schrieb "Roberto A. Foglietta" <roberto.foglietta@gmail.com>:

> Dear Uladzimir and Henning,
> 
> First of all thanks for your answers.
> 
> I confirm that I did not found a straight forward way to do it. After
> all, it is not necessary also. Mainly because two reasons: 1. debian
> packages dependencies are sane and do not require any bypass; 2. the
> dpkg database is left with a unsatisfied dependency and this get
> bothering forever.
> 
> Unfortunately, it is about a thirty party proprietary deb packages
> source.
> 
> I am testing a fake .deb in which the postinst unpack the target .deb
> and it uses install to deploy the content in the rootfs. I hate to
> use this trick but I need just one file from that package.

You can always use dpkg-prebuilt where you download that package,
binary patch it and later installed the modified copy with isar.
However if you have a sources.list entry and that package can
potentially get updated, you will not be able to make that hack stable.

That is a pattern for a broken binary package which i had to get into
a layer.

do_binary_patch[cleandirs] += "${WORKDIR}/blabla-package"
do_binary_patch() {
	sudo dpkg-deb -R ${WORKDIR}/blabla-package.deb ${WORKDIR}/blabla-package
	# do something funny with the control file, i.e. sed -i -e ... Depends
	sudo dpkg-deb -b ${WORKDIR}/blabla-package
}
addtask binary_patch after do_unpack before do_deploy_deb

Henning

> In brief, it does such a thing:
> 
> set the resolv.conf
> apt update
> apt download
> dpkg -x
> install
> rm all
> 
> Every suggestion will be appreciated.
> 
> Best regards, R-


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Ignore a dependency
  2022-09-14  8:34         ` Henning Schild
@ 2022-09-14 18:42           ` Roberto A. Foglietta
  2022-09-15  9:35             ` Henning Schild
  2022-10-01 22:14           ` Roberto A. Foglietta
  1 sibling, 1 reply; 12+ messages in thread
From: Roberto A. Foglietta @ 2022-09-14 18:42 UTC (permalink / raw)
  To: Henning Schild; +Cc: Uladzimir Bely, isar-users

[-- Attachment #1: Type: text/plain, Size: 1140 bytes --]

Il Mer 14 Set 2022, 10:34 Henning Schild <henning.schild@siemens.com> ha
scritto:

>
> do_binary_patch[cleandirs] += "${WORKDIR}/blabla-package"
> do_binary_patch() {
>         sudo dpkg-deb -R ${WORKDIR}/blabla-package.deb
> ${WORKDIR}/blabla-package
>         # do something funny with the control file, i.e. sed -i -e ...
> Depends
>         sudo dpkg-deb -b ${WORKDIR}/blabla-package
> }
> addtask binary_patch after do_unpack before do_deploy_deb
>

Dear Henning,

you got the point. I did not twsted yet but it looks promising. In the
meantime I made may way as explained here below:

> In brief, it does such a thing:
> >
> > set the resolv.conf
> > apt update
> > apt download
> > dpkg -x
> > install
> > rm all
> >
>

I am not particularly impressed by this way but for a sigle 3rd party
package it can be acceptable. Your solution seems much more elegant.

However, I started to write a class for doing this job and it seems an
over-engineered solution but it is very good to learn some internal about
Isar and bitbake. Both are valuable tools, so it is not wasted time. I bet
thsr your proposed solution will win.

Cheers, R-

>

[-- Attachment #2: Type: text/html, Size: 2099 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Ignore a dependency
  2022-09-14 18:42           ` Roberto A. Foglietta
@ 2022-09-15  9:35             ` Henning Schild
  0 siblings, 0 replies; 12+ messages in thread
From: Henning Schild @ 2022-09-15  9:35 UTC (permalink / raw)
  To: Roberto A. Foglietta; +Cc: Uladzimir Bely, isar-users

Am Wed, 14 Sep 2022 20:42:25 +0200
schrieb "Roberto A. Foglietta" <roberto.foglietta@gmail.com>:

> Il Mer 14 Set 2022, 10:34 Henning Schild <henning.schild@siemens.com>
> ha scritto:
> 
> >
> > do_binary_patch[cleandirs] += "${WORKDIR}/blabla-package"
> > do_binary_patch() {
> >         sudo dpkg-deb -R ${WORKDIR}/blabla-package.deb
> > ${WORKDIR}/blabla-package
> >         # do something funny with the control file, i.e. sed -i -e
> > ... Depends
> >         sudo dpkg-deb -b ${WORKDIR}/blabla-package
> > }
> > addtask binary_patch after do_unpack before do_deploy_deb
> >  
> 
> Dear Henning,
> 
> you got the point. I did not twsted yet but it looks promising. In the
> meantime I made may way as explained here below:
> 
> > In brief, it does such a thing:  
> > >
> > > set the resolv.conf
> > > apt update
> > > apt download
> > > dpkg -x
> > > install
> > > rm all
> > >  
> >  
> 
> I am not particularly impressed by this way but for a sigle 3rd party
> package it can be acceptable. Your solution seems much more elegant.
> 
> However, I started to write a class for doing this job and it seems an
> over-engineered solution but it is very good to learn some internal
> about Isar and bitbake. Both are valuable tools, so it is not wasted
> time. I bet thsr your proposed solution will win.

They are powerful and allow all sorts of stuff. But nothing beats
getting in touch with the vendor of the broken package and get your
problem fixed there, so you can eventually drop your hooks.

Henning

> Cheers, R-
> 
> >  


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Ignore a dependency
  2022-09-14  8:34         ` Henning Schild
  2022-09-14 18:42           ` Roberto A. Foglietta
@ 2022-10-01 22:14           ` Roberto A. Foglietta
  2022-10-01 23:10             ` Roberto A. Foglietta
  1 sibling, 1 reply; 12+ messages in thread
From: Roberto A. Foglietta @ 2022-10-01 22:14 UTC (permalink / raw)
  To: Henning Schild; +Cc: Uladzimir Bely, isar-users

[-- Attachment #1: Type: text/plain, Size: 2054 bytes --]

Il giorno mer 14 set 2022 alle ore 10:34 Henning Schild <
henning.schild@siemens.com> ha scritto:
>
> You can always use dpkg-prebuilt where you download that package,
> binary patch it and later installed the modified copy with isar.
> However if you have a sources.list entry and that package can
> potentially get updated, you will not be able to make that hack stable.
>
> That is a pattern for a broken binary package which i had to get into
> a layer.
>
> do_binary_patch[cleandirs] += "${WORKDIR}/blabla-package"
> do_binary_patch() {
>         sudo dpkg-deb -R ${WORKDIR}/blabla-package.deb
${WORKDIR}/blabla-package
>         # do something funny with the control file, i.e. sed -i -e ...
Depends
>         sudo dpkg-deb -b ${WORKDIR}/blabla-package
> }
> addtask binary_patch after do_unpack before do_deploy_deb

I am trying to fetch the package but I cannot, could you help me?

SRC_URI = "apt://pippo-fs"
addtask apt_fetch before do_binary_patch

ERROR: pippo-fs-1.0-r0 do_apt_fetch:
ExecutionError('/build/tmp/work/debian-bullseye-amd64/pippo-fs/1.0-r0/temp/run.do_apt_fetch.100',
100, None, None)
ERROR: Logfile of failure stored in:
/build/tmp/work/debian-bullseye-amd64/pippo-fs/1.0-r0/temp/log.do_apt_fetch.100
Log data follows:
| DEBUG: Executing shell function do_apt_fetch
| Reading package lists...
| E: Unable to find a source package for pippo-fs
| ERROR:
ExecutionError('/build/tmp/work/debian-bullseye-amd64/pippo-fs/1.0-r0/temp/run.do_apt_fetch.100',
100, None, None)
ERROR: Task (/build/../repo/recipes-support/nvidia-repack/pippo-fs.bb:do_apt_fetch)
failed with exit code '1'
NOTE: Tasks Summary: Attempted 30 tasks of which 29 didn't need to be rerun
and 1 failed.

pippo-fs is a legit package that could be fetch if put into IMAGE_PREINSTALL

Using do_fetch complains about checksum file

bb.data_smart.ExpansionError: Failure expanding variable
do_fetch[file-checksums], expression was
${@bb.fetch.get_checksum_file_list(d)} which triggered exception
MalformedUrl: The URL: 'pippo-fs' is invalid and cannot be interpreted

[-- Attachment #2: Type: text/html, Size: 2473 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Ignore a dependency
  2022-10-01 22:14           ` Roberto A. Foglietta
@ 2022-10-01 23:10             ` Roberto A. Foglietta
  0 siblings, 0 replies; 12+ messages in thread
From: Roberto A. Foglietta @ 2022-10-01 23:10 UTC (permalink / raw)
  To: Henning Schild; +Cc: Uladzimir Bely, isar-users

[-- Attachment #1: Type: text/plain, Size: 3179 bytes --]

Il giorno dom 2 ott 2022 alle ore 00:14 Roberto A. Foglietta <
roberto.foglietta@gmail.com> ha scritto:
>
> Il giorno mer 14 set 2022 alle ore 10:34 Henning Schild <
henning.schild@siemens.com> ha scritto:
> >
> > You can always use dpkg-prebuilt where you download that package,
> > binary patch it and later installed the modified copy with isar.
> > However if you have a sources.list entry and that package can
> > potentially get updated, you will not be able to make that hack stable.
> >
> > That is a pattern for a broken binary package which i had to get into
> > a layer.
> >
> > do_binary_patch[cleandirs] += "${WORKDIR}/blabla-package"
> > do_binary_patch() {
> >         sudo dpkg-deb -R ${WORKDIR}/blabla-package.deb
${WORKDIR}/blabla-package
> >         # do something funny with the control file, i.e. sed -i -e ...
Depends
> >         sudo dpkg-deb -b ${WORKDIR}/blabla-package
> > }
> > addtask binary_patch after do_unpack before do_deploy_deb
>
> I am trying to fetch the package but I cannot, could you help me?
>
> SRC_URI = "apt://pippo-fs"
> addtask apt_fetch before do_binary_patch
>
> ERROR: pippo-fs-1.0-r0 do_apt_fetch:
ExecutionError('/build/tmp/work/debian-bullseye-amd64/pippo-fs/1.0-r0/temp/run.do_apt_fetch.100',
100, None, None)
> ERROR: Logfile of failure stored in:
/build/tmp/work/debian-bullseye-amd64/pippo-fs/1.0-r0/temp/log.do_apt_fetch.100
> Log data follows:
> | DEBUG: Executing shell function do_apt_fetch
> | Reading package lists...
> | E: Unable to find a source package for pippo-fs
> | ERROR:
ExecutionError('/build/tmp/work/debian-bullseye-amd64/pippo-fs/1.0-r0/temp/run.do_apt_fetch.100',
100, None, None)
> ERROR: Task (/build/../repo/recipes-support/nvidia-repack/pippo-fs.bb:do_apt_fetch)
failed with exit code '1'
> NOTE: Tasks Summary: Attempted 30 tasks of which 29 didn't need to be
rerun and 1 failed.
>
> pippo-fs is a legit package that could be fetch if put into
IMAGE_PREINSTALL
>
> Using do_fetch complains about checksum file
>
> bb.data_smart.ExpansionError: Failure expanding variable
do_fetch[file-checksums], expression was
${@bb.fetch.get_checksum_file_list(d)} which triggered exception
MalformedUrl: The URL: 'pippo-fs' is invalid and cannot be interpreted

Even more interesting this simple recipe

inherit dpkg-base
SRC_URI = "apt://${PN}"

download the package ONLY if the package is into the debian repository but
NOT if the package is in a external repository defined into conf/ but
available with IMAGE_PREINSTALL

I have also tried to change the repository but it did not work either

diff --git a/meta/classes/sbuild.bbclass b/meta/classes/sbuild.bbclass
index a29b745..4fa6a46 100644
--- a/meta/classes/sbuild.bbclass
+++ b/meta/classes/sbuild.bbclass
@@ -55,7 +55,7 @@ EOF
         cp -rf "${SCHROOT_CONF}/sbuild" "${SBUILD_CONF_DIR}"
         sbuild_fstab="${SBUILD_CONF_DIR}/fstab"

-        fstab_baseapt="${REPO_BASE_DIR} /base-apt none rw,bind 0 0"
+        fstab_baseapt="${REPO_ISAR_DIR} /base-apt none rw,bind 0 0"
         grep -qxF "${fstab_baseapt}" ${sbuild_fstab} || echo
"${fstab_baseapt}" >> ${sbuild_fstab}

         fstab_pkgdir="${WORKDIR} /home/builder/${PN} none rw,bind 0 0"

[-- Attachment #2: Type: text/html, Size: 3917 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-10-01 23:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-13 11:55 Ignore a dependency Roberto A. Foglietta
2022-09-13 12:53 ` Uladzimir Bely
2022-09-13 12:58   ` Roberto A. Foglietta
2022-09-13 13:09     ` Baurzhan Ismagulov
2022-09-13 13:09     ` Uladzimir Bely
2022-09-13 13:53     ` Henning Schild
2022-09-13 18:59       ` Roberto A. Foglietta
2022-09-14  8:34         ` Henning Schild
2022-09-14 18:42           ` Roberto A. Foglietta
2022-09-15  9:35             ` Henning Schild
2022-10-01 22:14           ` Roberto A. Foglietta
2022-10-01 23:10             ` Roberto A. Foglietta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox