Bug 257069 - Improve error output from the do-depends.sh script
Summary: Improve error output from the do-depends.sh script
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Port Management Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-09 01:01 UTC by Maxim Sobolev
Modified: 2021-08-18 03:26 UTC (History)
2 users (show)

See Also:


Attachments
Patch to improve error output. (2.66 KB, patch)
2021-07-09 01:01 UTC, Maxim Sobolev
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maxim Sobolev freebsd_committer 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 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 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!