Opened 10 years ago

Closed 9 years ago

#44418 closed defect (fixed)

p5-sgmlspm: fix installation

Reported by: mojca (Mojca Miklavec) Owned by: lockhart (Thomas Lockhart)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: ryandesign (Ryan Carsten Schmidt)
Port: p5-sgmlspm

Description

The port p5-sgmlspm needs to be fixed. When Perl isn't installed yet (as it happens on the buildbot), the installation doesn't proceed properly. One of the reasons might be that perl5.lib isn't defined yet when Perl is not installed, but the package might need some major changes anyway (Makefiles of perl modules shouldn't need to be patched in the way that is required in this package).

> sudo port -f deactivate perl5.16
[...]
> sudo port -v install p5.16-sgmlspm
--->  Computing dependencies for p5.16-sgmlspm..
--->  Dependencies to be installed: perl5.16
--->  Activating perl5.16 @5.16.3_0
x ./
[...]
-->  Verifying checksums for p5.16-sgmlspm
--->  Checksumming SGMLSpm-1.03ii.tar.gz
--->  Extracting p5.16-sgmlspm
--->  Extracting SGMLSpm-1.03ii.tar.gz
--->  Patching Makefile:
s|/usr/local/|/path/to/p5.16-sgmlspm/work/destroot/opt/local/|
--->  Patching Makefile:
s|/usr/local/|/path/to/p5.16-sgmlspm/work/destroot/opt/local/|
xinstall: mkdir /path/to/p5.16-sgmlspm/work/destroot
xinstall: mkdir /path/to/p5.16-sgmlspm/work/destroot/opt
xinstall: mkdir /path/to/p5.16-sgmlspm/work/destroot/opt/local
xinstall: mkdir /path/to/p5.16-sgmlspm/work/destroot/opt/local/bin
xinstall: mkdir /path/to/p5.16-sgmlspm/work/destroot/opt/local/lib
xinstall: mkdir /path/to/p5.16-sgmlspm/work/destroot/opt/local/lib/perl5
xinstall: mkdir
/path/to/p5.16-sgmlspm/work/destroot/opt/local/lib/perl5/vendor_perl
xinstall: mkdir
/path/to/p5.16-sgmlspm/work/destroot/opt/local/lib/perl5/vendor_perl/5.16.3
xinstall: mkdir
/path/to/p5.16-sgmlspm/work/destroot/opt/local/lib/perl5/vendor_perl/5.16.3/SGMLS
[...]
Warning: violation by /SGMLS
Warning: violation by /SGMLS.pm
Warning: violation by /skel.pl
Warning: p5.16-sgmlspm violates the layout of the ports-filesystems!
Warning: Please fix or indicate this misbehavior (if it is intended),
it will be an error in future releases!
--->  Installing p5.16-sgmlspm @1.03ii.0_0
a .
a ./+COMMENT
a ./+CONTENTS
a ./+DESC
a ./+PORTFILE
a ./+STATE
a ./opt
a ./SGMLS
a ./SGMLS.pm
a ./skel.pl
a ./SGMLS/Output.pm
a ./SGMLS/Refs.pm
a ./opt/local
a ./opt/local/bin
a ./opt/local/lib
a ./opt/local/lib/perl5
a ./opt/local/lib/perl5/SGMLS
a ./opt/local/lib/perl5/SGMLS.pm
a ./opt/local/lib/perl5/skel.pl
a ./opt/local/lib/perl5/SGMLS/Output.pm
a ./opt/local/lib/perl5/SGMLS/Refs.pm
a ./opt/local/bin/sgmlspl

Change History (18)

comment:1 Changed 10 years ago by mojca (Mojca Miklavec)

There are problems with maintainer's email address.

comment:2 Changed 10 years ago by mf2k (Frank Schima)

If you are saying the email bounces, then we need to change this port to nomaintainer. He has a number of other ports that should be updated too.

comment:3 Changed 10 years ago by mojca (Mojca Miklavec)

Owner: changed from lockhart@… to tlockhart1976@…

Change email address of the maintainer.

comment:4 Changed 10 years ago by mojca (Mojca Miklavec)

