[PATCH 1/8] doc: Remove extra asterisk

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH 1/8] doc: Remove extra asterisk

Matt Turner-5
Fixes: c7688c666567 (doc/catalyst-config.5.txt: Add man page for catalyst.conf)
Signed-off-by: Matt Turner <[hidden email]>
---
 doc/catalyst-config.5.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/catalyst-config.5.txt b/doc/catalyst-config.5.txt
index d5444b38..4fe1af8c 100644
--- a/doc/catalyst-config.5.txt
+++ b/doc/catalyst-config.5.txt
@@ -51,7 +51,7 @@ variables using POSIX shell notation:
 export FOO="bar"
 ---------------------------------
 
-**options*::
+*options*::
 Set different build-time options (example: `autoresume bindist
 kerncache pkgcache seedcache`).  Supported values:
 +
--
2.26.2


Reply | Threaded
Open this post in threaded view
|

[PATCH 2/8] doc: Drop pre-EAPI-5 text

Matt Turner-5
There are very few EAPI < 5 ebuilds left.

Signed-off-by: Matt Turner <[hidden email]>
---
 doc/catalyst-config.5.txt | 30 +-----------------------------
 1 file changed, 1 insertion(+), 29 deletions(-)

diff --git a/doc/catalyst-config.5.txt b/doc/catalyst-config.5.txt
index 4fe1af8c..f17944b2 100644
--- a/doc/catalyst-config.5.txt
+++ b/doc/catalyst-config.5.txt
@@ -168,22 +168,7 @@ This section is only important if you are using binary packages to
 build your stages (by enabling the `pkgcache` option and restarting
 incomplete builds).
 
-Before EAPI-5 introduced ABI sub-slots, the build-time compatibility
-of packages was not recorded.  This leads to problems such as binary
-GCC packages built against mpc-0.8.2 (which installs libmpc.so.2)
-being installed on systems that only have mpc-1.0.1 (which installs
-libmpc.so.3), resulting in:
-
----------------------------------
-/usr/libexec/gcc/i686-pc-linux-gnu/4.6.3/cc1:
-  error while loading shared libraries: libmpc.so.2:
-  cannot open shared object file: No such file or directory
----------------------------------
-
-As long as there are packages in your stage that don't use ABI
-sub-slots, you may experience errors like this due to untracked ABI
-missmatches in binary packages.  Packages generated by catalyst builds
-are currently namespaced:
+Packages generated by catalyst builds are namespaced:
 
 If versioned_cache is set:
 ---------------------------------
@@ -194,19 +179,6 @@ Otherwise:
 .../packages/<rel_type>/<target>-<subarch>/Packages
 ---------------------------------
 
-so running into these out-of-date packages is unlikely.  You may run
-into problems if:
-
-* you enable `update_seed` in your stage1 spec after a previous run
-  which generated packages linking against out-of-date seed libraries
-  or
-* you update your snapshot and an untracked ABI dependency is bumped
-  without a similar bump in the dependent package.
-
-without also bumping any of the package namespace variables in your
-spec.  If you do make such a change, it's a good idea to clear the
-package cache in question and rebuild the packages from scratch.
-
 
 FILES
 -----
--
2.26.2


Reply | Threaded
Open this post in threaded view
|

[PATCH 3/8] doc: Merge SUPPORTED HASHES section into digests section

Matt Turner-5
In reply to this post by Matt Turner-5
It made sense to have this as a separate section when there were
multiple configuration options (digests and hash_function) but
hash_function is now gone.

Signed-off-by: Matt Turner <[hidden email]>
---
 doc/catalyst-config.5.txt | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/doc/catalyst-config.5.txt b/doc/catalyst-config.5.txt
index f17944b2..7ac9a2a3 100644
--- a/doc/catalyst-config.5.txt
+++ b/doc/catalyst-config.5.txt
@@ -38,8 +38,13 @@ Basic configuration
 *digests*::
 Create a `.DIGESTS` file containing the hash output from any of the
 supported options below.  Adding them all may take a long time.
