public inbox for gentoo-catalyst@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-catalyst] [PATCH 1/2] valid_config_file_values: allow compression_mode
@ 2020-05-29 19:04 Daniel Cordero
  2020-05-29 19:04 ` [gentoo-catalyst] [PATCH 2/2] Decompressor uses decompression options Daniel Cordero
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Cordero @ 2020-05-29 19:04 UTC (permalink / raw
  To: gentoo-catalyst

From: Daniel Cordero <catalyst@0xdc.io>

Allow overriding compression mode globally from the catalyst config.

Otherwise, if one wanted a different compression method than the
default, one would need to add compression_mode to every spec file.
---
 catalyst/defaults.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/catalyst/defaults.py b/catalyst/defaults.py
index 14f671fe..c153fcc4 100644
--- a/catalyst/defaults.py
+++ b/catalyst/defaults.py
@@ -9,6 +9,7 @@ from DeComp.definitions import DECOMPRESSOR_PROGRAM_OPTIONS, LIST_XATTRS_OPTIONS
 
 
 valid_config_file_values = frozenset([
+    "compression_mode",
     "digests",
     "distdir",
     "envscript",
-- 
2.26.2



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

* [gentoo-catalyst] [PATCH 2/2] Decompressor uses decompression options
  2020-05-29 19:04 [gentoo-catalyst] [PATCH 1/2] valid_config_file_values: allow compression_mode Daniel Cordero
@ 2020-05-29 19:04 ` Daniel Cordero
  2020-05-31 12:44   ` Daniel Cordero
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Cordero @ 2020-05-29 19:04 UTC (permalink / raw
  To: gentoo-catalyst

From: Daniel Cordero <catalyst@0xdc.io>

If decompressor != compressor, the options given to the programs may not
be understood, causing runtime errors.

Allow the compression arguments to be overridden in a specfile.
Compressor can already be configured with compression_mode.

For decompression, while the decompressor is detected by the file
extension, use the separate decomp_opts so there is no argument
conflicts.
---
Note: compressor_options can't be empty, as catalyst just drops the key.

 catalyst/base/stagebase.py | 3 ++-
 catalyst/defaults.py       | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 5a8cd1df..6efcf0d1 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -48,6 +48,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
             "cflags",
             "common_flags",
             "compression_mode",
+            "compressor_options",
             "cxxflags",
             "decompressor_search_order",
             "distcc_hosts",
@@ -677,7 +678,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
             source=self.settings["source_path"],
             destination=self.settings["chroot_path"],
             arch=self.settings["compressor_arch"],
-            other_options=self.settings["compressor_options"],
+            other_options=self.settings["decomp_opt"],
         )
 
         display_msg = (
diff --git a/catalyst/defaults.py b/catalyst/defaults.py
index c153fcc4..fbf406b2 100644
--- a/catalyst/defaults.py
+++ b/catalyst/defaults.py
@@ -30,7 +30,7 @@ confdefaults = {
     "compression_mode": 'lbzip2',
     "compressor_arch": None,
     "compressor_options": XATTRS_OPTIONS['linux'],
-    "decomp_opt": DECOMPRESSOR_PROGRAM_OPTIONS['linux'],
+    "decomp_opt": XATTRS_OPTIONS['linux'],
     "decompressor_search_order": DECOMPRESSOR_SEARCH_ORDER,
     "distdir": portage.settings['DISTDIR'],
     "icecream": "/var/cache/icecream",
-- 
2.26.2



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

* Re: [gentoo-catalyst] [PATCH 2/2] Decompressor uses decompression options
  2020-05-29 19:04 ` [gentoo-catalyst] [PATCH 2/2] Decompressor uses decompression options Daniel Cordero
@ 2020-05-31 12:44   ` Daniel Cordero
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Cordero @ 2020-05-31 12:44 UTC (permalink / raw
  To: gentoo-catalyst

On Fri, May 29, 2020 at 07:04:32PM +0000, Daniel Cordero wrote:
> 
> If decompressor != compressor, the options given to the programs may not
> be understood, causing runtime errors.
> 
> Allow the compression arguments to be overridden in a specfile.
> Compressor can already be configured with compression_mode.
> 
> For decompression, while the decompressor is detected by the file
> extension, use the separate decomp_opts so there is no argument
> conflicts.
> ---
> Note: compressor_options can't be empty, as catalyst just drops the key.
> 
>  catalyst/base/stagebase.py | 3 ++-
>  catalyst/defaults.py       | 2 +-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
> index 5a8cd1df..6efcf0d1 100644
> --- a/catalyst/base/stagebase.py
> +++ b/catalyst/base/stagebase.py
> @@ -48,6 +48,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
>              "cflags",
>              "common_flags",
>              "compression_mode",
> +            "compressor_options",
>              "cxxflags",
>              "decompressor_search_order",
>              "distcc_hosts",
> @@ -677,7 +678,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
>              source=self.settings["source_path"],
>              destination=self.settings["chroot_path"],
>              arch=self.settings["compressor_arch"],
> -            other_options=self.settings["compressor_options"],
> +            other_options=self.settings["decomp_opt"],
>          )
>  
>          display_msg = (

Speaking with some people in #gentoo-releng, this patch will break pixz
and lbzip2 decompression during the unpack stage. Will rework.

> diff --git a/catalyst/defaults.py b/catalyst/defaults.py
> index c153fcc4..fbf406b2 100644
> --- a/catalyst/defaults.py
> +++ b/catalyst/defaults.py
> @@ -30,7 +30,7 @@ confdefaults = {
>      "compression_mode": 'lbzip2',
>      "compressor_arch": None,
>      "compressor_options": XATTRS_OPTIONS['linux'],
> -    "decomp_opt": DECOMPRESSOR_PROGRAM_OPTIONS['linux'],
> +    "decomp_opt": XATTRS_OPTIONS['linux'],
>      "decompressor_search_order": DECOMPRESSOR_SEARCH_ORDER,
>      "distdir": portage.settings['DISTDIR'],
>      "icecream": "/var/cache/icecream",
> -- 
> 2.26.2
> 
> 


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

end of thread, other threads:[~2020-05-31 12:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-29 19:04 [gentoo-catalyst] [PATCH 1/2] valid_config_file_values: allow compression_mode Daniel Cordero
2020-05-29 19:04 ` [gentoo-catalyst] [PATCH 2/2] Decompressor uses decompression options Daniel Cordero
2020-05-31 12:44   ` Daniel Cordero

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