Email changed in ports in r122667.

comment:5 Changed 10 years ago by mojca (Mojca Miklavec)

There's another problem with this port. I'm listing it here, but if needed we could open a new ticket. The file /opt/local/bin/sgmlspl is used by all versions of perl, so p5.16-sgmlspl conflicts with p5.18-sgmlspl for example.

comment:6 in reply to:  5 Changed 10 years ago by lockhart (Thomas Lockhart)

Replying to mojca@…:

There's another problem with this port. I'm listing it here, but if needed we could open a new ticket. The file /opt/local/bin/sgmlspl is used by all versions of perl, so p5.16-sgmlspl conflicts with p5.18-sgmlspl for example.

Hmm. I'm trying to list conflicting variants but that does not seem to have an effect. I've added the lines:

variant p5.16-sgmlspm conflicts p5.18-sgmlspm p5.20-sgmlspm description {} {}
variant p5.18-sgmlspm conflicts p5.16-sgmlspm p5.20-sgmlspm description {} {}
variant p5.20-sgmlspm conflicts p5.16-sgmlspm p5.18-sgmlspm description {} {}

But it may not matter; the package does not seem to build for perl5.18 anyway.

comment:7 Changed 10 years ago by mojca (Mojca Miklavec)

See also:

  • https://build.macports.org/builders/buildports-lion-x86_64/builds/21791
    make: Entering directory `/opt/local/var/macports/build/_opt_mports_dports_perl_p5-sgmlspm/p5.16-sgmlspm/work/SGMLSpm'
    if [ ! -d /opt/local/var/macports/build/_opt_mports_dports_perl_p5-sgmlspm/p5.16-sgmlspm/work/destroot/SGMLS ]; then\
    	  mkdir /opt/local/var/macports/build/_opt_mports_dports_perl_p5-sgmlspm/p5.16-sgmlspm/work/destroot/SGMLS; \
    	  chmod a+x /opt/local/var/macports/build/_opt_mports_dports_perl_p5-sgmlspm/p5.16-sgmlspm/work/destroot/SGMLS; \
    	fi
    sed -e 's!/usr/bin/perl!/opt/local/bin/perl5.16!' sgmlspl.pl > /opt/local/var/macports/build/_opt_mports_dports_perl_p5-sgmlspm/p5.16-sgmlspm/work/destroot/opt/local/bin/sgmlspl
    cp SGMLS.pm /opt/local/var/macports/build/_opt_mports_dports_perl_p5-sgmlspm/p5.16-sgmlspm/work/destroot/SGMLS.pm
    cp Output.pm /opt/local/var/macports/build/_opt_mports_dports_perl_p5-sgmlspm/p5.16-sgmlspm/work/destroot/SGMLS/Output.pm
    cp Refs.pm /opt/local/var/macports/build/_opt_mports_dports_perl_p5-sgmlspm/p5.16-sgmlspm/work/destroot/SGMLS/Refs.pm
    cp: /opt/local/var/macports/build/_opt_mports_dports_perl_p5-sgmlspm/p5.16-sgmlspm/work/destroot/SGMLS/Output.pm: No such file or directory
    make: *** [/opt/local/var/macports/build/_opt_mports_dports_perl_p5-sgmlspm/p5.16-sgmlspm/work/destroot/SGMLS/Output.pm] Error 1
    make: *** Waiting for unfinished jobs....
    chmod a+r /opt/local/var/macports/build/_opt_mports_dports_perl_p5-sgmlspm/p5.16-sgmlspm/work/destroot/SGMLS.pm
    cp: /opt/local/var/macports/build/_opt_mports_dports_perl_p5-sgmlspm/p5.16-sgmlspm/work/destroot/SGMLS/Refs.pm: No such file or directory
    make: *** [/opt/local/var/macports/build/_opt_mports_dports_perl_p5-sgmlspm/p5.16-sgmlspm/work/destroot/SGMLS/Refs.pm] Error 1
    chmod a+x,a+r /opt/local/var/macports/build/_opt_mports_dports_perl_p5-sgmlspm/p5.16-sgmlspm/work/destroot/opt/local/bin/sgmlspl
    make: Leaving directory `/opt/local/var/macports/build/_opt_mports_dports_perl_p5-sgmlspm/p5.16-sgmlspm/work/SGMLSpm'
    Command failed:  cd "/opt/local/var/macports/build/_opt_mports_dports_perl_p5-sgmlspm/p5.16-sgmlspm/work/SGMLSpm" && /usr/bin/make -j8 -w all PERL=/opt/local/bin/perl5.16 BINDIR=/opt/local/var/macports/build/_opt_mports_dports_perl_p5-sgmlspm/p5.16-sgmlspm/work/destroot/opt/local/bin PERL5DIR=/opt/local/var/macports/build/_opt_mports_dports_perl_p5-sgmlspm/p5.16-sgmlspm/work/destroot HTMLDIR=/opt/local/var/macports/build/_opt_mports_dports_perl_p5-sgmlspm/p5.16-sgmlspm/work/destroot/opt/local/share/doc/p5.16-sgmlspm 
    Exit code: 2
    Warning: targets not executed for p5.16-sgmlspm: org.macports.activate org.macports.build org.macports.destroot org.macports.install
    Please see the log file for port p5.16-sgmlspm for details:
        /opt/local/var/macports/logs/_opt_mports_dports_perl_p5-sgmlspm/p5.16-sgmlspm/main.log
    

