Bug 257069

Summary: Improve error output from the do-depends.sh script
Product: Ports & Packages Reporter: Maxim Sobolev <sobomax>
Component: Ports FrameworkAssignee: Port Management Team <portmgr>
Status: New ---    
Severity: Affects Many People CC: adamw, sobomax
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Patch to improve error output. none

Description Maxim Sobolev freebsd_committer freebsd_triage 2021-07-09 01:01:04 UTC
Created attachment 226318 [details]
Patch to improve error output.

When resolving dependencies do-depends.sh currently emits error(s) and sets a flag, but proceeds traversing the dependency chain. As a result, the error(s) is/are potentially burried in megabytes of other output. With this patch, the script would accumulate all errors and output them at the end of the script providing a nice summary and direction on how to fix.

----
00:24:51.853  /usr/local/etc/php/ext-20-dba.ini
00:24:51.853  ===>   ssp-5.4.9b6ccea87_1 depends on file: /usr/local/lib/php/20190902/dba.so - found
00:24:51.853  ===>   Returning to build of ssp-5.4.9b6ccea87_1
00:24:51.853  Found 1 error(s) with dependencies:
00:24:51.853  	Error #1: a dependency refers to a non existing origin: /media/net/opensips31 in RUN_DEPENDS
00:24:51.853  *** Error code 1
----

Versus before:
----
00:12:50.614  ===>   ssp-5.4.9b6ccea87_1 depends on file: /usr/local/sbin/opensips31 - not found
00:12:50.614  Error a dependency refers to a non existing origin: /media/net/opensips31 in RUN_DEPENDS
00:12:50.614  ===>   ssp-5.4.9b6ccea87_1 depends on file: /usr/local/sbin/codecd - not found
[thousands of lines skipped]
00:24:43.113  /usr/local/etc/php/ext-20-dba.ini
00:24:43.113  ===>   ssp-5.4.9b6ccea87_1 depends on file: /usr/local/lib/php/20190902/dba.so - found
00:24:43.113  ===>   Returning to build of ssp-5.4.9b6ccea87_1
00:24:43.113  Errors with dependencies.
00:24:43.113  *** Error code 1
----
Comment 1 Adam Weinberger freebsd_committer freebsd_triage 2021-07-12 01:34:12 UTC
I've personally encountered this scenario more times than I can count. A solution like this makes the ports process seem much less opaque.

I wonder if this is an opportunity for a general error-message accumulator. Would this paradigm make sense for more than just do-depends?
Comment 2 Maxim Sobolev freebsd_committer freebsd_triage 2021-08-18 03:26:00 UTC
Adam, maybe it would however I cannot think of any other place where it might be useful. I suggest making one step at a time by taking this patch and generalizing on it later if the need arises.

Thanks!
Comment 3 Baptiste Daroussin freebsd_committer freebsd_triage 2021-11-19 21:10:50 UTC
LGTM, please commit