-(example: `md5 sha1 sha512 whirlpool`).  See the *SUPPORTED HASHES*
-section for a list of supported hashes.
+(example: `md5 sha1 sha512 whirlpool`).  The set of supported hashes
+is dependent on the version of Python. To see the set of hashes
+supported by the version of Python in use, run
++
+---------------------------------
+$ python3 -c 'import hashlib; print(hashlib.algorithms_available)'
+---------------------------------
 
 *envscript*::
 Environment script location, which allows users to set options such as
@@ -154,14 +159,6 @@ takes place in RAM.  This feature requires a pretty large tmpfs
 much RAM everything will fail horribly and it is not our fault.
 
 
-SUPPORTED HASHES
-----------------
-The list of supported hashes is dependent on the version of Python. To
-see the list of hashes supported by the version of Python in use, run
-
-    $ python3 -c 'import hashlib; print(hashlib.algorithms_available)'
-
-
 BINARY PACKAGE DEPENDENCIES
 ---------------------------
 This section is only important if you are using binary packages to
--
2.26.2


Reply | Threaded
Open this post in threaded view
|

[PATCH 4/8] targets: Test for locale-gen

Matt Turner-5
In reply to this post by Matt Turner-5
locale-gen is only provided by glibc and not by others.

Signed-off-by: Matt Turner <[hidden email]>
---
 targets/stage1/chroot.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/targets/stage1/chroot.sh b/targets/stage1/chroot.sh
index ac9d68ea..b48fda65 100755
--- a/targets/stage1/chroot.sh
+++ b/targets/stage1/chroot.sh
@@ -82,7 +82,9 @@ run_merge "--oneshot ${clst_buildpkgs}"
 # locale-gen does not support the ROOT variable, and as such glibc simply does
 # not run locale-gen when ROOT is set. Since we've set LANG, we need to run
 # locale-gen explicitly.
-locale-gen --destdir "${clst_root_path}"/ || die "locale-gen failed"
+if [ -x "$(command -v locale-gen)" ]; then
+ locale-gen --destdir "${clst_root_path}"/ || die "locale-gen failed"
+fi
 
 # Why are we removing these? Don't we need them for final make.conf?
 for useexpand in ${clst_HOSTUSEEXPAND}; do
--
2.26.2


Reply | Threaded
Open this post in threaded view
|

[PATCH 5/8] catalyst: Drop unnecessary clear_path()

Matt Turner-5
In reply to this post by Matt Turner-5
open(..., 'w') truncates the file.

Signed-off-by: Matt Turner <[hidden email]>
---
 catalyst/base/stagebase.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 964a5129..68945da8 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -974,7 +974,6 @@ class StageBase(TargetBase, ClearBase, GenBase):
         # Modify and write out make.conf (for the chroot)
         makepath = normpath(self.settings["chroot_path"] +
                             self.settings["make_conf"])
