Github messages for voidlinux
 help / color / mirror / Atom feed
From: fosslinux <fosslinux@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] [wip] common: disable creation of noarch packages.
Date: Sat, 05 Sep 2020 01:19:00 +0200	[thread overview]
Message-ID: <20200904231900.wSTRfkDb0_MS8feCUslpbQ82i0-4FNuD5pur27Op-SI@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-24357@inbox.vuxu.org>

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

There is an updated pull request by fosslinux against master on the void-packages repository

https://github.com/fosslinux/void-packages noarch
https://github.com/void-linux/void-packages/pull/24357

[wip] common: disable creation of noarch packages.
This change disables the creation of noarch packages.

I believe that most package maintainers are of the same opinion that noarch causes far more problems than it solves. For some time on IRC there has been continued discussion about disabling it. This is what this PR attempts to achieve.

This still supports `archs=noarch` but IMO this is misleading if it dosen't actually create a package with the noarch arch. This is why I have made `archs=noarch` just mean `noarch=yes`. This is how I think all future packages should declare noarch: `noarch=yes`. I also considered `data_only=yes` or `arch_independent=yes` but I don't really like either of those.

The reason noarch even still exists is because it is a useful shorthand for `nodebug=yes`, `nostrip=yes`, etc etc.

The removed 32-bit block about noarch is useless because noarch already forces `noshlibprovides`.

NB: Right now, this is a MVP and still needs some more work.

Pinging @q66 @the-maldridge 

A patch file from https://github.com/void-linux/void-packages/pull/24357.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-noarch-24357.patch --]
[-- Type: text/x-diff, Size: 9802 bytes --]

From 44a3b458c354af787eab3d11cf829e32f4d53fa4 Mon Sep 17 00:00:00 2001
From: fosslinux <fosslinux@aussies.space>
Date: Wed, 19 Aug 2020 16:44:41 +1000
Subject: [PATCH 1/2] common: disable creation of noarch packages.

---
 common/hooks/do-pkg/00-gen-pkg.sh                    |  6 ++----
 common/hooks/post-install/06-strip-and-debug-pkgs.sh |  2 +-
 common/hooks/post-pkg/00-register-pkg.sh             |  6 ++----
 common/hooks/pre-pkg/04-generate-runtime-deps.sh     |  2 +-
 common/hooks/pre-pkg/05-prepare-32bit.sh             | 11 -----------
 common/hooks/pre-pkg/06-shlib-provides.sh            |  2 +-
 common/xbps-src/shutils/common.sh                    |  8 +-------
 common/xbps-src/shutils/pkgtarget.sh                 |  2 +-
 8 files changed, 9 insertions(+), 30 deletions(-)

