Greetings Arghya, I am responding to this message on the developer mailing list in case anyone else has more insight than I.
A minor point: you may want to avoid the word “trace” in this context since trace has another meaning in MacPorts [1,2,3]. Quite a bit of information on the registry can be found in the video Introduction to MacPorts Base at around the 55 minute mark [4]. Just to give you a start, let us look at the code that writes the dependencies the the registry during the install phase [5]. We see that the values of `$dep_portnames` are written into the database. Elsewhere in the code, we see that `$dep_portnames` consists *only* of library and run dependencies (not build dependencies) [6]. Later, in the reclaim portion of the MacPorts API [7], the dependencies read from the database do not include build dependencies, which leads to the questionable behavior of `port reclaim` [8,9]. More information on the MacPorts API can be found at the 14 minute mark of the video Introduction to MacPorts Base [10]. About a year ago, the C++ stdlib started being recorded in the registry [11]. This might be a model of how to proceed. I am not sure I have answered your questions. If not, please feel free to ask for further clarification. -Marcus [1] https://guide.macports.org/#using.port.install [2] the man page for `port` [3] https://youtu.be/46qshiDskrM?t=4680 [4] https://youtu.be/46qshiDskrM?t=3330 [5] https://github.com/macports/macports-base/blob/4eb0095fb006ff5fb9d1a6a471c2a022f73a1aa1/src/port1.0/portinstall.tcl#L405 [6] https://github.com/macports/macports-base/blob/4eb0095fb006ff5fb9d1a6a471c2a022f73a1aa1/src/port1.0/portinstall.tcl#L367 [7] https://github.com/macports/macports-base/blob/4eb0095fb006ff5fb9d1a6a471c2a022f73a1aa1/src/macports1.0/reclaim.tcl#L523 [8] https://trac.macports.org/wiki/SummerOfCode#reclaim [9] https://lists.macports.org/pipermail/macports-users/2019-January/thread.html#46344 [10] https://youtu.be/46qshiDskrM?t=847 [11] https://github.com/macports/macports-base/commit/2564ab3eb1ebe37209073176f7d085ba1b2177df > On Mar 10, 2019, at 6:30 AM, Arghya Bhattacharya > <arghy...@research.iiit.ac.in> wrote: > > Hello Marcus! > > Hope you're doing well. :D > > I'm planning to write a proposal for the project Auto-Detection of Build > Dependencies(+ fixing the behaviour of port reclaim) and have a few doubts > regarding the same. > > From my discussion with Mojca on the mailing list following is my insight on > how to go about this: > > -> Update the way port information is stored in the registry to include build > dependencies as a separate list. > -> Use this list to change the behaviour of port reclaim. > > I looked up the way MacPorts currently "traces" the installation process but > couldn't really get a hang of it. Could you provide an insight into how the > trace mode works? That would be helpful in the way I'm going to identify the > build dependencies for this project. > > Also, some information on how I should go about the port registry and more on > updating it would be great! > > > Regards > Arghya Bhattacharya