#11296 closed defect (fixed)
BUG: "upgrade" action sometimes evaluates a variant twice -ex: bzip2
Reported by: | mas@… | Owned by: | macports-tickets@… |
---|---|---|---|
Priority: | High | Milestone: | MacPorts 1.4 |
Component: | base | Version: | 1.3.2 |
Keywords: | archivers | Cc: | mas@…, ryandesign (Ryan Carsten Schmidt) |
Port: |
Description (last modified by jmpalacios (Juan Manuel Palacios))
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
Attachments (1)
Change History (14)
comment:1 Changed 18 years ago by mas@…
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 Changed 18 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 18 years ago by mas@…
Component: | ports → base |
---|---|
Priority: | Blocker → Nice to have |
Resolution: | fixed |
severity: | Serious → Performance |
Status: | closed → reopened |
Summary: | BUG: bzip2 1.0.4 fails to install → BUG: 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 18 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 18 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 18 years ago by pipping@…
Milestone: | → Port Bugs |
---|
comment:6 Changed 18 years ago by jmpalacios (Juan Manuel Palacios)
Description: | modified (diff) |
---|
comment:7 Changed 18 years ago by jmpalacios (Juan Manuel Palacios)
Milestone: | Port Bugs → Needs developer review |
---|---|
Priority: | Nice to have → Important |
severity: | Performance → Normal |
Summary: | BUG: port sometimes evaluates a variant twice (was: bzip2 1.0.4 fails to install) → "upgrade" action sometimes evaluates a variant twice |
Wouldn't be surprised if this indeed is a bug in the upgrade code, therefore setting the ticket to "Needs developer review" so that everyone can easily find it and discuss it.
-jmpp
comment:8 Changed 18 years ago by markd@…
Summary: | "upgrade" action sometimes evaluates a variant twice → BUG: "upgrade" action sometimes evaluates a variant twice -ex: bzip2 |
---|
comment:9 Changed 18 years ago by kballard (Lily Ballard)
You're right, upgrade does evaluate twice. Here's the log for upgrading a fake port foo123:
evaluating variant +foo ---> Fetching foo123 ---> Verifying checksum(s) for foo123 ---> Extracting foo123 ---> Configuring foo123 ---> Building foo123 with target all ---> Staging foo123 into destroot ---> Deactivating foo123 2.0_0+foo ---> Uninstalling foo123 2.0_0+foo evaluating variant +foo ---> Installing foo123 2.0_0+foo ---> Activating foo123 2.0_0+foo ---> Cleaning foo123
comment:10 Changed 18 years ago by kballard (Lily Ballard)
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Fixed in r25033
comment:11 Changed 18 years ago by jmpalacios (Juan Manuel Palacios)
Milestone: | Needs developer review → MacPorts 1.4 |
---|
comment:12 Changed 17 years ago by nox@…
Cc: | mas@… ryandesign@… added; mas@… removed |
---|---|
Priority: | Important → High |
comment:13 Changed 17 years ago by jmpalacios (Juan Manuel Palacios)
Merged into the release_1_4 branch in r25263.
-jmpp
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.)