comment:8 Changed 10 years ago by mojca (Mojca Miklavec)

Would it be acceptable to install something like /opt/local/bin/sgmlspl-1.6 with Perl 1.6 and then maybe make a symlink (with either port select or another package)? These ports shouldn't conflict with each other.

comment:9 in reply to:  8 Changed 10 years ago by lockhart (Thomas Lockhart)

Replying to mojca@…:

Would it be acceptable to install something like /opt/local/bin/sgmlspl-1.6 with Perl 1.6 and then maybe make a symlink (with either port select or another package)? These ports shouldn't conflict with each other.

Probably fine, though that may ripple through the other ports which use it since they will need to refer directly to the versioned executable rather than the one selected. I haven't built a package supporting the select option, and I haven't seen how this affects other packages. Advice is welcome.

comment:10 in reply to:  7 Changed 10 years ago by lockhart (Thomas Lockhart)

cp SGMLS.pm /opt/local/var/macports/build/_opt_mports_dports_perl_p5-sgmlspm/p5.16-sgmlspm/work/destroot/SGMLS.pm
cp Output.pm /opt/local/var/macports/build/_opt_mports_dports_perl_p5-sgmlspm/p5.16-sgmlspm/work/destroot/SGMLS/Output.pm
cp Refs.pm /opt/local/var/macports/build/_opt_mports_dports_perl_p5-sgmlspm/p5.16-sgmlspm/work/destroot/SGMLS/Refs.pm
cp: /opt/local/var/macports/build/_opt_mports_dports_perl_p5-sgmlspm/p5.16-sgmlspm/work/destroot/SGMLS/Output.pm: No such file or directory

This is what I saw when building p5.18-sgmlspm and figured it was a 5.18 problem. But I am not seeing this when I try this morning; the build completes successfully. Can you try "install -s" to make sure you are building from scratch?

Last edited 10 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:11 Changed 10 years ago by mojca (Mojca Miklavec)

Uninstall perl5.18 and try to install p5.18-sgmlspm again. The problem only occurs if perl wasn't installed beforehand. (Because perl5.lib isn't defined.)

I can help you with port select, but I don't know how this affects other packages either. Also, this is a deeper problem with perl packaging in MacPorts.

In this particular case I would probably suggest splitting /opt/local/bin/sgmlspl into a separate standalone port. (But that might change if we change Perl packaging.)

comment:12 in reply to:  11 ; Changed 10 years ago by lockhart (Thomas Lockhart)

Replying to mojca@…:

Uninstall perl5.18 and try to install p5.18-sgmlspm again. The problem only occurs if perl wasn't installed beforehand. (Because perl5.lib isn't defined.)

Unfortunately, I am not seeing that failure after explicitly uninstalling perl5.18. If I then install p5.16-sgmlspm then perl5.16 gets installed and there are no errors. Is there something left over from the original installation of perl5.16 which allows this to now succeed??

I can help you with port select, but I don't know how this affects other packages either. Also, this is a deeper problem with perl packaging in MacPorts.

In this particular case I would probably suggest splitting /opt/local/bin/sgmlspl into a separate standalone port. (But that might change if we change Perl packaging.)

Yuck. There is very little in this package besides that program. And in looking at the contents list I see that this conflicts with everything anyway since it installs some libraries under "/opt/local/lib/perl5/".

Any thoughts on how to structure the "conflicts" statement in the portfile?

comment:13 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Don't add a conflicts line; instead, fix it so they don't conflict.

comment:14 in reply to:  13 Changed 10 years ago by lockhart (Thomas Lockhart)

Replying to ryandesign@…:

Don't add a conflicts line; instead, fix it so they don't conflict.

The portfile is following the convention supported by the distro. The more we change or augment the distro the more we increase the maintenance costs. And since this is a foundational package used directly or indirectly by several other packages a change in the name of the executable (for example) may ripple strongly into the packaging of the ports for those too. I would suggest that for now we develop an update to the portfile to catch conflicts (since those already cause an installation failure but without a helpful message from the port system), and then re-evaluate. I'll point out that I did not introduce this port, but volunteered to freshen it up as part of overall SGML and XML support. Comments?

comment:15 in reply to:  12 Changed 10 years ago by lockhart (Thomas Lockhart)

Replying to tlockhart1976@…:

Replying to mojca@…:

Uninstall perl5.18 and try to install p5.18-sgmlspm again. The problem only occurs if perl wasn't installed beforehand. (Because perl5.lib isn't defined.)

Unfortunately, I am not seeing that failure after explicitly uninstalling perl5.18. If I then install p5.16-sgmlspm then perl5.16 gets installed and there are no errors. Is there something left over from the original installation of perl5.16 which allows this to now succeed??

btw, I meant "5.18" above, rather than "5.16". But I think I saw installation failures in both over that "missing" .pm file, but now see failures in neither. Annoying.

comment:16 Changed 10 years ago by mojca (Mojca Miklavec)

If you had a properly installed p5.1x-sgmlspm port once and if you just deactivated it, the next sudo port install p5.1x-sgmlspm command will just put those files back without "recompiling" everything. So make sure that you have perl5.1x deactivated and that port installed '*sgmlspm' doesn't give you any results, not even deactivated ones (you need the quotes, else shell replaced the * with contents of current directory).

Now let's forget about the file in /opt/local/bin for a moment. The module should install files under

  /opt/local/lib/perl5/vendor_perl/5.16.3/SGMLS.pm
  /opt/local/lib/perl5/vendor_perl/5.16.3/SGMLS/Output.pm
  /opt/local/lib/perl5/vendor_perl/5.16.3/SGMLS/Refs.pm
  /opt/local/lib/perl5/vendor_perl/5.16.3/skel.pl

for example. It should not install files under

  /opt/local/lib/perl5/SGMLS.pm
  /opt/local/lib/perl5/SGMLS/Output.pm
  /opt/local/lib/perl5/SGMLS/Refs.pm
  /opt/local/lib/perl5/skel.pl

If you take a look at some random Perl modules, for example p5.16-version, you'll notice that the Portfile usually doesn't need any special code to install "properly" (please note that p5.16-version is probably a bad example as it also installs some binary code). I don't know why this particular port needs special handling (all those build.args-append and patching the Makefiles). Ideally the Makefiles would be written in such a way that the port wouldn't need any special code at all.

Ryan says that

xinstall -d -m 775 ${destroot}${perl5.lib}

is problematic for example because perl5.lib isn't defined if that particular version of perl is missing.

comment:17 Changed 9 years ago by mojca (Mojca Miklavec)

See also #46054, #46057 and r130876.

comment:18 Changed 9 years ago by dbevans (David B. Evans)

Resolution: fixed
Status: newclosed

Fixed in r130876. Files now install in correct (versioned) directories, binary conflicts are resolved and build is successful on buildbots.

Note: See TracTickets for help on using tickets.