[PATCH] config-tools: Missing tqdm python package in board_inspector.deb


Li, Ziheng
 

From 8a754bc0618e2c05d95805a8729ca872ffe6c902 Mon Sep 17 00:00:00 2001
From: zihengL1 <ziheng.li@...>
Date: Fri, 16 Sep 2022 10:47:43 +0800
Subject: [PATCH] config-tools: Missing tqdm python package in board_inspector.deb

Added tqdm installation procedure in acrn-board-inspector.postinst.

Tracked-On: #8155
Signed-off-by: Ziheng Li <ziheng.li@...>
---
misc/packaging/acrn-board-inspector.postinst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/misc/packaging/acrn-board-inspector.postinst b/misc/packaging/acrn-board-inspector.postinst
index 480405e18..87dae677a 100644
--- a/misc/packaging/acrn-board-inspector.postinst
+++ b/misc/packaging/acrn-board-inspector.postinst
@@ -2,7 +2,7 @@
#* Copyright (c) 2020-2022 Intel Corporation SPDX-License-Identifier: BSD-3-Clause
# postinst script for acrn-board-inspector

-pip3 install xmlschema
+pip3 install xmlschema tqdm

set -e

--
2.35.1.windows.2


Junjie Mao
 

-----Original Message-----
From: Li, Ziheng <ziheng.li@...>
Sent: Friday, September 16, 2022 3:41 PM
To: acrn-dev@...; Mao, Junjie <junjie.mao@...>
Subject: [PATCH] config-tools: Missing tqdm python package in board_inspector.deb

From 8a754bc0618e2c05d95805a8729ca872ffe6c902 Mon Sep 17 00:00:00 2001
From: zihengL1 <ziheng.li@...>
Date: Fri, 16 Sep 2022 10:47:43 +0800
Subject: [PATCH] config-tools: Missing tqdm python package in board_inspector.deb

Added tqdm installation procedure in acrn-board-inspector.postinst.

Tracked-On: #8155
Signed-off-by: Ziheng Li <ziheng.li@...>
---
misc/packaging/acrn-board-inspector.postinst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/misc/packaging/acrn-board-inspector.postinst b/misc/packaging/acrn-board-
inspector.postinst
index 480405e18..87dae677a 100644
--- a/misc/packaging/acrn-board-inspector.postinst
+++ b/misc/packaging/acrn-board-inspector.postinst
@@ -2,7 +2,7 @@
#* Copyright (c) 2020-2022 Intel Corporation SPDX-License-Identifier: BSD-3-Clause
# postinst script for acrn-board-inspector

-pip3 install xmlschema
+pip3 install xmlschema tqdm
Why not add those packages as dependencies of the built package? Installing additional stuff in postinst is not a good practice.

---
Best Regards
Junjie Mao


set -e

--
2.35.1.windows.2


Geoffroy Van Cutsem
 

-----Original Message-----
From: acrn-dev@... <acrn-dev@...> On
Behalf Of Junjie Mao
Sent: Monday, September 19, 2022 2:32 am
To: Li, Ziheng <ziheng.li@...>; acrn-dev@...
Subject: Re: [acrn-dev] [PATCH] config-tools: Missing tqdm python package
in board_inspector.deb

-----Original Message-----
From: Li, Ziheng <ziheng.li@...>
Sent: Friday, September 16, 2022 3:41 PM
To: acrn-dev@...; Mao, Junjie <junjie.mao@...>
Subject: [PATCH] config-tools: Missing tqdm python package in
board_inspector.deb

From 8a754bc0618e2c05d95805a8729ca872ffe6c902 Mon Sep 17 00:00:00
2001
From: zihengL1 <ziheng.li@...>
Date: Fri, 16 Sep 2022 10:47:43 +0800
Subject: [PATCH] config-tools: Missing tqdm python package in
board_inspector.deb

Added tqdm installation procedure in acrn-board-inspector.postinst.

