Bug 189255 - [patch] Mk/Scripts/qa.sh: look for libtool libraries
Summary: [patch] Mk/Scripts/qa.sh: look for libtool libraries
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Antoine Brodin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-02 17:30 UTC by Tijl Coosemans
Modified: 2014-05-06 17:56 UTC (History)
0 users

See Also:


Attachments
stage-qa.patch (1.13 KB, patch)
2014-05-02 17:30 UTC, Tijl Coosemans
no flags Details | Diff
stage-qa.patch (1.16 KB, patch)
2014-05-02 19:31 UTC, Tijl Coosemans
no flags Details | Diff
stage-qa.patch (704 bytes, patch)
2014-05-06 08:57 UTC, Tijl Coosemans
no flags Details | Diff
stage-qa.patch (1.11 KB, patch)
2014-05-06 09:27 UTC, Tijl Coosemans
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tijl Coosemans freebsd_committer freebsd_triage 2014-05-02 17:30:00 UTC
- Print an error message in stage-qa when libtool libraries are found
  and USES=libtool is missing.
- Fix the condition for USESSHAREDMIMEINFO in Mk/bsd.stage.mk.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2014-05-02 17:30:03 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2014-05-02 17:30:03 UTC
Maintainer of Mk/Scripts,

Please note that PR ports/189255 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/189255

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 3 Tijl Coosemans freebsd_committer freebsd_triage 2014-05-02 17:40:21 UTC
State Changed
From-To: feedback->open

Assign to maintainer. 


Comment 4 Tijl Coosemans freebsd_committer freebsd_triage 2014-05-02 17:40:21 UTC
Responsible Changed
From-To: freebsd-ports-bugs->portmgr

Assign to maintainer.
Comment 5 Bryan Drewery freebsd_committer freebsd_triage 2014-05-02 17:59:23 UTC
+            find ${STAGEDIR} -type f -name '*.la' | while read f; do
+                      grep -q 'libtool library' "${f}" &&
+                         err "you need USES=libtool" && return 1
+             done
+  fi
+    return 0

return 1 from the pipe won't work here. It will just return 0 on the 
next line.

See the other loops for hints on how to work around that.

-- 
Regards,
Bryan Drewery
Comment 6 Antoine Brodin freebsd_committer freebsd_triage 2014-05-02 18:18:18 UTC
Responsible Changed
From-To: portmgr->antoine

Take, I will test your updated patch on package22 to see how many qa failures we have.
Comment 7 Tijl Coosemans freebsd_committer freebsd_triage 2014-05-02 19:31:09 UTC
On Fri, 02 May 2014 11:59:23 -0500 Bryan Drewery wrote:
> 
> +            find ${STAGEDIR} -type f -name '*.la' | while read f; do
> +                      grep -q 'libtool library' "${f}" &&
> +                         err "you need USES=libtool" && return 1
> +             done
> +  fi
> +    return 0
> 
> return 1 from the pipe won't work here. It will just return 0 on the 
> next line.
> 
> See the other loops for hints on how to work around that.

I've attached a new patch, but instead of using a here-document I just
removed the "return 0" and added a comment about where the "return 1"
ends up.  This has the advantage that the results of find aren't computed
completely like you have with a here-document.  
Comment 8 Antoine Brodin freebsd_committer freebsd_triage 2014-05-04 13:27:37 UTC
I have put the list of staged ports failing this QA check at
http://people.freebsd.org/~antoine/needlibtool.txt

They are 1394,  too much to make it an error.

A few are possible false positives:
audio/linux-f10-alsa-lib
audio/linux-f10-arts
x11-toolkits/linux-f10-gtk2

Also some of them are generated by "qmake/libtool", I don't know if
they have to be handled by USES=libtool too?
Comment 9 Tijl Coosemans freebsd_committer freebsd_triage 2014-05-04 13:42:10 UTC
On Sun, 4 May 2014 14:27:37 +0200 Antoine Brodin wrote:
> I have put the list of staged ports failing this QA check at
> http://people.freebsd.org/~antoine/needlibtool.txt
> 
> They are 1394,  too much to make it an error.
> 
> A few are possible false positives:
> audio/linux-f10-alsa-lib
> audio/linux-f10-arts
> x11-toolkits/linux-f10-gtk2