-        clear_path(makepath)
         with open(makepath, "w") as myf:
             log.notice("Writing the stage make.conf to: %s" % makepath)
             myf.write("# These settings were set by the catalyst build script "
--
2.26.2


Reply | Threaded
Open this post in threaded view
|

[PATCH 6/8] catalyst: Add error checking to snapshot target

Matt Turner-5
In reply to this post by Matt Turner-5
Signed-off-by: Matt Turner <[hidden email]>
---
 catalyst/targets/snapshot.py | 34 ++++++++++++++++++++++------------
 1 file changed, 22 insertions(+), 12 deletions(-)

diff --git a/catalyst/targets/snapshot.py b/catalyst/targets/snapshot.py
index b6c72c51..497b2918 100644
--- a/catalyst/targets/snapshot.py
+++ b/catalyst/targets/snapshot.py
@@ -10,7 +10,7 @@ from pathlib import Path
 from catalyst import log
 from catalyst.base.targetbase import TargetBase
 from catalyst.lock import write_lock
-from catalyst.support import command
+from catalyst.support import CatalystError, command
 
 class snapshot(TargetBase):
     """
@@ -52,17 +52,27 @@ class snapshot(TargetBase):
                  repouri, self.gitdir],
             ]
 
-        for cmd in git_cmds:
-            log.notice('>>> ' + ' '.join(cmd))
-            subprocess.run(cmd,
-                           encoding='utf-8',
-                           close_fds=False)
-
-        sp = subprocess.run([self.git, '-C', self.gitdir, 'rev-parse', 'stable'],
-                            stdout=subprocess.PIPE,
-                            encoding='utf-8',
-                            close_fds=False)
-        return sp.stdout.rstrip()
+        try:
+            for cmd in git_cmds:
+                log.notice('>>> ' + ' '.join(cmd))
+                subprocess.run(cmd,
+                               capture_output=True,
+                               check=True,
+                               encoding='utf-8',
+                               close_fds=False)
+
+            sp = subprocess.run([self.git, '-C', self.gitdir, 'rev-parse', 'stable'],
+                                stdout=subprocess.PIPE,
+                                capture_output=True,
+                                check=True,
+                                encoding='utf-8',
+                                close_fds=False)
+            return sp.stdout.rstrip()
+
+        except subprocess.CalledProcessError as e:
+            raise CatalystError(f'{e.cmd} failed with return code'
+                                f'{e.returncode}\n'
+                                f'{e.output}\n')
 
     def run(self):
         if self.settings['snapshot_treeish'] == 'stable':
--
2.26.2


Reply | Threaded
Open this post in threaded view
|

[PATCH 7/8] catalyst: Make parent directories of snapshots/

Matt Turner-5
In reply to this post by Matt Turner-5
Otherwise, if /var/tmp/catalyst does not exist when the snapshot target
is executed it will fail to make the snapshots/ directory.

Signed-off-by: Matt Turner <[hidden email]>
---
 catalyst/base/targetbase.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/catalyst/base/targetbase.py b/catalyst/base/targetbase.py
index 5bcea920..3e338bee 100644
--- a/catalyst/base/targetbase.py
+++ b/catalyst/base/targetbase.py
@@ -24,7 +24,7 @@ class TargetBase(ABC):
     def set_snapshot(self, treeish=None):
         # Make snapshots directory
         snapshot_dir = Path(self.settings['storedir'], 'snapshots')
-        snapshot_dir.mkdir(mode=0o755, exist_ok=True)
+        snapshot_dir.mkdir(mode=0o755, parents=True, exist_ok=True)
 
         repo_name = self.settings['repo_name']
         if treeish is None:
--
2.26.2


Reply | Threaded
Open this post in threaded view
|

[PATCH 8/8] catalyst: Explain the git gc config options

Matt Turner-5
In reply to this post by Matt Turner-5
Signed-off-by: Matt Turner <[hidden email]>
---
 catalyst/targets/snapshot.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/catalyst/targets/snapshot.py b/catalyst/targets/snapshot.py
index 497b2918..b7562f7c 100644
--- a/catalyst/targets/snapshot.py
+++ b/catalyst/targets/snapshot.py
@@ -43,6 +43,8 @@ class snapshot(TargetBase):
         else:
             git_cmds = [
                 [self.git, 'clone', '--quiet', '--depth=1', '--bare',
+                 # Set some config options to enable git gc to clean everything
+                 # except what we just fetched. See git-gc(1).
                  '-c', 'gc.reflogExpire=0',
                  '-c', 'gc.reflogExpireUnreachable=0',
                  '-c', 'gc.rerereresolved=0',
--
2.26.2


Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1/8] doc: Remove extra asterisk

Brian Dolbec-3
In reply to this post by Matt Turner-5
On Thu, 14 May 2020 23:09:54 -0700
Matt Turner <[hidden email]> wrote:

> Fixes: c7688c666567 (doc/catalyst-config.5.txt: Add man page for
> catalyst.conf) Signed-off-by: Matt Turner <[hidden email]>
> ---
>  doc/catalyst-config.5.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/doc/catalyst-config.5.txt b/doc/catalyst-config.5.txt
> index d5444b38..4fe1af8c 100644
> --- a/doc/catalyst-config.5.txt
> +++ b/doc/catalyst-config.5.txt
> @@ -51,7 +51,7 @@ variables using POSIX shell notation:
>  export FOO="bar"
>  ---------------------------------
>  
> -**options*::
> +*options*::
>  Set different build-time options (example: `autoresume bindist
>  kerncache pkgcache seedcache`).  Supported values:
>  +


This series 1 thru 8 looks good