Tracked-On: #8155
Signed-off-by: Ziheng Li <ziheng.li@...>
---
misc/packaging/acrn-board-inspector.postinst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/misc/packaging/acrn-board-inspector.postinst
b/misc/packaging/acrn-board- inspector.postinst index
480405e18..87dae677a 100644
--- a/misc/packaging/acrn-board-inspector.postinst
+++ b/misc/packaging/acrn-board-inspector.postinst
@@ -2,7 +2,7 @@
#* Copyright (c) 2020-2022 Intel Corporation SPDX-License-Identifier:
BSD-3-Clause # postinst script for acrn-board-inspector

-pip3 install xmlschema
+pip3 install xmlschema tqdm
Why not add those packages as dependencies of the built package? Installing
additional stuff in postinst is not a good practice.
Because unless they exist as Debian packages, they're Python packages (PyPI) and so cannot simply be listed as dependencies. The solution is *really* ugly though in my opinion for a couple of reasons:
* We install, without the explicit understanding by the user, additional software (as root) on his system
* We have no versioning in place which means this could break at any time if one of those gets updated in a fashion that is not compatible with our SW.

I was doing a bit of research on this but I cannot find an "easy" way to solve this, the best recommendation I see is to create Debian packages of those libraries if they do not exist. This implies some overheard of course.

Perhaps we should remove this from the postint and explicitly ask the user to install those (and specify a version). Thoughts?


---
Best Regards
Junjie Mao


set -e

--
2.35.1.windows.2




Junjie Mao
 

-----Original Message-----
From: acrn-dev@... <acrn-dev@...> On Behalf Of
Geoffroy Van Cutsem
Sent: Monday, September 19, 2022 8:48 PM
To: acrn-dev@...; Li, Ziheng <ziheng.li@...>
Subject: Re: [acrn-dev] [PATCH] config-tools: Missing tqdm python package in
board_inspector.deb



-----Original Message-----
From: acrn-dev@... <acrn-dev@...> On
Behalf Of Junjie Mao
Sent: Monday, September 19, 2022 2:32 am
To: Li, Ziheng <ziheng.li@...>; acrn-dev@...
Subject: Re: [acrn-dev] [PATCH] config-tools: Missing tqdm python package
in board_inspector.deb

-----Original Message-----
From: Li, Ziheng <ziheng.li@...>
Sent: Friday, September 16, 2022 3:41 PM
To: acrn-dev@...; Mao, Junjie <junjie.mao@...>
Subject: [PATCH] config-tools: Missing tqdm python package in
board_inspector.deb

From 8a754bc0618e2c05d95805a8729ca872ffe6c902 Mon Sep 17 00:00:00
2001
From: zihengL1 <ziheng.li@...>
Date: Fri, 16 Sep 2022 10:47:43 +0800
Subject: [PATCH] config-tools: Missing tqdm python package in
board_inspector.deb

Added tqdm installation procedure in acrn-board-inspector.postinst.

Tracked-On: #8155
Signed-off-by: Ziheng Li <ziheng.li@...>
---
misc/packaging/acrn-board-inspector.postinst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/misc/packaging/acrn-board-inspector.postinst
b/misc/packaging/acrn-board- inspector.postinst index
480405e18..87dae677a 100644
--- a/misc/packaging/acrn-board-inspector.postinst
+++ b/misc/packaging/acrn-board-inspector.postinst
@@ -2,7 +2,7 @@
#* Copyright (c) 2020-2022 Intel Corporation SPDX-License-Identifier:
BSD-3-Clause # postinst script for acrn-board-inspector

-pip3 install xmlschema
+pip3 install xmlschema tqdm
Why not add those packages as dependencies of the built package? Installing
additional stuff in postinst is not a good practice.
Because unless they exist as Debian packages, they're Python packages (PyPI) and so cannot
simply be listed as dependencies. The solution is *really* ugly though in my opinion for a
couple of reasons:
* We install, without the explicit understanding by the user, additional software (as root)
on his system
* We have no versioning in place which means this could break at any time if one of those
gets updated in a fashion that is not compatible with our SW.

I was doing a bit of research on this but I cannot find an "easy" way to solve this, the
best recommendation I see is to create Debian packages of those libraries if they do not
exist. This implies some overheard of course.

