Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

2.x-dev was recommened in README, composer resolved it to the old 'hack' branch which doesn't typecheck #144

Closed
jdsjdk opened this issue Jun 29, 2015 · 11 comments

Comments

@jdsjdk
Copy link

jdsjdk commented Jun 29, 2015

So, I recently installed XHP with the latest version of HHVM, and I setup the Hack type checker. When I run "hh_client", I get these errors:

/var/www/html/json/vendor/facebook/xhp-lib/src/core/ComposableElement.php:504:12,13: Invalid return type (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/src/core/ComposableElement.php:502:6,10: This is an array (used like a hashtable)
/var/www/html/json/vendor/facebook/xhp-lib/src/core/ComposableElement.php:504:12,13: It is incompatible with void ($_ is a placeholder variable not meant to be used)
/var/www/html/json/vendor/facebook/xhp-lib/src/core/ComposableElement.php:513:12,13: Invalid return type (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/src/core/ComposableElement.php:511:51,55: This is an array (used like a hashtable)
/var/www/html/json/vendor/facebook/xhp-lib/src/core/ComposableElement.php:513:12,13: It is incompatible with void ($_ is a placeholder variable not meant to be used)
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesCoercionModeTest.php:50:47,49: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesCoercionModeTest.php:5:5,7: This is an int
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesCoercionModeTest.php:50:47,49: It is incompatible with a string
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesCoercionModeTest.php:58:48,51: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesCoercionModeTest.php:5:5,7: This is an int
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesCoercionModeTest.php:58:48,51: It is incompatible with a float
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesCoercionModeTest.php:66:50,50: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesCoercionModeTest.php:6:5,9: This is a float
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesCoercionModeTest.php:66:50,50: It is incompatible with an int
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesCoercionModeTest.php:74:51,51: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesCoercionModeTest.php:7:5,10: This is a string
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesCoercionModeTest.php:74:51,51: It is incompatible with an int
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesCoercionModeTest.php:82:49,49: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesCoercionModeTest.php:8:5,8: This is a bool
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesCoercionModeTest.php:82:49,49: It is incompatible with an int
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesCoercionModeTest.php:90:48,53: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesCoercionModeTest.php:8:5,8: This is a bool
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesCoercionModeTest.php:90:48,53: It is incompatible with a string
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesCoercionModeTest.php:96:51,51: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesCoercionModeTest.php:7:5,10: This is a string
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesCoercionModeTest.php:96:51,51: It is incompatible with an int
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesCoercionModeTest.php:105:53,53: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesCoercionModeTest.php:7:5,10: This is a string
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesCoercionModeTest.php:105:53,53: It is incompatible with an int
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesCoercionModeTest.php:112:51,51: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesCoercionModeTest.php:7:5,10: This is a string
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesCoercionModeTest.php:112:51,51: It is incompatible with an int
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:55:17,34: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:12:12,17: This is a string
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:55:26,26: It is incompatible with an int
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:66:42,66: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:5:5,10: This is a string
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:66:42,66: It is incompatible with an object of type StringableTestClass
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:71:42,44: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:5:5,10: This is a string
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:71:42,44: It is incompatible with an int
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:79:42,61: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:5:5,10: This is a string
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:79:42,61: It is incompatible with an object of type EmptyTestClass
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:86:42,69: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:5:5,10: This is a string
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:86:42,69: It is incompatible with an object; this class name is unknown to Hack
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:93:42,42: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:5:5,10: This is a string
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:93:42,42: It is incompatible with an array
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:97:39,43: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:7:5,7: This is an int
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:97:39,43: It is incompatible with a string
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:102:39,42: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:7:5,7: This is an int
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:102:39,42: It is incompatible with a float
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:107:38,43: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:7:5,7: This is an int
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:107:38,43: It is incompatible with a string
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:115:39,58: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:7:5,7: This is an int
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:115:39,58: It is incompatible with an object of type EmptyTestClass
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:122:39,66: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:7:5,7: This is an int
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:122:39,66: It is incompatible with an object; this class name is unknown to Hack
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:129:39,39: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:7:5,7: This is an int
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:129:39,39: It is incompatible with an array
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:136:38,46: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:7:5,7: This is an int
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:136:38,46: It is incompatible with a string
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:140:39,44: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:6:5,8: This is a bool
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:140:39,44: It is incompatible with a string
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:145:39,45: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:6:5,8: This is a bool
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:145:39,45: It is incompatible with a string
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:153:39,45: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:6:5,8: This is a bool
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:153:39,45: It is incompatible with a string
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:161:39,42: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:6:5,8: This is a bool
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:161:39,42: It is incompatible with a string
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:167:39,46: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:6:5,8: This is a bool
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:167:39,46: It is incompatible with a string
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:179:41,43: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:11:5,9: This is a float
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:179:41,43: It is incompatible with an int
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:184:40,44: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:11:5,9: This is a float
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:184:40,44: It is incompatible with a string
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:186:40,45: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:11:5,9: This is a float
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:186:40,45: It is incompatible with a string
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:194:40,49: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:11:5,9: This is a float
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:194:40,49: It is incompatible with a string
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:201:40,48: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:11:5,9: This is a float
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:201:40,48: It is incompatible with a string
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:208:41,60: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:8:5,9: This is an array
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:208:41,60: It is incompatible with an object of type EmptyTestClass
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:215:41,56: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:8:5,9: This is an array
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:215:41,56: It is incompatible with an object of type Vector
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:222:42,61: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:9:5,12: This is an object of type stdClass
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:222:42,61: It is incompatible with an object of type EmptyTestClass
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:229:42,42: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:12:5,10: This is an object of type Vector
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:229:42,42: It is incompatible with an array (used like a vector)
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:262:35,45: Could not find member :idonotexist in an object of type :test:default-attributes (Typing[4053])
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:262:11,55: This is why I think it is an object of type :test:default-attributes
/var/www/html/json/vendor/facebook/xhp-lib/tests/AttributesTest.php:29:7,30: Declaration of :test:default-attributes is here
/var/www/html/json/vendor/facebook/xhp-lib/tests/HackEnumAttributeTest.php:26:41,41: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/HackEnumAttributeTest.php:10:5,12: This is an object of type TestEnum
/var/www/html/json/vendor/facebook/xhp-lib/tests/HackEnumAttributeTest.php:26:41,41: It is incompatible with an int
/var/www/html/json/vendor/facebook/xhp-lib/tests/HackEnumAttributeTest.php:28:41,41: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/HackEnumAttributeTest.php:10:5,12: This is an object of type TestEnum
/var/www/html/json/vendor/facebook/xhp-lib/tests/HackEnumAttributeTest.php:28:41,41: It is incompatible with an int
/var/www/html/json/vendor/facebook/xhp-lib/tests/HackEnumAttributeTest.php:36:41,41: Invalid xhp value (Typing[4110])
/var/www/html/json/vendor/facebook/xhp-lib/tests/HackEnumAttributeTest.php:10:5,12: This is an object of type TestEnum
/var/www/html/json/vendor/facebook/xhp-lib/tests/HackEnumAttributeTest.php:36:41,41: It is incompatible with an int

You guys might want to look into this. By the way, I am running Debian 8.1 with HHVM-3.7.2-0.

@fredemmott
Copy link
Contributor

What version of XHP-Lib?

fred@hhvm-oss-bench:~/xhp-lib$ git checkout 2.1.0
Note: checking out '2.1.0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 3923d04... Automatically call transferAttributes as needed.
fred@hhvm-oss-bench:~/xhp-lib$ hhvm --version
HipHop VM 3.7.2 (rel)
Compiler: tags/HHVM-3.7.2-0-gfc9f29b2799933d8215faaadfa83de722df64e26
Repo schema: 34f16546e395aed44ad434467b6f96c89b0d8a8b
fred@hhvm-oss-bench:~/xhp-lib$ hh_client
No errors!
fred@hhvm-oss-bench:~/xhp-lib$ hh_server --check $(pwd)
[2015-05-29 09:51:05] Parsing ... 0.416398
[2015-05-29 09:51:05] Heap size: 3442816
[2015-05-29 09:51:05] Naming ... 0.012261
[2015-05-29 09:51:05] Type-decl ... 0.129577
[2015-05-29 09:51:05] Heap size: 9055872
[2015-05-29 09:51:05] Type-check ... 0.335931
No errors!

@fredemmott
Copy link
Contributor

Every version since 2.0.1 has no errors for me.

@fredemmott
Copy link
Contributor

It looks like you're using the dev-hack branch, which is unsupported (see http://facebook.github.io/xhp-lib/2015/03/04/composer-branches-2.0.html)

You probably want to migrate to '~2.2.0' or' ~2.2'

Will re-open if you are having this problem on 'master' or a current 2.x release.

@jdsjdk
Copy link
Author

jdsjdk commented Jun 29, 2015

umm... ya, I have this for my composer.json file:
{
"require": {
"facebook/xhp-lib": "2.x-dev"
}
}

and when I run the type checker, I get those errors.

fredemmott added a commit that referenced this issue Jun 29, 2015
This is also set to master, and composer seems to be preferikng the older one.

refs #144
@fredemmott
Copy link
Contributor

packagist.org showed that as resolving to both dev-hack and dev-master :( I've removed it from dev-hack

  • composer update should fix things
  • I'd still strongly recommend switching to stable releases instead of following the branch

@jdsjdk
Copy link
Author

jdsjdk commented Jun 29, 2015

Please update the XHP documentation to reflect this. Once I changed my 'composer.json' file to this:

{
"require": {
"facebook/xhp-lib": "2.x"
}
}

It fixed the problem right away after I did the update. But the problem with the main XHP documentation, is that it says to do it the other way.

@fredemmott
Copy link
Contributor

That modification to the branch appears to have fixed 2.x-dev

fred@hhvm-oss-bench:~$ mkdir xhp-test
fred@hhvm-oss-bench:~$ cd xhp-test
fred@hhvm-oss-bench:~/xhp-test$ cat > composer.json
{
"require": {
"facebook/xhp-lib": "2.x-dev"
}
}
fred@hhvm-oss-bench:~/xhp-test$ hhvm ~/composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev)
  - Installing facebook/xhp-lib (dev-master 1f3a2c6)
    Cloning 1f3a2c632d0ea2415f71cfee8cdfc63d29b365b3

Writing lock file
Generating autoload files
fred@hhvm-oss-bench:~/xhp-test$ touch .hhconfig
fred@hhvm-oss-bench:~/xhp-test$ hh_client
Server launched with the following command:
    'hh_server' -d '/home/fred/xhp-test'
Spawned hh_server (child pid=16246)
Logs will go to /tmp/hh_server/zShomezSfredzSxhp-test.log
No errors!

fredemmott added a commit that referenced this issue Jun 29, 2015
@jdsjdk
Copy link
Author

jdsjdk commented Jun 29, 2015

Well unfortunately Fred, I wasn't seeing that when I was on 2.x-dev. I could try to change it back to see if I get errors to help you debug. :-)

@fredemmott
Copy link
Contributor

2786dc7 fixed 2.x-dev

If you still have that after running composer update, try removing your composer.lock, vendor/, and re-running composer.install. If you still have it after that, we'll need to debug some more :)

@fredemmott fredemmott changed the title The Hack Type Checker is reporting errors. 2.x-dev was recommened in README, composer resolved it to the old 'hack' branch which doesn't typecheck Jun 29, 2015
@jdsjdk
Copy link
Author

jdsjdk commented Jun 29, 2015

Hey Fred, I just removed composer.lock and did "composer install" and I still see dev-master :-( Here:

Loading composer repositories with package information
Installing dependencies (including require-dev)

  • Removing facebook/xhp-lib (2.2.0)
  • Installing facebook/xhp-lib (dev-master 87cfd8f)
    Cloning 87cfd8f

Writing lock file
Generating autoload files

Sorry dude. :-(

@jdsjdk
Copy link
Author

jdsjdk commented Jun 29, 2015

ok, so it works. :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants