facebook / hhvm

A virtual machine for executing programs written in Hack.
https://hhvm.com
Other
18.21k stars 3k forks source link

hh_client unbound errors #3508

Closed milesj closed 10 years ago

milesj commented 10 years ago

When running hh_client it spews out tons and tons of unbound names/constants for all the PHP built-ins. I thought the .hhi lists were built into HHVM starting in 3.0? I tried adding the .hhi files to the project and then it errors with this:

/vagrant/lib/stdlib/builtins_fb.idl.hhi:44:10,22: Name already bound: xhprof_enable
  /tmp/hh_server_vagrant/hhi_36858188/stdlib/builtins_fb.idl.hhi:45:10,22: Previous definition is here
  /vagrant/lib/stdlib/builtins_fb.idl.hhi:44:10,22: This appears to be defined in an hhi file included in your project root. The hhi files for the standard library are now a part of the typechecker an
d must be removed from your project. Typically, you can do this by deleting the "hhi" directory you copied into your project when first starting with Hack.

How can I get this working correctly? I'm using the following version.

HipHop VM 3.3.0-dev+2014.08.07 (rel) Compiler: heads/master-0-g60d27550e305d92463469de2b16fc125bae8d79a Repo schema: 799af9838b08dd7fe18d2b38f497723cb008cdcf Extension API: 20140702

On a side note, it seems hh_client doesn't reflect any changes I made between each call. How can I reset this?

jwatzman commented 10 years ago

When running hh_client it spews out tons and tons of unbound names/constants for all the PHP built-ins.

Part of the error you linked says this:

/vagrant/lib/stdlib/builtins_fb.idl.hhi:44:10,22: This appears to be defined in an hhi file included in your project root. The hhi files for the standard library are now a part of the typechecker an
d must be removed from your project. Typically, you can do this by deleting the "hhi" directory you copied into your project when first starting with Hack.

Have you tried doing this? If you find the error message confusing, can you explain what is confusing or what you don't understand so we can clarify it?

On a side note, it seems hh_client doesn't reflect any changes I made between each call. How can I reset this?

This is a specific problem with Vagrant and the way it uses VirtualBox to sync documents into the VM. I bet you are editing on the host and running hh_client on the guest, right? When you save a file on the host, the right inotify events aren't generated in the guest kernel, and so hh_client doesn't know the file has changed. The same problem would occur if you edited a file residing in NFS on one NFS client and ran hh_client on another NFS client -- it wouldn't pick up the changes for similar reasons. You can:

milesj commented 10 years ago

I've tried running hh_client with the .hhi files in the project and without them and I still get unbound errors.

As for the Vagrant issue, that's definitely it. I'll look into these options, thanks.

jwatzman commented 10 years ago

I've tried running hh_client with the .hhi files in the project and without them and I still get unbound errors.

The same errors? If you deleted them via the Vagrant host, you'll run into the same issue as editing the files on the host, so did you try hh_client restart? If it's still spewing after that, can pastebin the full errors and link to it here?

milesj commented 10 years ago

Restarting Vagrant and hh_client seemed to fix the problem. Thanks for all the tips on Vagrant usage.

On a side note, is there a support/help forum of any sort? I have a ton of Hack questions/how to's but don't want to post them here.

jwatzman commented 10 years ago

If you have a question that's appropriate for the StackOverflow format, feel free to post it there and tag it "hacklang". Several folks, both on the team at FB and knowledgeable community members, monitor that tag, and it also is a good resource for future people who may have the same question :)

For more real-time discussion or for questions that are less appropriate for SO, lots of people hang out in #hhvm on Freenode. Members of the FB team are there during working hours US Pacific time, and there are, again, knowledgeable community members there as well.