Opened 17 years ago

Last modified 17 years ago

#11296 closed defect

BUG: port sometimes evaluates a variant twice (was: bzip2 1.0.4 fails to install) — at Version 6

Reported by: mas@… Owned by: macports-tickets@…
Priority: High Milestone: MacPorts 1.4
Component: base Version: 1.3.2
Keywords: archivers Cc: mas@… ryandesign@…
Port:

Description (last modified by jmpp@…)

It looks as if the patch files provided are wrong?

port install bzip2 fails with these messages. This means that, currently, I cannot install bzip2 using MacPorts. :-(

$ sudo port install bzip2   
--->  Fetching bzip2
--->  Attempting to fetch bzip2-1.0.4.tar.gz from http://www.bzip.org/1.0.4/
--->  Verifying checksum(s) for bzip2
--->  Extracting bzip2
--->  Applying patches to bzip2
Error: Target com.apple.patch returned: shell command "cd "/opt/local/var/db/dports/build/_opt_local_var_db_dports_sources_rsync.rsync.darwinports.org_dpupdate_dports_archivers_bzip2/work/bzip2-1.0.4" && patch -p0 < "/opt/local/var/db/dports/sources/rsync.rsync.darwinports.org_dpupdate_dports/archivers/bzip2/files/patch-Makefile-dylib.diff"" returned error 1
Command output: patching file Makefile
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
4 out of 4 hunks ignored -- saving rejects to file Makefile.rej

Change History (7)

comment:1 Changed 17 years ago by mas@…

Resolution: fixed
Status: newclosed

The previous version of the bzip2 port for 1.0.4 apparently failed to update the patch files. I wonder if the updated port compiled for you?

I have provided an updated patch file to create the dynamic library libbz2.1.0.4.dylib.

I am committing this immediately since not having a working bzip2 port is a major pain. :)

(Fixed in r21525 and r21526.)

comment:2 Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)

I am not able to understand why people have been having problems with bzip2 since I updated to 1.0.4. I am unable to reproduce the problems of the patchfiles failing:

$ sudo port -dvc install bzip2
DEBUG: Found port in file:///Users/rschmidt/macports/dports/archivers/bzip2
DEBUG: Changing to port directory: /Users/rschmidt/macports/dports/archivers/bzip2
DEBUG: Requested variant powerpc is not provided by port bzip2.
DEBUG: Requested variant macosx is not provided by port bzip2.
DEBUG: Executing variant darwin provides darwin
DEBUG: Skipping completed com.apple.main (bzip2)
--->  Fetching bzip2
DEBUG: Executing com.apple.fetch (bzip2)
--->  Verifying checksum(s) for bzip2
DEBUG: Executing com.apple.checksum (bzip2)
--->  Checksumming bzip2-1.0.4.tar.gz
DEBUG: Correct (md5) checksum for bzip2-1.0.4.tar.gz
DEBUG: Correct (sha1) checksum for bzip2-1.0.4.tar.gz
DEBUG: Correct (rmd160) checksum for bzip2-1.0.4.tar.gz
--->  Extracting bzip2
DEBUG: Executing com.apple.extract (bzip2)
--->  Extracting bzip2-1.0.4.tar.gz
DEBUG: setting option extract.args to /opt/local/var/db/dports/distfiles/bzip2/bzip2-1.0.4.tar.gz
DEBUG: Assembled command: 'cd "/opt/local/var/db/dports/build/_Users_rschmidt_macports_dports_archivers_bzip2/work" && gzip -dc /opt/local/var/db/dports/distfiles/bzip2/bzip2-1.0.4.tar.gz | /usr/bin/gnutar --no-same-owner -xf -'
DEBUG: Executing com.apple.patch (bzip2)
--->  Applying patches to bzip2
--->  Applying /Users/rschmidt/macports/dports/archivers/bzip2/files/patch-Makefile-man.diff
DEBUG: Assembled command: 'cd "/opt/local/var/db/dports/build/_Users_rschmidt_macports_dports_archivers_bzip2/work/bzip2-1.0.4" && patch -p0'
patching file Makefile
Hunk #1 succeeded at 72 (offset 12 lines).
Hunk #2 succeeded at 83 (offset 12 lines).
Hunk #3 succeeded at 99 with fuzz 2 (offset 12 lines).
--->  Applying /Users/rschmidt/macports/dports/archivers/bzip2/files/patch-Makefile-dylib.diff
DEBUG: Assembled command: 'cd "/opt/local/var/db/dports/build/_Users_rschmidt_macports_dports_archivers_bzip2/work/bzip2-1.0.4" && patch -p0'
patching file Makefile
Hunk #1 succeeded at 35 (offset 12 lines).
Hunk #2 succeeded at 52 (offset 12 lines).
Hunk #3 succeeded at 98 with fuzz 2 (offset 12 lines).
Hunk #4 succeeded at 123 with fuzz 2 (offset 11 lines).
--->  Configuring bzip2
[snip]

Can you suggest any reason why the patchfiles were failing for you (and indeed for others) but not for me?

Admittedly, when I upgraded to 1.0.4, I neglected to notice that bug #11272 had been submitted which includes updated patchfiles. I have not yet evaluated those patchfiles. I still intend to do so, and I will then also evaluate the changes you just committed.

comment:3 Changed 17 years ago by mas@…

Component: portsbase
Priority: BlockerNice to have
Resolution: fixed
severity: SeriousPerformance
Status: closedreopened
Summary: BUG: bzip2 1.0.4 fails to installBUG: port sometimes evaluates a variant twice (was: bzip2 1.0.4 fails to install)

Can you suggest any reason why the patchfiles were failing for you (and indeed for others) but not for me?

No, sorry. But let's see.

The reason is apparently not the aged patch file, as I had previously assumed, but rather the way it is being applied.

Both our commits work with port install bzip2, but not with port upgrade bzip2. The latter one tries to apply patch-Makefile-dylib.diff twice. Apparently, this is because patch-Makefile-dylib.diff is invoked from within a variant darwin. (patch-Makefile-man.diff works because it is outside the variant.) port upgrade bzip2 seems to evaluate variant darwin twice, while port install bzip2 evaluates the variant only once.

I am committing a Portfile (r21528) that works for both install and upgrade. However, this one eliminates the option of using the same Portfile on both Darwin and SunOS. :-(

The real fix would be for port to evaluate the variant darwin commands just once no matter if port upgrade or port install is being used. I have no idea why port should behave like this (sometimes evaluating a variant twice) in the first place.

I am reopening the ticket but changing the summary to reflect where I think the real problem is.

Changed 17 years ago by mas@…

Attachment: patch-previous.log added

This illustrates the problem: Portfile http://trac.macports.org/projects/macports/browser/trunk/dports/archivers/bzip2/Portfile?rev=21525 has a patch being applied twice with "port upgrade", but not with "port install".

comment:4 Changed 17 years ago by pipping@…

I'm personally in favour of downgrading to 1.0.3 for now. 1.0.3 worked perfectly and 1.0.4 is a mess right now.

comment:5 Changed 17 years ago by pipping@…

Milestone: Port Bugs

comment:6 Changed 17 years ago by jmpp@…

Description: modified (diff)
Note: See TracTickets for help on using tickets.