Comments (12)
fwiw, if you're able to send a patch for facebook/hhvm#8098, I'll happily cherry pick it to 3.21 :)
from hhast.
Can you double-check what version you have? That doesn't look like v0.5:
- v0.5 had a clean test run, including self-lint, on 3.21: https://travis-ci.org/hhvm/hhast/jobs/326589829
- the installed versions don't match your output
- composer.lock at v0.5 does not specify those versions: https://github.com/hhvm/hhast/blob/v0.5/composer.lock
- the change that sets the versions you mention ( bc5af15 ) was created after v0.5
from hhast.
bradley@slack:~/hhast$ hhvm composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 33 installs, 0 updates, 0 removals
- Installing fredemmott/hack-error-suppressor (v1.0.1): Loading from cache
- Installing facebook/definition-finder (v1.6.3): Loading from cache
- Installing hhvm/hhvm-autoload (v1.5.3): Loading from cache
- Installing hhvm/hsl (v1.0.0): Loading from cache
- Installing facebook/hack-codegen (v3.0.0): Loading from cache
- Installing hhvm/type-assert (v3.1.0): Loading from cache
- Installing symfony/yaml (v3.3.10): Loading from cache
- Installing sebastian/version (2.0.1): Loading from cache
- Installing sebastian/resource-operations (1.0.0): Loading from cache
- Installing sebastian/recursion-context (2.0.0): Loading from cache
- Installing sebastian/object-enumerator (2.0.1): Loading from cache
- Installing sebastian/global-state (1.1.1): Loading from cache
- Installing sebastian/exporter (2.0.0): Loading from cache
- Installing sebastian/environment (2.0.0): Loading from cache
- Installing sebastian/diff (1.4.3): Loading from cache
- Installing sebastian/comparator (1.2.4): Loading from cache
- Installing phpunit/php-text-template (1.2.1): Loading from cache
- Installing doctrine/instantiator (1.0.5): Loading from cache
- Installing phpunit/phpunit-mock-objects (3.4.4): Loading from cache
- Installing phpunit/php-timer (1.0.9): Loading from cache
- Installing phpunit/php-file-iterator (1.4.2): Loading from cache
- Installing sebastian/code-unit-reverse-lookup (1.0.1): Loading from cache
- Installing phpunit/php-token-stream (1.4.11): Loading from cache
- Installing phpunit/php-code-coverage (4.0.8): Loading from cache
- Installing webmozart/assert (1.2.0): Loading from cache
- Installing phpdocumentor/reflection-common (1.0.1): Loading from cache
- Installing phpdocumentor/type-resolver (0.3.0): Loading from cache
- Installing phpdocumentor/reflection-docblock (3.2.2): Loading from cache
- Installing phpspec/prophecy (v1.7.2): Loading from cache
- Installing myclabs/deep-copy (1.7.0): Loading from cache
- Installing phpunit/phpunit (5.7.23): Loading from cache
- Installing 91carriage/phpunit-hhi (5.7.1): Cloning 6864897f02 from cache
- Installing facebook/fbexpect (v0.3): Loading from cache
symfony/yaml suggests installing symfony/console (For validating YAML files using the lint command)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/php-code-coverage suggests installing ext-xdebug (^2.5.1)
phpunit/phpunit suggests installing ext-xdebug (*)
phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)
91carriage/phpunit-hhi suggests installing 91carriage/dbunit-hhi (HHI files for use with DbUnit)
Generating autoload files
bradley@slack:~/hhast$ hhvm bin/hhast-lint .
Warning: Destructor threw an object exception: exception 'HH\InvariantException' with message 'counter Facebook\HHAST\__Private\LinterCLI destroyed without calling ::end()' in /home/bradley/hhast/src/__Private/PerfCounter.php:51
Stack trace:
#0 /home/bradley/hhast/src/__Private/PerfCounter.php(51): HH\invariant_violation()
#1 /home/bradley/hhast/src/__Private/LinterCLI.php(155): Facebook\HHAST\__Private\PerfCounter->__destruct()
#2 /home/bradley/hhast/bin/hhast-lint(38): Facebook\HHAST\__Private\LinterCLI::mainAsync()
#3 {main} in /home/bradley/hhast/src/__Private/LinterCLI.php on line 155
Fatal error: Uncaught exception 'Exception' with message 'Invalid configuration file: /home/bradley/hhast/hhast-lint.json
Expected type 'vec<T>', got type 'array'
Type trace:
#0 shape[roots]
' in /home/bradley/hhast/src/__Private/LinterCLIConfig.php:243
Stack trace:
#0 /home/bradley/hhast/src/__Private/LinterCLIConfig.php(97): Facebook\HHAST\__Private\LinterCLIConfig::getConfigFromFile()
#1 /home/bradley/hhast/src/__Private/LinterCLIConfig.php(98): Facebook\HHAST\__Private\LinterCLIConfig::getFromConfigFile$memoize_impl()
#2 /home/bradley/hhast/src/__Private/LinterCLIConfig.php(121): Facebook\HHAST\__Private\LinterCLIConfig::getFromConfigFile()
#3 /home/bradley/hhast/src/__Private/LinterCLIConfig.php(127): Facebook\HHAST\__Private\LinterCLIConfig::getForPathImpl$memoize_impl()
#4 /home/bradley/hhast/src/__Private/LinterCLIConfig.php(109): Facebook\HHAST\__Private\LinterCLIConfig::getForPathImpl()
#5 /home/bradley/hhast/src/__Private/LinterCLI.php(138): Facebook\HHAST\__Private\LinterCLIConfig::getForPath()
#6 /home/bradley/hhast/bin/hhast-lint(38): Facebook\HHAST\__Private\LinterCLI->mainAsync()
#7 {main}
agh yeah I must've done something wrong, thanks. but self-lint (or lint on our repo) still seem to have the vec/array type error
from hhast.
Not sure if it matters but the HHVM version is a custom build
HipHop VM 3.21.3 (rel)
Compiler: remotes/origin/3.21.3-slack-0-blahblahblahblah
Repo schema: 90ed4216b98563d0585cf5c87959dc9ff7c2e1a1
from hhast.
- what's the JSON syntax for your roots? ideally full copy-paste of the file, or at least the 'roots' part
- what does this get you in
hhvm -m debug
?=json_decode('{"roots": ["foo", "bar"]}', true, 512, JSON_FB_HACK_ARRAYS)
from hhast.
{
"roots": [ "src/", "codegen/", "tests/" ],
"builtinLinters": "all",
"overrides": [
{
"patterns": [ "codegen/*" ],
"disableAllAutoFixes": true
}
]
}
and
hphpd> = json_decode('{"roots": ["foo", "bar"]}', true, 512, JSON_FB_HACK_ARRAYS);
= json_decode('{"roots": ["foo", "bar"]}', true, 512, JSON_FB_HACK_ARRAYS);
Array
(
[roots] => Array
(
[0] => "foo"
[1] => "bar"
)
)
but you know what? as I'm typing this I think I remember we swapped out the JSON parser a year and a half or so ago because trailing comma support (😬) or something like that. I'll go check up on what exactly we've done, but if true could that be a part of the problem?
from hhast.
- it looks like an HHVM bug (in all versions) that we don't support JSON_FB_HACK_ARRAYS if built with USE_JSONC
- if you're using a custom JSON parser library, you need to add support for JSON_FB_HACK_ARRAYS
from hhast.
As an aside, assuming you're not setting using USE_JSONC, you can get trailing comma support with the standard implementation with the JSON_FB_LOOSE flag:
hphpd> = json_decode('{"roots": ["foo", "bar", ],}', true, 512, JSON_FB_HACK_ARRAYS | JSON_FB_LOOSE);
= json_decode('{"roots": ["foo", "bar", ],}', true, 512, JSON_FB_HACK_ARRAYS | JSON_FB_LOOSE);
Dict
(
[roots] => Vec
(
[0] => "foo"
[1] => "bar"
)
)
from hhast.
found it: -DUSE_JSONC=ON
😢 . this is really good stuff to know, thank you for all the help!
from hhast.
from hhast.
Fix is in 3.21.6: https://hhvm.com/blog/2018/01/30/hhvm-3.24.1.html
from hhast.
🙇 can't thank you enough, we're rolling this out now
from hhast.
Related Issues (20)
- [ Regression ] Mismatched configuration for a linter should fail the lint run HOT 2
- Suppression comments for HHClientLinter don't mesh well with /**/ comments HOT 3
- Known bad HHClientLinters need to be automatically unconditionally suppressed HOT 5
- Delete HHAST linters that duplicate good HHClientLinters HOT 6
- Support readable aliases for HHClientLinter rules HOT 4
- Linter to check if the result of the new operator is silently discarded
- Support HHAST_IGNORE_ALL for hhclientlinter codes HOT 2
- Disable some lint rules by default HOT 2
- hh_client lints are slow and unreliable in IDE HOT 1
- Overrides are not respected with recent update HOT 1
- [ RFC ] Adding an optional allow list to hhast-lint.json HOT 1
- Fix attribution for schema update commits HOT 4
- HHAST crashes with nightly HHVM
- GitHub Actions are not triggered for the pull request to update schema
- DontSuppressLintErrorsLinter
- DontReassignParametersLinter
- DontReturnFromCloneLinter
- Remove use of the XHProf profiler
- If present `async` should be to the immediate left of `function` HOT 1
- Linter to make properties and methods only accessible through `$this`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hhast.