Summary: | ports-mgmt/portmaster: tries to build devel/git@lite even if devel/git@default is already installed | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Martin Birgmeier <d8zNeCFG> | ||||||||
Component: | Individual Port(s) | Assignee: | freebsd-ports-bugs (Nobody) <ports-bugs> | ||||||||
Status: | Open --- | ||||||||||
Severity: | Affects Only Me | CC: | fernape, garga, se, tatsuki_makino | ||||||||
Priority: | --- | Flags: | fernape:
maintainer-feedback?
(se) |
||||||||
Version: | Latest | ||||||||||
Hardware: | Any | ||||||||||
OS: | Any | ||||||||||
Attachments: |
|
Description
Martin Birgmeier
2020-10-14 10:44:42 UTC
> - devel/git is installed
/usr/bin/which -s git is executed to determine this.
Which line of "depends on executable: git" outside of snip is "- found" or "- not found"?
Created attachment 218750 [details] Part of script script.log sh -x `which \portmaster` -n java/eclipse comment #1 had nothing to do with it at all... So I'll provide a log of script that may be relevant :) ^Triage: notify maintainer Have exactly the same problem with FB12.2 Install eclipse with portmaster but eclipse wants git@lite even when git is already installed. Maybe remove flavor in Makefile? This should have been fixed with commit a18733148a22a230caabc9295ef99c5840bdc43d on 2020-04-08. Please text again and re-open the PR if the issue persists. The cause was an optimization in portmaster, which made it skip the expensive conflicts check if there were no lines starting with "CONFLICTS" in the Makefile. In devel/git/Makefile there are CONFLICTS definitions for each FLAVOR, prefixed by the flavor name, e.g. "lite_CONFLICTS_INSTALL", which did not match the regular expression ^CONFLICTS. This used to work in a pre-FLAVORs world, and while the regular expression could be made less strict, this would not have solved an issue in some other port, which got its CONFLICTS definitions only by including another port's Makefile. Therefore the optimization had to be removed, somewhat slowing down portmaster since it now has to invoke a complex shell script to test for conflicts with installed packages even for ports that do not have any CONFLICTS defined. Still the same Problem: Installing git-lite-2.31.1_1... pkg-static: git-lite-2.31.1_1 conflicts with git-2.31.1_1 (installs files into the same place). Problematic file: /usr/local/bin/git *** Error code 1 Stop. make[1]: stopped in /usr/ports/devel/git *** Error code 1 Stop. make: stopped in /usr/ports/devel/git ===>>> Installation of git-lite-2.31.1_1 (devel/git@lite) failed ===>>> Aborting update ===>>> Update for devel/git@lite failed ===>>> Aborting update ===>>> You can restart from the point of failure with this command line: portmaster <flags> java/eclipse devel/git@lite Created attachment 224691 [details]
Remove Flavor git@lite
I guess I see what's going on: normally the conflict is due to a different port providing the same functionality (e.g. the different samba4xx ports). Here the conflict is due to the FLAVOR, and the match from package name to the FLAVOR that leads to some package name prefix cannot easily be queried from the port. (I.e. there is no mechanism that lets me identify FLAVOR=lite as the condition for the git-lite package name, it is not correct to assume that the flavor is generally the last part of a package name, for example.) A possible fix could be to look for a conflicting port with the same origin (port directory) registered in the package database. It could then be assumed that the conflicting port already satisfies the dependency requirement (which may or may not be true - and there is no heuristic that I can think of that might always give a reasonable answer to this question). I have been working on a portmaster rewrite for quite some time, and the new implementation will be able to deal with this issue. Therefore I do not want to spend a lot of effort trying to get it fixed in this portmaster implementation - it would only take time away from the re-implementation project. Created attachment 225451 [details]
Patch to make conflicts check not ignore same origin packages
Another comment regarding the root cause of this issue:
CONFLICTS_INSTALL is treated differently in bsd.port.mk and by the pkg command.
In bsd.port.mk no output is generated by "make check-install-conflicts" for conflicting packages, if the origin is the same. This is despite all other variants than for the currently built FLAVOR are listed in the *_INSTALL_CONFLICTS variables for each FLAVOR.
And since "git" and "git-lite" both have the same origin, "make check-install-conflicts" does not list them as conflicting.
The pkg command does not care for the origin, and it detects the conflict.
IMHO, the test in bsd.port.mk should be aligned with the one in the pkg command to give an early indication of the conflict that else will only be detected during the install phase.
The attached patch does only remove the comparison with $orgn - a more complete patch would remove %o from the pkg query string and orgn from the while loop.
This patch is only meant to demonstrate the effect on the output of "make check-install-conflicts" and to show that it fixes the issue reported in this PR.
|