Perhaps we should remove this from the postint and explicitly ask the user to install
those (and specify a version). Thoughts?
For the PyPI libraries that are not packaged in Ubuntu, we may add a check in preinst and refuse the install if any prerequisite is not available.

We also need add such logic to the scripts under debian/, which will become the official packaging scripts soon.

---
Best Regards
Junjie Mao


---
Best Regards
Junjie Mao


set -e

--
2.35.1.windows.2







Geoffroy Van Cutsem
 

-----Original Message-----
From: acrn-dev@... <acrn-dev@...> On
Behalf Of Junjie Mao
Sent: Tuesday, September 20, 2022 2:54 am
To: acrn-dev@...; Li, Ziheng <ziheng.li@...>
Subject: Re: [acrn-dev] [PATCH] config-tools: Missing tqdm python package
in board_inspector.deb

-----Original Message-----
From: acrn-dev@... <acrn-dev@...>
On Behalf Of Geoffroy Van Cutsem
Sent: Monday, September 19, 2022 8:48 PM
To: acrn-dev@...; Li, Ziheng <ziheng.li@...>
Subject: Re: [acrn-dev] [PATCH] config-tools: Missing tqdm python
package in board_inspector.deb



-----Original Message-----
From: acrn-dev@...
<acrn-dev@...> On Behalf Of Junjie Mao
Sent: Monday, September 19, 2022 2:32 am
To: Li, Ziheng <ziheng.li@...>; acrn-dev@...
Subject: Re: [acrn-dev] [PATCH] config-tools: Missing tqdm python
package in board_inspector.deb

-----Original Message-----
From: Li, Ziheng <ziheng.li@...>
Sent: Friday, September 16, 2022 3:41 PM
To: acrn-dev@...; Mao, Junjie
<junjie.mao@...>
Subject: [PATCH] config-tools: Missing tqdm python package in
board_inspector.deb

From 8a754bc0618e2c05d95805a8729ca872ffe6c902 Mon Sep 17
00:00:00
2001
From: zihengL1 <ziheng.li@...>
Date: Fri, 16 Sep 2022 10:47:43 +0800
Subject: [PATCH] config-tools: Missing tqdm python package in
board_inspector.deb

Added tqdm installation procedure in acrn-board-inspector.postinst.

Tracked-On: #8155
Signed-off-by: Ziheng Li <ziheng.li@...>
---
misc/packaging/acrn-board-inspector.postinst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/misc/packaging/acrn-board-inspector.postinst
b/misc/packaging/acrn-board- inspector.postinst index
480405e18..87dae677a 100644
--- a/misc/packaging/acrn-board-inspector.postinst
+++ b/misc/packaging/acrn-board-inspector.postinst
@@ -2,7 +2,7 @@
#* Copyright (c) 2020-2022 Intel Corporation SPDX-License-Identifier:
BSD-3-Clause # postinst script for acrn-board-inspector

-pip3 install xmlschema
+pip3 install xmlschema tqdm
Why not add those packages as dependencies of the built package?
Installing additional stuff in postinst is not a good practice.
Because unless they exist as Debian packages, they're Python packages
(PyPI) and so cannot simply be listed as dependencies. The solution is
*really* ugly though in my opinion for a couple of reasons:
* We install, without the explicit understanding by the user,
additional software (as root) on his system
* We have no versioning in place which means this could break at any
time if one of those gets updated in a fashion that is not compatible with
our SW.

I was doing a bit of research on this but I cannot find an "easy" way
to solve this, the best recommendation I see is to create Debian
packages of those libraries if they do not exist. This implies some overheard
of course.

Perhaps we should remove this from the postint and explicitly ask the
user to install those (and specify a version). Thoughts?
For the PyPI libraries that are not packaged in Ubuntu, we may add a check in
preinst and refuse the install if any prerequisite is not available.

We also need add such logic to the scripts under debian/, which will become
the official packaging scripts soon.
This sounds like a good approach to me!

Geoffroy


---
Best Regards
Junjie Mao


---
Best Regards
Junjie Mao


set -e

--
2.35.1.windows.2