mrdavidlaing / pressupbox-development-boilerplate

Patterns and practices for teams to collaborating on WordPress projects
Other
1 stars 5 forks source link

HipHop fails to start with error: Unable to find/load systemlib.php #3

Closed mrdavidlaing closed 11 years ago

mrdavidlaing commented 11 years ago

This seems to be caused by trying to enable Jit compiliation, as happens when setting loglevel to None or Error.

To replicate on the dev server:

vagrant@precise64:~$ grunt rebuild
Running "clean:test" (clean) task
...snip...
Running "compile-buildpack" task
...snip...
-----> Done with compile

Done, without errors.

vagrant@precise64:~$ cd ~/dist
vagrant@precise64:~/dist$ bin/start.sh 4567 Error
-----> BASE_DIR: /home/vagrant/dist
-----> Writing config files...
-----> Using LOGLEVEL: Error [options: None | Error (default) | Warning | Info | Verbose ]
-----> Starting HipHop VM v2.0.0 (rel)
Unable to find/load systemlib.php
mrdavidlaing commented 11 years ago

The error seems to be being thrown by this block of code which contains the following potentially helpful comment:

// Search for systemlib.php in the following places:
  // 1) ${HHVM_LIB_PATH}/systemlib.php
  // 2) <dirname(realpath(hhvm))>/systemlib.php (requires proc filesystem)
  // 3) ${HPHP_LIB}/systemlib.php
  // 4) <HHVM_LIB_PATH_DEFAULT>/systemlib.php
  //
  // HHVM_LIB_PATH allows a manual override at runtime. If systemlib.php
  // exists next to the hhvm binary, that is likely to be the next best
  // version to use. The realpath()-based lookup will succeed as long as the
  // proc filesystem exists (e.g. on Linux and some FreeBSD configurations)
  // and no hard links are in use for the executable. Under certain build
  // situations, systemlib.php will not be generated next to hhvm binary, so
  // ${HPHP_LIB} is checked next. Failing all of those options, the
  // HHVM_LIB_PATH_DEFAULT-based lookup will always succeed, assuming that the
  // application was built and installed correctly.

we bundle systemlib.php into runtimes/hiphop-php/bin/, the same folder as hhvm.

At a guess, we're missing a env variable config?

daithi-coombes commented 11 years ago

agreed. I tried echoing that environment variable:

echo $HHVM_LIB_PATH

printed a blank line

daithi-coombes commented 11 years ago

@mrdavidlaing don't have permission to create/push feature branch.

add the following line to the vagrantfile:

#set environment variables
echo -e "#Set environment variables\nexport HHVM_LIB_PATH=/home/vagrant/dist/runtimes/hiphop-php/bin/" >> /etc/profile
#end set environment variables

Have set up the comment block as this might be the best place for future/all 3rd party environment variables?

mrdavidlaing commented 11 years ago

@david-coombes I've given you collaboration rights on the repo; so you should be able to create pull requests now

mrdavidlaing commented 11 years ago

@david-coombes A tip to speed up testing changes to the provisioning script - vagrant provision reruns the provisioning script without having to restart the VM

daithi-coombes commented 11 years ago

@mrdavidlaing, creating env block in Vagrantfile the last commit: f3ec4e4 will stop the environment variables from being written twice to /etc/profile also there is a declaration for ruby env vars that is made only when ruby is installed, maybe this should be moved to the same block as above commit? keep all env var declarations in the one place? https://github.com/mrdavidlaing/pressupbox-development-boilerplate/blob/master/Vagrantfile#L41

env HHVM_LIB_PATH created, crash persists When calling the ~/dist/bin/start.sh script passing certain log levels to it won't cause a crash:

~/dist/bin/start.sh 4567 Verbose #'perf_event_open failed' error but runs
~/dist/bin/start.sh 4567 Warning #starts without the 'perf_event_open failed...' error
~/dist/bin/start.sh 4567 Info #no 'perf_event_open failed' error and gives better information than warning

but error level None|Error crashes.

issue lies somewhere else On line 27 of ~/dist/bin/start.sh the HHVM_LIB_PATH env is changed. I have commented out the offending line in the vm but the error persists. Issue could then be a problem with hhvm, with error level set it is looking in the wrong directory initally, throwing an error an exiting. If no error reporting then after intital fail, the flow continues and later it finds the file correctly?

solution call ~/dist/bin/start.sh 4567 Info and submit issue on hhvm repository

mrdavidlaing commented 11 years ago

I think its more important to keep everything related to a particular "component" installation together; since these are the "blocks" you are probably going to want to remove.

I believe that the reason the None|Error cause the error is that these are the only "log levels" which cause the config file to switch Jit=true

Whilst I don't agree with your theory; I do think that asking for help on the HipHop-PHP repo/mailing list is the correct next step.

Specifically, I think we're setting the HHVM_LIB_PATH var correctly, yet when using the hhvm from the Ubuntu 12.04 package it seems to ignore this, suggesting that that setting is perhaps hardcoded in that build?

Please could you figure out how we ask this kind of question to the HipHop-Php project maintainers.

daithi-coombes commented 11 years ago

Created issue on hiphops github repository: https://github.com/facebook/hiphop-php/issues/724

mrdavidlaing commented 11 years ago

I'm going to close this PR until the upstream issue - facebook/hiphop-php#724 - is resolved.