Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Needs a way to be able to specify the build path #37

Closed
chrisgraham opened this issue Feb 22, 2010 · 7 comments
Closed

Needs a way to be able to specify the build path #37

chrisgraham opened this issue Feb 22, 2010 · 7 comments

Comments

@chrisgraham
Copy link

From what I can tell right now every time you build it has to recompile everything, and then puts 'program' in a non-predictable path.

  1. I have had to fiddle around tweaking the .cpp files to avoid the full rebuild, as it takes a long time to rebuild on my system.
  2. It is hard to write scripts if you can't control the output paths.

I'd really like to be able to say something like "--output-dir=."

@scottmac
Copy link
Contributor

Try installing ccache to speed up the compile time.

You can use --keep-tempdir=1 and it will output to /tmp so you can grab the code there.

@serphen
Copy link
Contributor

serphen commented Feb 22, 2010

Or just,
./hphp -k 1 blabla.php -o /home/my_dev
Then program is at: /home/my_dev/program

@chrisgraham
Copy link
Author

Thanks for the help guys, but whoa, the "-o" option is lethal. It deletes everything under the directory you specify without warning or confirmation, and the "--help" for hphp doesn't indicate the risk.
Something really needs doing there- maybe warn if the directory isn't empty and doesn't just contain expected hphp build files.

@chrisgraham
Copy link
Author

Right, this has been frustrating me a lot this weekend. I have a huge code base, so it takes a few hours to compile. But right now I have now way to tweak the PHP code to debug through things without launching a full recompile. I installed ccache via apt, but that doesn't seem to have made any difference. "--keep-tempdir" isn't helpful as that'll allow me to modify the C++ but not make iterative changes to the PHP (unless there's some technique I don't know). I think there really needs to be an option like "--resync=no" that allows you to compile the PHP back on top of an existing "-o" dir (instead of erasing and rebuilding each time), and hphp be smart enough to not overwrite any cpp/h files that would be the same as those already there - then make would work for a partial rebuild.

@chrisgraham
Copy link
Author

A bit more feedback on this issue...

ccache does actually seem to help now. I can do a re-compile in about 1.5 hours instead of about 8 hours, so that's a big improvement.

However, I think it's really not necessary. I did a test - I modified a cpp file, and then manually re-ran make. It was smart enough to see the cpp had changed and then recompile it. I also see hphp is smart enough to only recreate cpp files if they really have changed - so make will see they don't need rebuilding when they don't, but will rebuild when it needs to.
So it seems like it would be trivial to simply not delete the .o files on a rebuild. In fact, I'm gonna make my rebuild sync move them then move them back, as a manual workaround.

I know this isn't a bug as such, but saving hours of people's builds for such little effort seems like a big win.

@scottmac
Copy link
Contributor

scottmac commented Jul 7, 2010

When you make changes to the PHP files it changes the CPP files since the macros for tracking the line numbers are no longer valid.

Have you used export MAKEOPTS="-j4" to build things in parallel?

@chrisgraham
Copy link
Author

I haven't tried MAKEOPTS, thanks for the tip!

But in terms of PHP line numbers, surely that only matters if you change a particular file anyway? I've got 1919 PHP files in my codebase, so most won't change.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants