Code Monkey home page Code Monkey logo

Comments (7)

scottmac avatar scottmac commented on May 22, 2024

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.

from hhvm.

serphen avatar serphen commented on May 22, 2024

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

from hhvm.

chrisgraham avatar chrisgraham commented on May 22, 2024

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.

from hhvm.

chrisgraham avatar chrisgraham commented on May 22, 2024

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.

from hhvm.

chrisgraham avatar chrisgraham commented on May 22, 2024

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.

from hhvm.

scottmac avatar scottmac commented on May 22, 2024

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?

from hhvm.

chrisgraham avatar chrisgraham commented on May 22, 2024

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.

from hhvm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.