Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 590718 - net-misc/networkmanager-1.2.4 test failure
Summary: net-misc/networkmanager-1.2.4 test failure
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-08 00:40 UTC by tka
Modified: 2016-08-08 15:32 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
networkmanager-1.2.4.ebuild diff (diff,226 bytes, patch)
2016-08-08 00:40 UTC, tka
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description tka 2016-08-08 00:40:29 UTC
Created attachment 442744 [details, diff]
networkmanager-1.2.4.ebuild diff

Making check in examples
make[1]: Entering directory '/var/tmp/portage/net-misc/networkmanager-1.2.4/work/NetworkManager-1.2.4-abi_x86_64.amd64/examples'
make[1]: *** No rule to make target 'check'.  Stop.
make[1]: Leaving directory '/var/tmp/portage/net-misc/networkmanager-1.2.4/work/NetworkManager-1.2.4-abi_x86_64.amd64/examples'
make: *** [Makefile:646: check-recursive] Error 1


The test suite fails because 

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=66de663c48186cb4143dce52791656f79744f3d9

adds no target check to the makefile. The solution is simple:

--- networkmanager-1.2.4.ebuild
+++ networkmanager-1.2.4.ebuild
@@ -212,8 +212,9 @@
 
 	# Disable examples
 	cat > examples/Makefile <<-EOF
-	.PHONY: all install
+	.PHONY: all check install
 	all:
+	check:
 	install:
 	EOF
 }
Comment 1 Mike Gilbert gentoo-dev 2016-08-08 01:15:50 UTC
commit 0a0d8e884dae8b651662922a3c04922ae5edcbf3
Author: Mike Gilbert <floppym@gentoo.org>
Date:   Sun Aug 7 21:13:58 2016 -0400

    net-misc/networkmanager: add 'check' target to stub Makefile
    
    Patch by tka.
    
    Bug: https://bugs.gentoo.org/590718
    Package-Manager: portage-2.3.0_p16

 net-misc/networkmanager/networkmanager-1.2.4.ebuild | 3 ++-
Comment 2 Pacho Ramos gentoo-dev 2016-08-08 08:11:23 UTC
Why are we disabling the examples in this way since 1.2.4?
Comment 3 Pacho Ramos gentoo-dev 2016-08-08 08:12:30 UTC
Also doing this:
        # Remove any empty directories
        find "${D}" -type d -empty -delete || die

Looks to me like a bit risky... how can we know that we are not removing any directory that could be needed in the future?
Comment 4 Mike Gilbert gentoo-dev 2016-08-08 14:19:34 UTC
(In reply to Pacho Ramos from comment #2)
> Why are we disabling the examples in this way since 1.2.4?

I think it will less error-prone than the sed applied to Makefile.in. See bug 590432 comment 10.
Comment 5 Mike Gilbert gentoo-dev 2016-08-08 14:28:18 UTC
(In reply to Pacho Ramos from comment #3)
> Also doing this:
>         # Remove any empty directories
>         find "${D}" -type d -empty -delete || die
> 
> Looks to me like a bit risky... how can we know that we are not removing any
> directory that could be needed in the future?

ebuilds should not install ANY empty directory. If other packages install things under the same path, and then get unmerged, they will end up removing the empty directory.

For volatile directories, the solution is to create them at runtime. For non-volatile directories, keepdir can be used to create a dummy dotfile if necessary.

Anyway, I replaced the find call with the following, which is abit more effecient.

# Remove empty /run/NetworkManager
rmdir "${D}"/run/NetworkManager "${D}"/run || die
Comment 6 Pacho Ramos gentoo-dev 2016-08-08 15:30:43 UTC
(In reply to Mike Gilbert from comment #5)
> ebuilds should not install ANY empty directory. If other packages install
> things under the same path, and then get unmerged, they will end up removing
> the empty directory.
> 

Yeah, but I was checking about other ebuilds in the tree and they are all trying to only remove some concrete and known empty dirs instead of all... then, I was wondering if that would be a problem (if not, maybe it would belong to the new EAPI to stop us from needing to randomly run this cleaning on multiple ebuilds)

> For volatile directories, the solution is to create them at runtime. For
> non-volatile directories, keepdir can be used to create a dummy dotfile if
> necessary.
> 
> Anyway, I replaced the find call with the following, which is abit more
> effecient.
> 
> # Remove empty /run/NetworkManager
> rmdir "${D}"/run/NetworkManager "${D}"/run || die

Nice thanks :)

For this case I guess I could report to upstream as it looks NM is creating the dirs when needed at start time (without even relying on tmpfiles.d), then, creating the files at make install time is not really needed. 

For other stuff relying on tmpfiles.d... I have always wondered what will happen when we don't install that directories if someone tries to start the service. In other distributions that is not a problem because they have hooks for running "systemd-tmpfiles --create" after the installation... but that is not the case of Gentoo :/
Comment 7 Pacho Ramos gentoo-dev 2016-08-08 15:32:00 UTC
(In reply to Mike Gilbert from comment #4)
> (In reply to Pacho Ramos from comment #2)
> > Why are we disabling the examples in this way since 1.2.4?
> 
> I think it will less error-prone than the sed applied to Makefile.in. See
> bug 590432 comment 10.

Ah, ok... maybe I could try to suggest to upstream to add a --without-examples option like many other packages do for not needing to carry this forever ;)