Xcode PortGroup: Xcode compiles code twice?

Joshua Root jmr at macports.org
Tue Aug 15 18:54:22 UTC 2023


On 16/8/2023 04:29, Jason Liu wrote:
> Hi everyone,
> 
> I'm working on a Portfile that uses the xcode PortGroup, and I've 
> noticed something that surprised me: It seems that the MacPorts build is 
> compiling the source code during the build phase, and then compiling the 
> source code AGAIN during the destroot phase? Is this correct, or am I 
> starting to hallucinate? Because when I add a 'build {}' to my Portfile, 
> which in theory should cause nothing to be compiled, all of the compiled 
> products are still somehow coming into existence and getting placed into 
> ${destroot}.

I don't know if your project is in fact building things twice, but 
clearing the build phase doesn't prove anything one way or the other, 
because the install target depends on the targets that build the program 
and will thus run them first. You will usually see a similar thing 
happen if you just run 'make install' with a makefile based project.

- Josh


More information about the macports-dev mailing list