Re: Xcode PortGroup: Xcode compiles code twice?
the xcode portgroup has always done this. it builds everything in the build phase, and then builds everything again in the destroot phase. we have discussed this over the years and the previous conclusion was that this was completely unavoidable, and we’d just have to live with it. sometimes I just disable the build phase build {} to save time when I’m working on a big port. K
Re: Xcode PortGroup: Xcode compiles code twice?
On Tue, 15 Aug 2023, Jason Liu wrote: Yes, you're right that clearing the build phase doesn't prove anything, but I'm not sure I'm following your other point. Are you saying that "make install" will compile the source code? I was under the impression that you need to manually run "make" in order to actually compile the source code, hence the traditional magic formula of './configure ; make ; make install'. Without the first make, the "make install" shouldn't have anything to install. Or am I wrong about that? Normally, "make install" implies "make" via dependencies, since with properly constructed dependencies, make will notice that it's trying to install something that hasn't been built, and correct that. The main advantage of doing them separately is that "make" doesn't require sudo, while "make install" usually does. If you skip the separate "make" without sudo, then the implied build products wind up owned by root, and even "make clean" requires sudo. Fred Wright
Re: Xcode PortGroup: Xcode compiles code twice?
Yes, you're right that clearing the build phase doesn't prove anything, but I'm not sure I'm following your other point. Are you saying that "make install" will compile the source code? I was under the impression that you need to manually run "make" in order to actually compile the source code, hence the traditional magic formula of './configure ; make ; make install'. Without the first make, the "make install" shouldn't have anything to install. Or am I wrong about that? -- Jason Liu On Tue, Aug 15, 2023 at 2:54 PM Joshua Root wrote: > 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 >
Re: Xcode PortGroup: Xcode compiles code twice?
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
Xcode PortGroup: Xcode compiles code twice?
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}. -- Jason Liu