Opened 7 years ago

Closed 7 years ago

#53202 closed defect (fixed)

kde4-kile wants to install macports texlive even though MacTex texlive is installed

Reported by: fusionfan Owned by: NicosPavlov
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: mkae (Marko Käning)
Port: kde4-kile, texlive

Description

I have been using Kile via macports ever since it started to exist. I have recently installed latex via the MacTex package and wanted to remove the duplicate latex distro installed by macports. After removing all latex packages installed by macports (except of course kile) kile still works fine, recognizing the MacTex instalation.

However, when trying to run a

port upgrade outdated

texlive wants to reinstall. I have checked, and no currently installed port reports an exact dependency on texlive. Therefore the reason why texlive wants to reinstall is a mistery to me. The reinstall seems to be triggered by kdelibs4, which lead me to believe that kde4-kile is the culprit.

kde4-kile should detect that the runtime dependency

depends_run-append bin:tex:texlive

exists (it does: kile runs fine), but it still wants to install texlive via macports when I run an upgrade command. I proceeded to create a modified local Portfile, where this dependency is removed. This is correctly reflected when requesting dependencies now:

bash-4.4# port deps kde4-kile
Full Name: kde4-kile @2.1.3_1
Build Dependencies:   cmake, pkgconfig, automoc
Library Dependencies: qt4-mac, phonon, kdelibs4
Runtime Dependencies: okular, kate, ImageMagick, ghostscript

No texlive is listed. Yet any upgrade command still triggers the reinstallation of texlive!

I have attached the output of

port -dy upgrade kde4-kile

The interesting bit reads something like

DEBUG: texlive is *not* installed by MacPorts
DEBUG: Searching for dependency: texlive
DEBUG: Didn't find receipt, going to depspec regex for: texlive

I cannot find the package that triggers the reinstallation, as I have no idea how to check for such port dependencies among the installed packages.

Attachments (3)

kde4-kile.txt (1.4 MB) - added by fusionfan 7 years ago.
output of 'port -dy upgrade kde4-kile'
rdepof_kde4-kile.txt (19.5 KB) - added by fusionfan 7 years ago.
Output of port list rdepof:kde4-kile - also doesn't list texlive!
kdelibs4.txt (1.4 MB) - added by fusionfan 7 years ago.
port -dy upgrade kdelibs4 &> kdelibs4.txt

Change History (24)

Changed 7 years ago by fusionfan

Attachment: kde4-kile.txt added

output of 'port -dy upgrade kde4-kile'

comment:1 Changed 7 years ago by fusionfan

Forgot to mention: /usr/texbin is added to the macports path

binpath         /usr/texbin:/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin

Changed 7 years ago by fusionfan

Attachment: rdepof_kde4-kile.txt added

Output of port list rdepof:kde4-kile - also doesn't list texlive!

comment:2 Changed 7 years ago by mkae (Marko Käning)

Cc: mkae added
Keywords: kde4-kile texlive mactex removed
Port: texlive added
Version: 2.3.5

Please mind the keyword guidelines.

Interesting find though, I hope someone can figure this out!

comment:3 in reply to:  1 ; Changed 7 years ago by mkae (Marko Käning)

Replying to fusionfan:

Forgot to mention: /usr/texbin is added to the macports path

binpath         /usr/texbin:/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin

This binpath is the one in macports.conf?

comment:4 in reply to:  3 Changed 7 years ago by fusionfan

Replying to mkae:

binpath         /usr/texbin:/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin

This binpath is the one in macports.conf?

Correct.

comment:5 Changed 7 years ago by mkae (Marko Käning)

Owner: set to nicos
Status: newassigned

comment:6 Changed 7 years ago by mkae (Marko Käning)

Owner: changed from nicos to NicosPavlov

comment:7 Changed 7 years ago by NicosPavlov

I cannot reproduce the issue, as in my case kde4-kile respects the requirements in binpath.

Please confirm the path you are entering. /usr/texbin is the original symlink used by MacTeX, but because Apple forbids changes in /usr since El Capitan, the main symlink has been changed to /Library/TeX/texbin in recent installations. It does work for me when employing that symlink. I am aware that you are using an older OS (10.9 according to the log), but I am not sure if all MacTeX installs have changed the path.

You are also mentioning that Kile does work fine when changing to MacTeX, and if that's the case, good for you. However, I noticed that several binaries are not necessarily found directly. I had made a +mactex variants in kde4-kile, which addresses some of the issues in finding TeX tools, which could be useful too.

comment:8 Changed 7 years ago by NicosPavlov

Additional note: the +mactex variant is however not supposed to solve the issue reported in the ticket directly. Furthermore, the patches in this case may be outdated, as they still rely on the older /usr/texbin path.

comment:9 Changed 7 years ago by fusionfan

Thank you for looking into the issue. I have explicitly added /Library/TeX/texbin to the macports binpath, which now reads as

binpath         /Library/TeX/texbin:/usr/texbin:/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin

and just to be sure

bash-4.4# which latex
/Library/TeX/texbin/latex

after doing this change to macports.conf, and rerunning

port list rdepof:kde4-kile

it now reports texlive as a dependency (it didn't before). Odd!

texlive-basic                  @41271          tex/texlive-basic
texlive-bin                    @2016           tex/texlive-bin
texlive-common                 @2016           tex/texlive-common

But at least now what it wants to do during the update and what it reports when I ask for dependencies is consistent (it wasn't before).

The output of

port deps kde4-kile

is still, however,

Full Name: kde4-kile @2.1.3_1
Build Dependencies:   cmake, pkgconfig, automoc
Library Dependencies: qt4-mac, phonon, kdelibs4
Runtime Dependencies: okular, kate, ImageMagick, ghostscript

Which makes it even more odd. It seems to me that whatever is collecting the dependencies for the port deps command is not the same as whatever is collecting dependencies for the upgrade. Any way to tell what the latter is? I would like to debug the issue but I just cannot figure out why macports still thinks that this is a dependency.

As for Kile working with MacTex: my installation predates my switch to MacTex. Therefore I have not installed the +mactex variant. I have probably changed the paths to binaries in the Kile configuration myself by hand, but it was a long time ago and I don't remember exactly. By looking at the portfile I have decided that the +mactex variant only changes these path settings, and since I have already done that, I deemed it unnecessary to reinstall that variant. I may be incorrect, but now I can't attempt to do so, because if I try a reinstall, again, macports wants to install the whole macports latex, which is exactly what I want to avoid.

comment:10 Changed 7 years ago by fusionfan

Hm. Do I misunderstand the way port list rdepof:XXX works? If I run it separately for the explicit dependencies of kde4-kile, it reports that kdelibs4, okular and kate all depend on texlive. But why should they? None of them list texlive as a dependency according to port deps.

If that is the case perhaps it isn't kde4-kile which is triggering the reinstallation of texlive. But how do I determine what triggers the reinstallation of a non-installed package when I want to perform an update of installed packages?

I have attached the output of port -dy upgrade kdelibs4. Can somebody tell me why would an update of kdelibs4 want to install latex packages?

Changed 7 years ago by fusionfan

Attachment: kdelibs4.txt added

port -dy upgrade kdelibs4 &> kdelibs4.txt

comment:11 Changed 7 years ago by NicosPavlov

In f8b10749/macports-ports:

libunistring: declare texlive as a binary dependency (related to ticket #53202)

comment:12 in reply to:  9 ; Changed 7 years ago by NicosPavlov

Hi, I take your comments not in the order you wrote them to answer to them, as my answer can be made more logical in that way.

Replying to fusionfan:

Thank you for looking into the issue. I have explicitly added /Library/TeX/texbin to the macports binpath, which now reads as

binpath         /Library/TeX/texbin:/usr/texbin:/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin

and just to be sure

bash-4.4# which latex
/Library/TeX/texbin/latex

Good. It is not directly related to the issue, but I would recommend to add your paths after Macports ones (i.e. /opt/local/bin:....:/Library/TeX/texbin). Adding paths is said to potentially lead to unintended behaviour, and the order you are using also potentially obfuscates Macports binaries. What matters in your case is to find tex binaries even if they are not in /opt/local/bin.

As for Kile working with MacTex: my installation predates my switch to MacTex. Therefore I have not installed the +mactex variant. I have probably changed the paths to binaries in the Kile configuration myself by hand, but it was a long time ago and I don't remember exactly. By looking at the portfile I have decided that the +mactex variant only changes these path settings, and since I have already done that, I deemed it unnecessary to reinstall that variant. [snip]

You are absolutely right. So if you did it yourself, there is no need to use the variant. Also, your changes should be at user level, and should not be overwritten by an upgrade, although I am not 100% sure about that.

after doing this change to macports.conf, and rerunning

port list rdepof:kde4-kile

it now reports texlive as a dependency (it didn't before). Odd!

[snip]

Which makes it even more odd. It seems to me that whatever is collecting the dependencies for the port deps command is not the same as whatever is collecting dependencies for the upgrade. Any way to tell what the latter is? I would like to debug the issue but I just cannot figure out why macports still thinks that this is a dependency.

I am not sure about the use of rdepof, but please not that kde4-kile should list a dependency to texlive anyway. The point is that it is declared as a binary dependency, so that if Macports finds the binaries, it will not install the required ports.

I have attached the output of port -dy upgrade kdelibs4. Can somebody tell me why would an update of kdelibs4 want to install latex packages?

It appears that you do not have libnunistring installed, which itself declared texlive as a port dependency. I changed it to a binary dependency (see comment above) which should avoid the forced installation of texlive.

comment:13 in reply to:  12 Changed 7 years ago by fusionfan

Replying to NicosPavlov:

Thanks again!

I am not sure about the use of rdepof, but please not that kde4-kile should list a dependency to texlive anyway. The point is that it is declared as a binary dependency, so that if Macports finds the binaries, it will not install the required ports.

So here lie 2 issues

  • It still wants to install the latex ports, hence it seems it doesn't find the binaries, despite the fact that
    1. the binaries are there
    2. the path is updated and
    3. kile runs without issues.
  • I have made a local variant where I have explicitly removed any texlive dependencies in an attempt to solve the problem. Yet it _still_ wants to install texlive upon update, even though it is removed now.

But, as I have said above, it may not be kde4-kile triggering the reinstallation.

I have attached the output of port -dy upgrade kdelibs4. Can somebody tell me why would an update of kdelibs4 want to install latex packages?

It appears that you do not have libnunistring installed, which itself declared texlive as a port dependency. I changed it to a binary dependency (see comment above) which should avoid the forced installation of texlive.

It will sound very noobish (and probably belongs to a forum / e-mail list rather than a bug ticket), but despite my effort of running a selfupdate and a sync, this recent change is not represented in my local portfile. Hence when I tried to install libunistring it still wants to pull all the whole latex bundle. What am I missing?

comment:14 Changed 7 years ago by NicosPavlov

You need to wait some time before selfupdating, to ensure that the changes are reflected on the server. You can also check the state of libunistring with

port cat libunistring

to be sure that the changes were applied on your local copy.

comment:15 Changed 7 years ago by fusionfan

Thank you. I was actually getting impatient, so I manually overwrote my local porfile with

https://raw.githubusercontent.com/macports/macports-ports/master/textproc/libunistring/Portfile

to test if upon installation whether it wants to install texlive or not. Unfortunately, it first wants to update kdelibs4, which triggers the reinstallation of texlive. So I am back to square 1: it seems the update of kdelibs4 triggers the installation of texlive, and I have no way of telling why, or how to prevent it.

comment:16 Changed 7 years ago by NicosPavlov

Without any log, I can't say much, and checking the dependency tree of kdelibs4 does not show any other port requiring texlive. However, you are requiring the +docs variant, which is quite likely to request ports which need texlive (to compile documentation, for instance). If you do not specifically need that variant, trying to run

sudo port upgrade kdelibs4 -docs

could remove some dependencies which are triggering the installation of texlive.

EDIT: At least jasper and doxygen with +docs variant require texlive-latex

Last edited 7 years ago by NicosPavlov (previous) (diff)

comment:17 Changed 7 years ago by fusionfan

Thank you very much. This makes sense. I have no idea why all ports are installed with the docs variants, I have never configured it as such myself. In fact I would prefer not to have it: I never use the local docs, it occupies space, and leads to complications. I will try removing the docs variants. does it makes sense to add "-docs" in /opt/local/etc/macports/variants.conf ?

comment:18 Changed 7 years ago by fusionfan

You sir are a steely-eyed missile man! -docs seem to have resolved the issue: I managed to update kdelibs4 without it trying to install latex. Perhaps some other packages should be revised on the longer run to only require latex as a runtime dependency?

As to why were my packages installed with the +docs variant is a mystery to me, as I have not set it up as such myself, and the variants.conf did not contain the +docs.

comment:19 in reply to:  18 ; Changed 7 years ago by NicosPavlov

Replying to fusionfan:

You sir are a steely-eyed missile man! -docs seem to have resolved the issue: I managed to update kdelibs4 without it trying to install latex.

Good. I'll then update the paths in kde4-kile (since you confirmed that even older systems use the newer one), and close the ticket.

Perhaps some other packages should be revised on the longer run to only require latex as a runtime dependency?

Possibly, but this involves several packages, which could involve some work out of the scope of this ticket in my opinion. I'll have a look at it.

As to why were my packages installed with the +docs variant is a mystery to me, as I have not set it up as such myself, and the variants.conf did not contain the +docs.

This is a wild guess, but it is possible that a port had a default +docs variant, which then propagated to others, but I may be wrong here.

comment:20 in reply to:  19 Changed 7 years ago by fusionfan

Replying to NicosPavlov:

Good. I'll then update the paths in kde4-kile (since you confirmed that even older systems use the newer one), and close the ticket.

I think these paths depend on the MacTex version rather than the OS version. In my experience newer versions install in the new path even on older systems. But it also puts a legacy symlink in the old place for backwards compatibility.

Perhaps some other packages should be revised on the longer run to only require latex as a runtime dependency?

Possibly, but this involves several packages, which could involve some work out of the scope of this ticket in my opinion. I'll have a look at it.

Of course this is out of the scope, and can only be executed on a longer term.

Thank you for all the help!

comment:21 Changed 7 years ago by NicosPavlov

Resolution: fixed
Status: assignedclosed

In dabf0dea/macports-ports:

kde4-kile: update path used in case of MacTeX to new one (closes #53202)

Note: See TracTickets for help on using tickets.