diff --git a/common/hooks/do-pkg/00-gen-pkg.sh b/common/hooks/do-pkg/00-gen-pkg.sh
index b809a6dc5eb..f0b70c8eebb 100644
--- a/common/hooks/do-pkg/00-gen-pkg.sh
+++ b/common/hooks/do-pkg/00-gen-pkg.sh
@@ -104,14 +104,12 @@ hook() {
 	local arch= binpkg= repo= _pkgver= _desc= _pkgn= _pkgv= _provides= \
 		_replaces= _reverts= f= found_dbg_subpkg=
 
-	if [ "${archs// /}" = "noarch" ]; then
-		arch=noarch
-	elif [ -n "$XBPS_TARGET_MACHINE" ]; then
+	if [ -n "$XBPS_TARGET_MACHINE" ]; then
 		arch=$XBPS_TARGET_MACHINE
 	else
 		arch=$XBPS_MACHINE
 	fi
-	if [ "${archs// /}" != "noarch" -a -z "$XBPS_CROSS_BUILD" -a -n "$XBPS_ARCH" -a "$XBPS_ARCH" != "$XBPS_TARGET_MACHINE" ]; then
+	if [ -z "$XBPS_CROSS_BUILD" -a -n "$XBPS_ARCH" -a "$XBPS_ARCH" != "$XBPS_TARGET_MACHINE" ]; then
 		arch=${XBPS_ARCH}
 	fi
 
diff --git a/common/hooks/post-install/06-strip-and-debug-pkgs.sh b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
index 44d8a51fe93..b59dde5ab3c 100644
--- a/common/hooks/post-install/06-strip-and-debug-pkgs.sh
+++ b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
@@ -59,7 +59,7 @@ create_debug_pkg() {
 hook() {
 	local fname= x= f= _soname= STRIPCMD=
 
-	if [ -n "$nostrip" -o "${archs// /}" = "noarch" ]; then
+	if [ -n "$nostrip" ]; then
 		return 0
 	fi
 
diff --git a/common/hooks/post-pkg/00-register-pkg.sh b/common/hooks/post-pkg/00-register-pkg.sh
index 5dc28c999c9..ce641cfc850 100644
--- a/common/hooks/post-pkg/00-register-pkg.sh
+++ b/common/hooks/post-pkg/00-register-pkg.sh
@@ -13,14 +13,12 @@ registerpkg() {
 hook() {
 	local arch= binpkg= pkgdir=
 
-	if [ "${archs// /}" = "noarch" ]; then
-		arch=noarch
-	elif [ -n "$XBPS_TARGET_MACHINE" ]; then
+	if [ -n "$XBPS_TARGET_MACHINE" ]; then
 		arch=$XBPS_TARGET_MACHINE
 	else
 		arch=$XBPS_MACHINE
 	fi
-	if [ "${archs// /}" != "noarch" -a -z "$XBPS_CROSS_BUILD" -a -n "$XBPS_ARCH" -a "$XBPS_ARCH" != "$XBPS_TARGET_MACHINE" ]; then
+	if [ -z "$XBPS_CROSS_BUILD" -a -n "$XBPS_ARCH" -a "$XBPS_ARCH" != "$XBPS_TARGET_MACHINE" ]; then
 		arch=${XBPS_ARCH}
 	fi
 	if [ -n "$repository" ]; then
diff --git a/common/hooks/pre-pkg/04-generate-runtime-deps.sh b/common/hooks/pre-pkg/04-generate-runtime-deps.sh
index 6e45b7dd3c3..8ffd3a71d8e 100644
--- a/common/hooks/pre-pkg/04-generate-runtime-deps.sh
+++ b/common/hooks/pre-pkg/04-generate-runtime-deps.sh
@@ -56,7 +56,7 @@ hook() {
 
     mapshlibs=$XBPS_COMMONDIR/shlibs
 
-    if [ "${archs// /}" = "noarch" -o -n "$noverifyrdeps" ]; then
+    if [ -n "$noverifyrdeps" ]; then
         store_pkgdestdir_rundeps
         return 0
     fi
diff --git a/common/hooks/pre-pkg/05-prepare-32bit.sh b/common/hooks/pre-pkg/05-prepare-32bit.sh
index fd6fdf88217..f3612959cb5 100644
--- a/common/hooks/pre-pkg/05-prepare-32bit.sh
+++ b/common/hooks/pre-pkg/05-prepare-32bit.sh
@@ -20,10 +20,6 @@ hook() {
 	if [ "$XBPS_TARGET_MACHINE" != "i686" ]; then
 		return
 	fi 
-	# Ignore noarch pkgs.
-	if [ "${archs// /}" = "noarch" ]; then
-		return
-	fi
 	if [ -z "$lib32mode" ]; then
 		# Library mode, copy only relevant files to new destdir.
 		#
@@ -106,13 +102,6 @@ hook() {
 				printf "${pkgn}-32bit${pkgv} " >> ${destdir32}/rdeps
 				continue
 			fi
-			# If dependency is noarch do not change it to 32bit.
-			_arch=$($XBPS_QUERY_CMD -R --property=architecture "$f")
-			if [ "${_arch}" = "noarch" ]; then
-				echo "   RDEP: $f -> ${pkgn}${pkgv} (noarch)"
-				printf "${pkgn}${pkgv} " >> ${destdir32}/rdeps
-				continue
-			fi
 			# If dependency does not have "shlib-provides" do not
 			# change it to 32bit.
 			for x in ${subpackages}; do
diff --git a/common/hooks/pre-pkg/06-shlib-provides.sh b/common/hooks/pre-pkg/06-shlib-provides.sh
index cdc94de3bc9..fc39f6bfbe4 100644
--- a/common/hooks/pre-pkg/06-shlib-provides.sh
+++ b/common/hooks/pre-pkg/06-shlib-provides.sh
@@ -45,7 +45,7 @@ collect_sonames() {
 hook() {
 	local _destdir32=${XBPS_DESTDIR}/${pkgname}-32bit-${version}
 
-	if [ -z "$shlib_provides" -a "${archs// /}" = "noarch" -o -n "$noshlibprovides" ]; then
+	if [ -n "$noshlibprovides" ]; then
 		return 0
 	fi
 
diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh
index e8bcf577c6b..1564a174bf2 100644
--- a/common/xbps-src/shutils/common.sh
+++ b/common/xbps-src/shutils/common.sh
@@ -395,7 +395,6 @@ setup_pkg() {
         source_file ${XBPS_SRCPKGDIR}/${basepkg}/template
     fi
 
-
     # Check if required vars weren't set.
     _vars="pkgname version short_desc revision homepage license"
     for f in ${_vars}; do
@@ -457,12 +456,7 @@ setup_pkg() {
     fi
     makejobs="-j$XBPS_MAKEJOBS"
 
-    # strip whitespaces to make "  noarch  " valid too.
-    if [ "${archs// /}" = "noarch" ]; then
-        arch="noarch"
-    else
-        arch="$XBPS_TARGET_MACHINE"
-    fi
+    arch="$XBPS_TARGET_MACHINE"
     if [ -n "$XBPS_BINPKG_EXISTS" ]; then
         local _binpkgver="$($XBPS_QUERY_XCMD -R -ppkgver $pkgver 2>/dev/null)"
         if [ "$_binpkgver" = "$pkgver" ]; then
diff --git a/common/xbps-src/shutils/pkgtarget.sh b/common/xbps-src/shutils/pkgtarget.sh
index 090ec5c1a3e..fa70816fe24 100644
--- a/common/xbps-src/shutils/pkgtarget.sh
+++ b/common/xbps-src/shutils/pkgtarget.sh
@@ -3,7 +3,7 @@
 check_pkg_arch() {
     local cross="$1" _arch f match nonegation
 
-    if [ -n "$archs" -a "${archs// /}" != "noarch" ]; then
+    if [ -n "$archs" ]; then
         if [ -n "$cross" ]; then
             _arch="$XBPS_TARGET_MACHINE"
         elif [ -n "$XBPS_ARCH" ]; then

From 7101668773f6d5202863af4522a77ca8fdb78881 Mon Sep 17 00:00:00 2001
From: fosslinux <fosslinux@aussies.space>
Date: Thu, 27 Aug 2020 17:17:50 +1000
Subject: [PATCH 2/2] Manual.md: remove mentions of noarch.

---
 Manual.md | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/Manual.md b/Manual.md
index 5502c6e26f8..af5f4019bc3 100644
--- a/Manual.md
+++ b/Manual.md
@@ -711,8 +711,7 @@ used.
 - `fetch_cmd` Executable to be used to fetch URLs in `distfiles` during the `do_fetch` phase.
 
 - `archs` Whitespace separated list of architectures that a package can be
-built for, available architectures can be found under `common/cross-profiles`
-alongside the `noarch` value for packages that do not contain any machine code.
+built for, available architectures can be found under `common/cross-profiles`.
 In general, `archs` should only be set if the upstream software explicitly targets
 certain architectures or there is a compelling reason why the software should not be
 available on some supported architectures.
@@ -725,8 +724,6 @@ Examples:
 	archs="x86_64-musl ~*-musl"
 	# Default value (all arches)
 	archs="*"
-	# Packages that do not depend on architecture-specific objects
-	archs=noarch
 	```
 
 <a id="explain_depends"></a>
@@ -914,8 +911,8 @@ can be used to pass arguments during compilation. If your package does not make
 extensions consider using the `gem` build style instead.
 
 - `gem` For packages that are installed using gems from [RubyGems](https://rubygems.org/).
-The gem command can be overridden by `gem_cmd`. `archs` is set to `noarch` unconditionally
-and `distfiles` is set by the build style if the template does not do so. If your gem
+The gem command can be overridden by `gem_cmd`. 
+`distfiles` is set by the build style if the template does not do so. If your gem
 provides extensions which must be compiled consider using the `gemspec` build style instead.
 
 - `ruby-module` For packages that are ruby modules and are installable via `ruby install.rb`.
@@ -1413,6 +1410,10 @@ destdir (`$DESTDIR`) to the `subpackage` destdir (`$PKGDESTDIR`).
 Subpackages are processed always in alphabetical order; To force a custom order,
 the `subpackages` variable can be declared with the wanted order.
 
+Please note that XBPS makes no distinction between normal packages, and data
+packages. Data packages, documentation packages and binary packages are all
+treated the same way.
+
 <a id="pkgs_development"></a>
 ### Development packages
 
@@ -1451,7 +1452,7 @@ type used to split architecture independent, big(ger) or huge amounts
 of data from a package's main and architecture dependent part. It is up
 to you to decide, if a `-data` subpackage makes sense for your package.
 This type is common for games (graphics, sound and music), part libraries (CAD)
-or card material (maps). Data subpackages are almost always `archs=noarch`.
+or card material (maps).
 The main package must then have `depends="${pkgname}-data-${version}_${revision}"`,
 possibly in addition to other, non-automatic depends.
 
@@ -1589,7 +1590,6 @@ The following variables influence how Haskell packages are built:
 Font packages are very straightforward to write, they are always set with the
 following variables:
 
-- `archs=noarch`: Font packages don't install arch specific files.
 - `depends="font-util"`: because they are required for regenerating the font
 cache during the install/removal of the package
 - `font_dirs`: which should be set to the directory where the package

  parent reply	other threads:[~2020-09-04 23:19 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-19  6:51 [PR PATCH] " fosslinux
2020-08-19 12:23 ` ericonr
2020-08-19 12:38 ` ahesford
2020-08-19 12:46 ` ahesford
2020-08-19 13:03 ` Chocimier
2020-08-19 14:48 ` q66
2020-08-19 15:24 ` ahesford
2020-08-19 15:43 ` q66
2020-08-19 15:45 ` q66
2020-08-19 16:10 ` ahesford
2020-08-19 17:15 ` q66
2020-08-19 17:17 ` ericonr
2020-08-19 17:19 ` q66
2020-08-19 23:05 ` fosslinux
2020-08-19 23:10 ` fosslinux
2020-08-19 23:21 ` the-maldridge
2020-08-19 23:28 ` fosslinux
2020-08-19 23:30 ` the-maldridge
2020-08-20  0:24 ` q66
2020-08-20  0:38 ` fosslinux
2020-08-20  0:44 ` sgn
2020-08-20  0:44 ` sgn
2020-08-20  0:46 ` ericonr
2020-08-20  0:51 ` sgn
2020-08-20  0:56 ` fosslinux
2020-08-20  1:00 ` ahesford
2020-08-20  1:08 ` ericonr
2020-08-20  2:05 ` the-maldridge
2020-08-20  6:29 ` fosslinux
2020-08-20  6:32 ` fosslinux
2020-08-20 12:52 ` ericonr
2020-08-20 17:55 ` the-maldridge
2020-08-20 23:09 ` fosslinux
2020-08-21 22:26 ` [PR PATCH] [Updated] " fosslinux
2020-08-21 22:27 ` fosslinux
2020-08-21 22:29 ` [PR PATCH] [Updated] " fosslinux
2020-08-21 22:29 ` fosslinux
2020-08-24 23:49 ` fosslinux
2020-08-24 23:50 ` fosslinux
2020-08-24 23:50 ` fosslinux
2020-08-25 19:47 ` [PR REVIEW] " Chocimier
2020-08-25 19:49 ` Chocimier
2020-08-25 20:02 ` ericonr
2020-08-25 20:19 ` [PR REVIEW] " Chocimier
2020-08-25 22:55 ` fosslinux
2020-08-25 22:58 ` fosslinux
2020-08-27  7:22 ` [PR PATCH] [Updated] " fosslinux
2020-08-27  7:22 ` fosslinux
2020-08-27  7:23 ` fosslinux
2020-08-27 20:21 ` [PR REVIEW] " Chocimier
2020-08-27 20:28 ` Chocimier
2020-08-28  0:41 ` [PR REVIEW] " fosslinux
2020-08-28  0:43 ` fosslinux
2020-08-28  0:45 ` sgn
2020-08-28  1:07 ` fosslinux
2020-09-02  0:40 ` fosslinux
2020-09-02  0:40 ` fosslinux
2020-09-02  0:40 ` [PR REVIEW] " fosslinux
2020-09-03 23:47 ` fosslinux
2020-09-04 11:41 ` fosslinux
2020-09-04 11:44 ` fosslinux
2020-09-04 13:24 ` ahesford
2020-09-04 22:59 ` fosslinux
2020-09-04 23:17 ` fosslinux
2020-09-04 23:19 ` fosslinux [this message]
2020-09-04 23:19 ` [PR REVIEW] " fosslinux
2020-09-05  7:00 ` Chocimier
2020-09-05  7:16 ` fosslinux
2020-10-31  6:49 ` fosslinux
2020-10-31  6:49 ` fosslinux
2020-10-31  6:49 ` fosslinux
2020-10-31  6:49 ` fosslinux
2020-11-30 14:57 ` sgn
2020-11-30 16:37 ` sgn
2020-12-01 12:47 ` sgn
2020-12-05 10:17 ` sgn
2020-12-05 10:17 ` sgn
2020-12-15 11:26 ` fosslinux
2020-12-26  2:47 ` sgn
2020-12-26  2:48 ` sgn
2020-12-26  2:48 ` sgn
2020-12-26  2:48 ` sgn
2020-12-26  6:34 ` sgn
2020-12-26  6:42 ` sgn
2020-12-26 11:04 ` sgn
2020-12-26 11:04 ` sgn
2020-12-27 14:31 ` sgn
2021-01-20 12:34 ` [PR PATCH] [Closed]: " q66
2021-01-20 21:47 ` fosslinux

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200904231900.wSTRfkDb0_MS8feCUslpbQ82i0-4FNuD5pur27Op-SI@z \
    --to=fosslinux@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).