[arch-haskell] Re: [extra] haskell-parallel

Nicolas Pouillard nicolas.pouillard at gmail.com
Sat Oct 12 07:37:38 UTC 2013


On Thu, Nov 11, 2010 at 5:59 PM, Peter Hercek <phercek at gmail.com> wrote:
> On 11/11/2010 05:44 PM, Magnus Therning wrote:
>>
>> On Thu, Nov 11, 2010 at 16:41, Peter Hercek<phercek at gmail.com>  wrote:
>>>
>>> On 11/11/2010 05:16 PM, Magnus Therning wrote:
>>>>
>>>> Source
>>>>
>>>> The burden falls on the user to make sure that his system is sane.
>>>> Unfortunately it's rather simple to end up in a situation where this
>>>> isn't the case.  However, this is already true!
>>>> Here's an example:
>>>>
>>>> 1. User installs haskell-platform, and gets haskell-hp-http 4000.0.9
>>>> (which provides haskell-http 4000.0.9)
>>>> 2. User installs haskell-pandoc from AUR, it's built against HTTP
>>>> 4000.0.9
>>>> 3. User now installs haskell-http 4000.0.10 from AUR
>>>> 4. User now removes haskell-hp-http, without removing/re-installing
>>>> haskell-pandoc
>>>>
>>>> Step four is possible, since all the dependencies of haskell-pandoc
>>>> are satisfied by the system (haskell-http>= 4000.0.5).
>>>
>>> Hmm, what we would need is so that when haskell-pandoc is being built
>>> it's
>>> PKGFILE is updated so that it requires haskell-http 4000.0.9 exactly.
>>> Then
>>> an attempt to uninstall haskell-hp-http later would require an
>>> uninstallation of haskell-pandoc too.
>>>
>>> Can pacman be forced to do this? We would need something like a new
>>> option
>>> in PKGFILE which would have meaning: "fix versions of dependencies of
>>> these
>>> packages exactly to the versions which are currently installed (installed
>>> during building)."
>>
>> Just for reference, this is basically what the Debian policy on
>> Haskell packages is.
>>
> Good policy, if they can have it automated. If pacman (or I should rather
> say makepkg) has such a option then great. If not we should check whether we
> can add it there. We want the final exact version for dependency to be fixed
> during build time. The PKGBUILD files need to contain the version ranges as
> the cabal files.
>
> If we cannot have this late version fix during makepkg then I say just let
> it be as it is. If a user wants to go into the troubles with the source
> packages then he/she should be able to take care about knowing and obeying
> the haskell quirks.
>
> Well maybe we could try to provide a small wraper over makepkg (something
> like haskell-makepkg) which should be used for haskell source packages ...
> if we cannot get this fixed in the makepkg itself.

A few weeks I hacked makepkg to add this very feature, I didn't took
time to test
it exhaustively nor to propose it to the authors.

As an attachment here is a diff against the makepkg found in pacman-3.4.1-1,
it adds the --freeze-deps flag that change the package versions to be exactly
the one on the build system.

I would be glad to see this feature used here, and then proposed to the authors
on the behalf of the Arch-Haskell team.

Best regards,

-- 
Nicolas Pouillard
http://nicolaspouillard.fr
-------------- next part --------------
--- /usr/bin/makepkg	2010-09-04 03:12:11.000000000 +0200
+++ makepkg-np	2010-10-22 10:39:44.000000000 +0200
@@ -58,6 +58,7 @@
 DEP_BIN=0
 FORCE=0
 INFAKEROOT=0
+FREEZEDEPS=0
 GENINTEG=0
 SKIPINTEG=0
 INSTALL=0
@@ -370,7 +371,7 @@
 run_pacman() {
 	local cmd
 	printf -v cmd "%q " "$PACMAN" $PACMAN_OPTS "$@"
-	if (( ! ASROOT )) && [[ $1 != "-T" && $1 != "-Qq" ]]; then
+	if (( ! ASROOT )) && [[ $1 != "-T" && $1 != "-Q" && $1 != "-Qq" ]]; then
 		if [ "$(type -p sudo)" ]; then
 			cmd="sudo $cmd"
 		else
@@ -933,9 +934,15 @@
 	for it in "${groups[@]}"; do
 		echo "group = $it" >>.PKGINFO
 	done
-	for it in "${depends[@]}"; do
-		echo "depend = $it" >>.PKGINFO
-	done
+	if (( FREEZEDEPS )); then
+		for it in "${depends[@]}"; do
+		  echo "depend = $(run_pacman -Q "$it" | sed -e's/ /==/')" >>.PKGINFO
+		done
+	else
+		for it in "${depends[@]}"; do
+			echo "depend = $it" >>.PKGINFO
+		done
+	fi
 	for it in "${optdepends[@]}"; do
 		echo "optdepend = $it" >>.PKGINFO
 	done
@@ -1510,6 +1517,7 @@
 	echo "$(gettext "  --asroot         Allow makepkg to run as root user")"
 	printf "$(gettext "  --config <file>  Use an alternate config file (instead of '%s')")\n" "$confdir/makepkg.conf"
 	echo "$(gettext "  --holdver        Prevent automatic version bumping for development PKGBUILDs")"
+	echo "$(gettext "  --freeze-deps    Use the exact current version of dependencies when packaging")"
 	echo "$(gettext "  --pkg <list>     Only build listed packages from a split package")"
 	echo "$(gettext "  --skipinteg      Do not fail when integrity checks are missing")"
 	echo "$(gettext "  --source         Generate a source-only tarball without downloaded sources")"
@@ -1546,7 +1554,7 @@
 # Parse Command Line Options.
 OPT_SHORT="AcCdefFghiLmop:rRsV"
 OPT_LONG="allsource,asroot,ignorearch,clean,cleancache,nodeps"
-OPT_LONG="$OPT_LONG,noextract,force,forcever:,geninteg,help,holdver"
+OPT_LONG="$OPT_LONG,noextract,force,forcever:,freeze-deps,geninteg,help,holdver"
 OPT_LONG="$OPT_LONG,install,log,nocolor,nobuild,pkg:,rmdeps,repackage,skipinteg"
 OPT_LONG="$OPT_LONG,source,syncdeps,version,config:"
 # Pacman Options
@@ -1578,6 +1586,7 @@
 		#hidden opt used by fakeroot call for svn/cvs/etc PKGBUILDs to set pkgver
 		--forcever)       shift; FORCE_VER=$1;;
 		-F)               INFAKEROOT=1 ;;
+		--freeze-deps)    FREEZEDEPS=1 ;;
 		-g|--geninteg)    GENINTEG=1 ;;
 		--holdver)        HOLDVER=1 ;;
 		-i|--install)     INSTALL=1 ;;


More information about the arch-haskell mailing list