Speed up trace mode Project GSoC

Marcus Calhoun-Lopez mcalhoun at macports.org
Wed Mar 20 21:38:20 UTC 2019


Greetings Mihir,

I am responding to this message on the developer mailing list in case anyone else has more insight than I.

> Basically, user may have installed packages or files in past which reside in certain locations.(e.g. /usr/local)


Although trace made may help identify problems with software installed in /opt/local (or /sw), the official policy of MacPorts is that installing software into /usr/local is unsupported [1].

> Now when MacPorts is installing a new package, the name of files may conflict with those pre installed(by the user) and create unpredictable dependencies unnecessarily increasing build time or errors.
> The function of trace mode is to scan all locations that the package to be installed will access and hide files which are not needed.


Trace mode has a few uses.
* As you noted, it can help track down times when port look in /usr/local for its dependencies.
* It can help track down times when ports look in /sw (from Fink) for its dependencies.
* It can help track down times when ports look in /opt/local (instead of ${prefix}, which is not *always* /opt/local) for dependencies.
* It can help track down times when ports look for dependencies installed by MacPorts do not *declare* those dependencies.
Yes, trace mode attempts to hide the files that are not part of the system and are not declared as dependencies of the port.
MacPorts then issues warnings that there was an attempt to access these “hidden” files.

As you noted, trace mode slows things down quite a bit.
It also breaks some ports.

> I don’t have any experience with tcl(But I have worked with scripting languages such as unix shell scripting & python)


Learning Tcl should not be too difficult, especially since you are already familiar with other languages.
The GSoC website has a link to a Tcl tutorial [2].

Please let me know if I have not fully answered your questions.

-Marcus

[1] https://trac.macports.org/wiki/FAQ#usrlocal
[2] https://trac.macports.org/wiki/SummerOfCode#Whatyoushoulddobeforehandinginanapplication

> On Mar 17, 2019, at 12:27 AM, Mihir Luthra <1999mihir.luthra at gmail.com> wrote:
> 
> Hi there,
> 
> I wanted to contact you regarding the “Speed Up trace mode” project.
> I gave a quick read to the documentation to get the basic understanding of MacPorts.
> 
> I am giving a small description on what I understood,
> 
> Basically, user may have installed packages or files in past which reside in certain locations.(e.g. /usr/local)
> Now when MacPorts is installing a new package, the name of files may conflict with those pre installed(by the user) and create unpredictable dependencies unnecessarily increasing build time or errors.
> The function of trace mode is to scan all locations that the package to be installed will access and hide files which are not needed.
> But enabling trace mode makes the build process really long.
> So what we have to do is optimise the trace mode library by using better data structures or improvising it.
> 
> I have a really nice experience with C(almost 4 years now)
> I don’t have any experience with tcl(But I have worked with scripting languages such as unix shell scripting & python)
> 
> 
> I would really appreciate getting some pieces of advice from you and if I have misunderstood the project please consider giving me light of clarity.
> 
> Regards,
> 
> Mihir Luthra
> Student in B.Tech. CSE, ABESIT Ghaziabad, India
> +91 9810702672
> 



More information about the macports-dev mailing list