Bug 193230

Summary: [patch] cad/iverilog plist issues if port is already installed
Product: Ports & Packages Reporter: Don Lewis <truckman>
Component: Individual Port(s)Assignee: Niclas Zeising <zeising>
Status: Closed FIXED    
Severity: Affects Only Me CC: w.schwarzenfeld
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch to fix iverilog plist issue when reinstalling from source none

Description Don Lewis freebsd_committer freebsd_triage 2014-09-01 18:24:31 UTC
Created attachment 146634 [details]
patch to fix iverilog plist issue when reinstalling from source

If the cad/verilog port (iverilog-0.9.7) is installed, then the port does not properly install all of its files in the stage directory when it is rebuilt.  This can happen when the port is upgraded or reinstalled with portupgrade (and most likely portmaster as well).  The problem is that the Makefiles in the source distribution compare the timestamps of the include files (and various other files) under PREFIX to the timestamps of the corresponding files in the source, and only install these files under STAGEDIR if the source files are newer.  If the timestamps match, then the files are not installed under STAGEDIR and check-plist will detect that they are missing.

This problem does not affect poudriere builds because it always starts without the port installed.

To reproduce:
  Install the port, either with a pre-built package or by building and installing
  the port.

  cd cad/iverilog

  make stage

  make check-plist

====> Checking for pkg-plist issues (check-plist)
===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
===> Checking for directories owned by MTREEs
===> Checking for directories handled by dependencies
===> Checking for items in pkg-plist which are not in STAGEDIR
Error: Missing: include/iverilog/acc_user.h
Error: Missing: include/iverilog/ivl_target.h
Error: Missing: include/iverilog/veriuser.h
Error: Missing: include/iverilog/vpi_user.h
Error: Missing: lib/ivl/include/constants.vams
Error: Missing: lib/ivl/include/disciplines.vams
Error: Missing: lib/ivl/null-s.conf
Error: Missing: lib/ivl/null.conf
Error: Missing: lib/ivl/stub-s.conf
Error: Missing: lib/ivl/stub.conf
Error: Missing: lib/ivl/system.sft
Error: Missing: lib/ivl/v2005_math.sft
Error: Missing: lib/ivl/va_math.sft
Error: Missing: lib/ivl/vhdl-s.conf
Error: Missing: lib/ivl/vhdl.conf
===> Error: Plist issues found.
*** Error code 1

Stop in /usr/ports/cad/iverilog.
Comment 1 John Marino freebsd_committer freebsd_triage 2014-09-04 15:42:48 UTC
over to maintainer
Comment 2 Niclas Zeising freebsd_committer freebsd_triage 2015-10-15 22:53:02 UTC
Hi!
I recently updated the iverilog port, can you please test and see if this is still an issue?
Comment 3 Don Lewis freebsd_committer freebsd_triage 2015-11-04 00:39:12 UTC
(In reply to Niclas Zeising from comment #2)

Nope, it is still broken:

install  -s -m 555 ./iverilog "/usr/ports/cad/iverilog/work/stage/usr/local/bin/iverilog"
install  -m 0644 iverilog.man "/usr/ports/cad/iverilog/work/stage/usr/local/man/man1/iverilog.1"
gmake[2]: Leaving directory '/usr/ports/cad/iverilog/work/verilog-10.0/driver'
gmake[1]: Leaving directory '/usr/ports/cad/iverilog/work/verilog-10.0'
====> Compressing man pages (compress-man)
root@mousie:/usr/ports/cad/iverilog # make check-plist
====> Checking for pkg-plist issues (check-plist)
===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
Error: Orphaned: @dir lib/ivl/include
===> Checking for items in pkg-plist which are not in STAGEDIR
Error: Missing: include/iverilog/acc_user.h
Error: Missing: include/iverilog/ivl_target.h
Error: Missing: include/iverilog/sv_vpi_user.h
Error: Missing: include/iverilog/veriuser.h
Error: Missing: include/iverilog/vpi_user.h
Error: Missing: lib/ivl/blif-s.conf
Error: Missing: lib/ivl/blif.conf
Error: Missing: lib/ivl/include/constants.vams
Error: Missing: lib/ivl/include/disciplines.vams
Error: Missing: lib/ivl/null-s.conf
Error: Missing: lib/ivl/null.conf
Error: Missing: lib/ivl/pcb-s.conf
Error: Missing: lib/ivl/pcb.conf
Error: Missing: lib/ivl/sizer-s.conf
Error: Missing: lib/ivl/sizer.conf
Error: Missing: lib/ivl/stub-s.conf
Error: Missing: lib/ivl/stub.conf
Error: Missing: lib/ivl/system.sft
Error: Missing: lib/ivl/v2005_math.sft
Error: Missing: lib/ivl/v2009.sft
Error: Missing: lib/ivl/va_math.sft
Error: Missing: lib/ivl/vhdl-s.conf
Error: Missing: lib/ivl/vhdl.conf
Error: Missing: lib/ivl/vhdl_sys.sft
Error: Missing: lib/ivl/vlog95-s.conf
Error: Missing: lib/ivl/vlog95.conf
===> Error: Plist issues found.
*** Error code 1

Stop.
make: stopped in /usr/ports/cad/iverilog
Comment 4 Walter Schwarzenfeld freebsd_triage 2018-01-13 04:05:45 UTC
I try it on 10.4. make check-plist runs without problems Seem done and I think it could be closed.
Comment 5 Don Lewis freebsd_committer freebsd_triage 2018-01-13 07:40:47 UTC
Did you try with the port already installed?

This will only affect builds with portupgrade, portmaster, or a manual build with the port already installed.  Builds with poudriere or synth that do the build in a clean environment will not run into this problem.

The issue is that the the install phase of the iverilog build will not reinstall its headers if it see that they are already installed (and haven't changed, I presume).  I think it does this to avoid updating the timestamps of the installed headers, which would trigger the recompilation of the modules that the the user previously compiled.  Unfortunately this breaks with the introduction of staging, and the headers don't get installed into the stage directory and get omitted from the package.  When building with poudriere or synth, or building when the port isn't already installed, the install phase doesn't see the old headers, so it does install them in the stage directory and everything looks fine.
Comment 6 Walter Schwarzenfeld freebsd_triage 2018-01-13 08:11:36 UTC
Ok! Sorry, you are right.
Comment 7 Don Lewis freebsd_committer freebsd_triage 2018-01-13 08:35:20 UTC
Yeah, the failure mode is now different, but the cause is the same:

[install iverilog using pkg or otherwise, then "make" and "make package":

root@mousie:/usr/ports/cad/iverilog # make package
===>  Building package for iverilog-10.2
pkg-static: Unable to access file /usr/ports/cad/iverilog/work/stage/usr/local/include/iverilog/acc_user.h:No such file or directory
pkg-static: Unable to access file /usr/ports/cad/iverilog/work/stage/usr/local/include/iverilog/ivl_target.h:No such file or directory
pkg-static: Unable to access file /usr/ports/cad/iverilog/work/stage/usr/local/include/iverilog/sv_vpi_user.h:No such file or directory
pkg-static: Unable to access file /usr/ports/cad/iverilog/work/stage/usr/local/include/iverilog/veriuser.h:No such file or directory
pkg-static: Unable to access file /usr/ports/cad/iverilog/work/stage/usr/local/include/iverilog/vpi_user.h:No such file or directory
pkg-static: Unable to access file /usr/ports/cad/iverilog/work/stage/usr/local/lib/ivl/blif-s.conf:No such file or directory
pkg-static: Unable to access file /usr/ports/cad/iverilog/work/stage/usr/local/lib/ivl/blif.conf:No such file or directory
pkg-static: Unable to access file /usr/ports/cad/iverilog/work/stage/usr/local/lib/ivl/include/constants.vams:No such file or directory
pkg-static: Unable to access file /usr/ports/cad/iverilog/work/stage/usr/local/lib/ivl/include/disciplines.vams:No such file or directory
pkg-static: Unable to access file /usr/ports/cad/iverilog/work/stage/usr/local/lib/ivl/null-s.conf:No such file or directory
pkg-static: Unable to access file /usr/ports/cad/iverilog/work/stage/usr/local/lib/ivl/null.conf:No such file or directory
pkg-static: Unable to access file /usr/ports/cad/iverilog/work/stage/usr/local/lib/ivl/pcb-s.conf:No such file or directory
pkg-static: Unable to access file /usr/ports/cad/iverilog/work/stage/usr/local/lib/ivl/pcb.conf:No such file or directory
pkg-static: Unable to access file /usr/ports/cad/iverilog/work/stage/usr/local/lib/ivl/sizer-s.conf:No such file or directory
pkg-static: Unable to access file /usr/ports/cad/iverilog/work/stage/usr/local/lib/ivl/sizer.conf:No such file or directory
pkg-static: Unable to access file /usr/ports/cad/iverilog/work/stage/usr/local/lib/ivl/stub-s.conf:No such file or directory
pkg-static: Unable to access file /usr/ports/cad/iverilog/work/stage/usr/local/lib/ivl/stub.conf:No such file or directory
pkg-static: Unable to access file /usr/ports/cad/iverilog/work/stage/usr/local/lib/ivl/system.sft:No such file or directory
pkg-static: Unable to access file /usr/ports/cad/iverilog/work/stage/usr/local/lib/ivl/vlog95-s.conf:No such file or directory
pkg-static: Unable to access file /usr/ports/cad/iverilog/work/stage/usr/local/lib/ivl/vlog95.conf:No such file or directory
pkg-static: Unable to access file /usr/ports/cad/iverilog/work/stage/usr/local/lib/ivl/v2005_math.sft:No such file or directory
pkg-static: Unable to access file /usr/ports/cad/iverilog/work/stage/usr/local/lib/ivl/v2009.sft:No such file or directory
pkg-static: Unable to access file /usr/ports/cad/iverilog/work/stage/usr/local/lib/ivl/va_math.sft:No such file or directory
pkg-static: Unable to access file /usr/ports/cad/iverilog/work/stage/usr/local/lib/ivl/vhdl-s.conf:No such file or directory
pkg-static: Unable to access file /usr/ports/cad/iverilog/work/stage/usr/local/lib/ivl/vhdl_sys.sft:No such file or directory
pkg-static: Unable to access file /usr/ports/cad/iverilog/work/stage/usr/local/lib/ivl/vhdl.conf:No such file or directory
*** Error code 1

Stop.
make: stopped in /usr/ports/cad/iverilog
Comment 8 Walter Schwarzenfeld freebsd_triage 2018-09-03 14:17:17 UTC
ping!
Comment 9 Walter Schwarzenfeld freebsd_triage 2019-08-14 10:06:43 UTC
ping!
Comment 10 Walter Schwarzenfeld freebsd_triage 2019-08-18 02:53:57 UTC
The error still exists after ports r509186.

I found not the really cause of the issue, but a workaround:

Put 
do-restage:     restage

in the Makefile.


or
in /etc/make.conf
.if {.CURDIR:M*/ports/cad/iverilog}
do-restage:     restage
.endif
Comment 11 Walter Schwarzenfeld freebsd_triage 2019-08-18 02:54:42 UTC
Sorry , forget it. Overlooked the patch.
Comment 12 Niclas Zeising freebsd_committer freebsd_triage 2020-10-21 19:24:02 UTC
This should be fixed in ports r552885.