I think these can also set USES=libtool (or USES=libtool:keepla).

> Also some of them are generated by "qmake/libtool", I don't know if
> they have to be handled by USES=libtool too?

Can you give an example?
Comment 10 Antoine Brodin freebsd_committer freebsd_triage 2014-05-04 14:46:22 UTC
The .la files generated by "qmake/libtool" are from the qt4-* and qt5-* ports.
Comment 11 Tijl Coosemans freebsd_committer freebsd_triage 2014-05-06 08:57:10 UTC
On Sun, 4 May 2014 14:27:37 +0200 Antoine Brodin wrote:
> I have put the list of staged ports failing this QA check at
> http://people.freebsd.org/~antoine/needlibtool.txt
> 
> They are 1394,  too much to make it an error.

Here's a new patch that makes it a warning.  I also made the message a
bit more descriptive.
Comment 12 Tijl Coosemans freebsd_committer freebsd_triage 2014-05-06 09:27:47 UTC
On Tue, 6 May 2014 09:57:10 +0200 Tijl Coosemans wrote:
> On Sun, 4 May 2014 14:27:37 +0200 Antoine Brodin wrote:
>> I have put the list of staged ports failing this QA check at
>> http://people.freebsd.org/~antoine/needlibtool.txt
>> 
>> They are 1394,  too much to make it an error.
> 
> Here's a new patch that makes it a warning.  I also made the message a
> bit more descriptive.

I forgot the bsd.stage.mk part.  Here is the complete patch.
Comment 13 Antoine Brodin freebsd_committer freebsd_triage 2014-05-06 12:22:55 UTC
Last version of the patch approved, thanks!
Comment 14 dfilter service freebsd_committer freebsd_triage 2014-05-06 12:57:25 UTC
Author: tijl
Date: Tue May  6 11:57:22 2014
New Revision: 353084
URL: http://svnweb.freebsd.org/changeset/ports/353084
QAT: https://qat.redports.org/buildarchive/r353084/

Log:
  Let stage-qa detect .la libraries and warn that a port needs USES=libtool.
  
  PR:		ports/189255
  Approved by:	portmgr (antoine)

Modified:
  head/Mk/Scripts/qa.sh
  head/Mk/bsd.stage.mk

Modified: head/Mk/Scripts/qa.sh
==============================================================================
--- head/Mk/Scripts/qa.sh	Tue May  6 11:17:29 2014	(r353083)
+++ head/Mk/Scripts/qa.sh	Tue May  6 11:57:22 2014	(r353084)
@@ -172,7 +172,18 @@ suidfiles() {
 	return 0
 }
 
-checks="shebang symlinks paths stripped desktopfileutils sharedmimeinfo suidfiles"
+libtool() {
+	if [ -z "${USESLIBTOOL}" ]; then
+		find ${STAGEDIR} -type f -name '*.la' | while read f; do
+			grep -q 'libtool library' "${f}" &&
+				warn ".la libraries found, port needs USES=libtool" &&
+				return 0 || true
+		done
+		# The return above continues here.
+	fi
+}
+
+checks="shebang symlinks paths stripped desktopfileutils sharedmimeinfo suidfiles libtool"
 
 ret=0
 cd ${STAGEDIR}

Modified: head/Mk/bsd.stage.mk
==============================================================================
--- head/Mk/bsd.stage.mk	Tue May  6 11:17:29 2014	(r353083)
+++ head/Mk/bsd.stage.mk	Tue May  6 11:57:22 2014	(r353084)
@@ -17,6 +17,9 @@ QA_ENV+=	STAGEDIR=${STAGEDIR} \
 .if !empty(USES:Mdesktop-file-utils)
 QA_ENV+=	USESDESKTOPFILEUTILS=yes
 .endif
+.if !empty(USES:Mlibtool*)
+QA_ENV+=	USESLIBTOOL=yes
+.endif
 .if !empty(USES:Mshared-mime-info)
 QA_ENV+=	USESSHAREDMIMEINFO=yes
 .endif
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 15 Antoine Brodin freebsd_committer freebsd_triage 2014-05-06 17:55:55 UTC
State Changed
From-To: open->closed

Patch was committed