New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #12306 (new defect)

Opened 6 years ago

Last modified 3 months ago

BUG: "variant foo bar { ... }" constructs fail at package archival time

Reported by: jmpp@… Owned by: jmpp@…
Priority: High Milestone: MacPorts Future
Component: base Version: 1.5.0
Keywords: Cc: egall@…
Port:

Description

Listing two variant names in a single line in order to define a common code block for both causes the archival stage to fail:

archiving port+foo bar.<platform>.<archiveformat>
bar.<platform>.<archiveformat>: no such file or directory

Archive creation code is failing to add the second variant to the archive file name and adding a space instead, causing a no such file or directory error. We should either fix this or refuse such constructs, in view of the variant descriptions feature introduced recently (don't know if two variants on a single line plays well with variant descriptions, haven't checked).

-jmpp

Change History

comment:1 Changed 6 years ago by jmpp@…

  • Priority changed from Expected to Important
  • severity changed from Normal to Serious

It seems like this is a serious bug, installing ports with this variant constructs apparently messes up the registry:

$[juan @macbookpro: base](97/0 0,1) -> port installed
Error: port installed failed: Registry error: cyrus-sasl2 @1.0.4_1 not registered as installed.
No ports are installed.

$[juan @macbookpro: cyrus-sasl2](294/0,0) -> pwd
/usr/local/src/macosforge/macports/trunk/dports/security/cyrus-sasl2

$[juan @macbookpro: cyrus-sasl2](295/0,0) -> sudo port -d uninstall
DEBUG: Changing to port directory: /usr/local/src/macosforge/macports/trunk/dports/security/cyrus-sasl2
DEBUG: Requested variant kerberos is not provided by port cyrus-sasl2.
DEBUG: Requested variant darwin is not provided by port cyrus-sasl2.
DEBUG: Requested variant i386 is not provided by port cyrus-sasl2.
DEBUG: Requested variant macosx is not provided by port cyrus-sasl2.
DEBUG: Executing variant kerberos-darwin provides kerberos darwin
DEBUG: can't read "revision": no such variable
    while executing
"lappend plist $revision"
    (procedure "receipt_flat::installed" line 28)
    invoked from within
"${macports::registry.format}::installed $name $version"
    (procedure "registry::installed" line 4)
    invoked from within
"registry::installed $portname $v"
    (procedure "portuninstall::uninstall" line 5)
    invoked from within
"portuninstall::uninstall $portname [composite_version $portversion [array get variations]] [array get options]"
Error: port uninstall failed: can't read "revision": no such variable

This when attempting a port installation off the old Portfile. But I also cancelled a port call somewhere along the line (don't recall if it was a destooring or an installation) so my registry might have broken because of that too. In any case, bumping this bug up to higher priority/severity just in case.

-jmpp

comment:2 Changed 6 years ago by jmpp@…

Some investigation reveals MacPorts chokes when spaces are inserted in the receipts directory:

$[juan @macbookpro: cyrus-sasl2](337/0,0) -> sudo rm -rf /opt/local/var/macports/receipts/cyrus-sasl2

$[juan @macbookpro: cyrus-sasl2](338/0,0) -> port installed
The following ports are currently installed:
  apr @1.2.8_0 (active)
  apr-util @1.2.8_2+no_bdb+no_sqlite (active)
  autoconf @2.61_0 (active)
  bash-completion @20060301_0 (active)

 ---snip---

$[juan @macbookpro: cyrus-sasl2](343/1,0) -> sudo mkdir -p /opt/local/var/macports/receipts/foo/1\+foo\ bar

$[juan @macbookpro: cyrus-sasl2](345/0,0) -> ls /opt/local/var/macports/receipts/foo/
total 0
drwxr-xr-x   2 root  admin  68B Jul 16 15:33 1+foo bar/

$[juan @macbookpro: cyrus-sasl2](346/0,0) -> port installed
Error: port installed failed: Registry error: foo @2.0.1_0 not registered as installed.
No ports are installed.

$[juan @macbookpro: cyrus-sasl2](347/1,0) -> sudo rm -rf /opt/local/var/macports/receipts/foo 

$[juan @macbookpro: cyrus-sasl2](348/0,0) -> port installed
The following ports are currently installed:
  apr @1.2.8_0 (active)
  apr-util @1.2.8_2+no_bdb+no_sqlite (active)

---snip---

The installed command does not escape the space and returns with a foo @1+foo string, which is naturally not recorded as installed (the full string should have been "foo @1+foo+bar", supressing the space). My mistake to have used foo for both the example port and variant names, but that's orthogonal. In any case, the bug seems to be in full installation name construction (portname plus version plus revision plus all variants), which is either not escaping the space too or not supressing it in the first place, as I believe it should be done (was it like that before this bug cropped up?).

-jmpp

comment:3 Changed 6 years ago by jmpp@…

  • Milestone changed from Needs developer review to MacPorts base bugs

Milestone Needs developer review deleted

comment:4 Changed 6 years ago by nox@…

  • Priority changed from Important to High
  • Summary changed from "variant foo bar { ... }" constructs fail at package archival time to BUG: "variant foo bar { ... }" constructs fail at package archival time

comment:5 Changed 5 years ago by toby@…

  • Milestone changed from MacPorts base bugs to MacPorts Future

Milestone MacPorts base bugs deleted

comment:6 follow-up: ↓ 8 Changed 3 months ago by egall@…

Does this still happen? Base has changed since this ticket was opened...

comment:7 Changed 3 months ago by egall@…

  • Cc egall@… added

Cc Me!

comment:8 in reply to: ↑ 6 Changed 3 months ago by larryv@…

  • Cc jmpp@… removed
  • Keywords archivemode, double variants removed

Replying to egall@…:

Does this still happen? Base has changed since this ticket was opened...

The Guide doesn’t even suggest variant foo bar as a valid portfile construct, although base still allows it. Do any portfiles even do this?

Note: See TracTickets for help on using tickets.