Build PHP_CodeSniffer from sources with HHVM - hhvm

I am trying to use PHP_CodeSniffer in my Hack project. I tried getting the phpcs.phar file from the repository and run it, but I get an error, something that seems to be a bug of HHVM (see #5140). So I tried building it to .phar myself. I ran the most obvious script:
scripts/build-phar.php
so
$ hhvm ./scripts/build-phar.php
This is the output I get:
Building phpcs phar
=> /devel/phpcs/phpcs.phar
Fatal error: Uncaught exception 'PharException' with message '/devel/phpcs/phpcs.phar is not a file' in /devel/phpcs/scripts/build-phar.php:43
Stack trace:
#0 /devel/phpcs/scripts/build-phar.php(43): Phar->__construct()
#1 {main}
I am not sure where to look or what to look for here. Could you please give me some advice on building a .phar from this?

Related

Issues with running remix Binary in Bazel sandbox

I've encountered an issue trying to use bazel as a build tool for remix. I've been able to run remix in dev mode but currently unable to get remix build to work.
I've encountered a few errors that led up to this point. I'll list the errors in the order which they occurred with my fixes (just incase any of the fixes introduces a new issue)
First error in the bazel sandbox is related to a transitive dependency of #remix-run/dev (#remix-run/dev->gunzip-maybe->browserify-zlib). Bazel failed to fetch the bazel repository #npm__browserify-zlib__0.1.4. I assumed this was a bazel issue and tried to override browserify-zlib#0.1.4 with browserify-zlib#0.2.0, which worked. Here is bazel error for reference:
ERROR: /Users/emmanuel/projects/bbbazel/WORKSPACE:89:17: fetching _npm_import rule //external:npm__browserify-zlib__0.1.4: Traceback (most recent call last):
File "/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/external/aspect_rules_js/npm/private/npm_import.bzl", line 471, column 27, in _impl
pkg_json = json.decode(rctx.read(pkg_json_path))
Error in decode: at offset 685, object has duplicate key: "main"
ERROR: /private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/external/npm/BUILD.bazel:3012:6: #npm//:npm__browserify-zlib__0.1.4_source_directory depends on #npm__browserify-zlib__0.1.4//:source_directory in repository #npm__browserify-zlib__0.1.4 which failed to fetch. no such package '#npm__browserify-zlib__0.1.4//': at offset 685, object has duplicate key: "main"
Next error in the bazel sandbox is related to another transitive dependency of #remix-run/dev (#remix-run/dev->xdm->deasync). The install lifecycle hook for the deasync npm package makes a call to the node-gyp binary which doesn't exist in the sandbox and the bazel build command fails during setup. To fix this, I disabled the install lifecycle hook (I also disabled it with a pnpm install outside the sandbox and the remix build command executed perfectly) which led to the final error. Here's the error message for this error:
/Users/emmanuel/projects/bbbazel/BUILD.bazel:5:22: Running lifecycle hooks on npm package deasync#0.1.28 failed: (Exit 1): lifecycle-hooks.sh failed: error executing command (from target //:.aspect_rules_js/node_modules/deasync#0.1.28/lc) bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/aspect_rules_js/npm/private/lifecycle/lifecycle-hooks.sh deasync ../../../external/npm__deasync__0.1.28/package ... (remaining 1 argument skipped)
/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/external/aspect_rules_js/npm/private/lifecycle/min/node-gyp-bin/node-gyp: line 5: 1211: command not found
node-gyp not found! Please upgrade your install of npm! You need at least 1.1.5 (I think) and preferably 1.1.30.
> deasync#0.1.28 install /private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/deasync#0.1.28/node_modules/deasync
> node ./build.js
===============================================================
Failure while running lifecycle hook for package 'deasync#0.1.28':
Script: 'install'
Command: `node ./build.js`
Stack trace:
spawn ENOENT
at ChildProcess.<anonymous> (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/external/aspect_rules_js/npm/private/lifecycle/min/index.min.js:1:91930)
at ChildProcess.emit (node:events:513:28)
at maybeClose (node:internal/child_process:1100:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
The final error suggests a bug with remix, but since it only occurs in the bazel sandbox I think it may be an issue that cuts across bazel and remix. The error returned is shown below:
The following error is a bug in Remix; please open an issue! https://github.com/remix-run/remix/issues/new
Missing output for entry point
Error
at Object.onCompileFailure (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/sandbox/darwin-sandbox/1566/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/#remix-run+dev#1.12.0_#remix-run+serve#1.12.0/node_modules/#remix-run/dev/dist/cli/commands.js:180:13)
at Object.compile (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/sandbox/darwin-sandbox/1566/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/#remix-run+dev#1.12.0_#remix-run+serve#1.12.0/node_modules/#remix-run/dev/dist/compiler/remixCompiler.js:34:134)
at async Object.build (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/sandbox/darwin-sandbox/1566/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/#remix-run+dev#1.12.0_#remix-run+serve#1.12.0/node_modules/#remix-run/dev/dist/compiler/build.js:33:3)
at async Object.build (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/sandbox/darwin-sandbox/1566/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/#remix-run+dev#1.12.0_#remix-run+serve#1.12.0/node_modules/#remix-run/dev/dist/cli/commands.js:175:3)
at async Object.run (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/sandbox/darwin-sandbox/1566/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/#remix-run+dev#1.12.0_#remix-run+serve#1.12.0/node_modules/#remix-run/dev/dist/cli/run.js:449:7)
Building Remix app in production mode...
Target //examples/remix:build failed to build
I've tried to run it outside bazel and with pnpm (I added the override to the package.json for browserify-zlip#0.2.0, then I ran pnpm instal with --ignore-scripts flag) and it builds fine.
I'm not sure if this is a bug with remix or a bazel issue. Has anyone else experienced this? Or does anyone having a working version of remix with bazel as the build tool?
I've created a minified version of the repository in the state of the 3rd error https://github.com/noelenwenede/bbbazel. Start up instructions are in the readme file.

Call to undefined function iconv() fatal error - Suitecrm

Using suitecrm 7.9.1
I am facing the below error whenever i try to create a lead , that is after submitting the create lead form.
Facing the same error whenever i try to import a csv file . This error occurs only on live server
Fatal error: Uncaught Error: Call to undefined function iconv() in
/home/testsite/public_html/modules/AOD_Index/Lib/Zend/Search/Lucene/Field.php:222
Stack trace: #0
/home/testsite/public_html/modules/AOD_Index/Lib/Zend/Search/Lucene/Index/SegmentWriter/DocumentWriter.php(131):
Zend_Search_Lucene_Field->getUtf8Value() #1
/home/testsite/public_html/modules/AOD_Index/Lib/Zend/Search/Lucene/Index/Writer.php(244):
Zend_Search_Lucene_Index_SegmentWriter_DocumentWriter->addDocument(Object(Zend_Search_Lucene_Document))
2 /home/testsite/public_html/modules/AOD_Index/Lib/Zend/Search/Lucene.php(1410):
Zend_Search_Lucene_Index_Writer->addDocument(Object(Zend_Search_Lucene_Document)) #3 /home/testsite/public_html/modules/AOD_Index/AOD_Index.php(310): Zend_Search_Lucene->addDocument(Object(Zend_Search_Lucene_Document))
4 /home/testsite/public_html/modules/AOD_Index/AOD_LogicHooks.php(36):
AOD_Index->index('Leads', 'b81874eb-1233-5...') #5
/home/testsite/public_html/include/utils/LogicHook.php(262):
AOD_LogicHooks->saveModuleChanges(Object(L in
/home/testsite/public_html/modules/AOD_Index/Lib/Zend/Search/Lucene/Field.php
on line 222
what is the cause for this error .
newbie to the suitecrm, how to fix it .
Install the Iconv module on your CPanel.
Open WHM
EasyApache 4
Customize
PHP extensions
Find iconv. Enable the one matches your PHP version
Review
Provision
iconv is a PHP extension. look for an entry in php.ini that you can uncomment, or see following link
https://www.hackersgarage.com/iconv-php-extension-installation-without-recompiling-php.html

'Package "doctrine.common" is already registered as "Doctrine.Common"

On a fresh flow install, that is after copying my existing site and launching "composer install" with sucess, when I execute the "flow" command, I obtain the following error:
PHP Fatal error: Uncaught exception 'TYPO3\Flow\Package\Exception\InvalidPackag
eStateException' with message 'Package "doctrine.common" is already registered a
s "Doctrine.Common".' in C:\Development\my-cyme\Packages\Framework\TYPO3.Flow\Cl
asses\TYPO3\Flow\Package\PackageManager.php:723
Stack trace:
#0 C:\Development\my-cyme\Packages\Framework\TYPO3.Flow\Classes\TYPO3\Flow\Packa
ge\PackageManager.php(1061): TYPO3\Flow\Package\PackageManager->registerPackage(
Object(TYPO3\Flow\Package\Package), false)
#1 C:\Development\my-cyme\Packages\Framework\TYPO3.Flow\Classes\TYPO3\Flow\Packa
ge\PackageManager.php(881): TYPO3\Flow\Package\PackageManager->registerPackagesF
romConfiguration()
#2 C:\Development\my-cyme\Packages\Framework\TYPO3.Flow\Classes\TYPO3\Flow\Packa
ge\PackageManager.php(815): TYPO3\Flow\Package\PackageManager->scanAvailablePack
ages()
#3 C:\Development\my-cyme\Packages\Framework\TYPO3.Flow\Classes\TYPO3\Flow\Packa
ge\PackageManager.php(155): TYPO3\Flow\Package\PackageManager->loadPackageStates
()
#4 C:\Development\my-cyme\Pac in C:\Development\my-cyme\Packages\Framework\TYPO3
.Flow\Classes\TYPO3\Flow\Package\PackageManager.php on line 723
I'm really out of clue here on what to do or what's causing this issue. Nothing was found on the web either.
I had to delete the PackageStates.php file and then everything worked fine.
I’ve had this issue recently, too (and so did a colleague). Deleting Packages/Libraries/doctrine/common and running a composer install fixed the issue.

After running CDE I can't build sample polymer app in dart editor

file:/C:/Users/Dave/dart/td2/build.dart
build.dart returned error code 255
Unhandled exception:
Uncaught Error: FileSystemException: Cannot open file, path = 'C:\Users\Dave\dart\td2\packages\args\args.dart' (OS Error: The system cannot find the file specified., errno = 2)
Stack Trace:
#0 _File.open.<anonymous closure> (dart:io/file_impl.dart:349)
#1 _RootZone.runUnary (dart:async/zone.dart:1151)
Dart editor was working fine with a polymer app that I was developing previously.
I have rebooted, reinstalled dart editor with no luck
Running Pub Get manually fails as well as it can't find files either. Evrrything was working prior to trying CDE and the designer.
I think running pub cache repair (run in command line interface) should be able to fix this.

Errors when trying to build iOS with cordova in Mavericks (10.9.1)

Days ago I built the application for Android, zero problems, but now, when I try to do the same for iOS (obviously not the same commands) I always receive an error.
I use the following command:
cordova platform add ios
And I get the following error:
Downloading cordova library for ios...
Download complete
Creating ios project...
Error: An error occured during creation of ios sub-project.
File "/Users/xxxxx/.cordova/lib/ios/cordova/3.3.0/bin/update_cordova_subproject", line 31
print __doc__
^
SyntaxError: invalid syntax
at /usr/local/lib/node_modules/cordova/src/platform.js:282:30
at ChildProcess.exithandler (child_process.js:641:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Socket.<anonymous> (child_process.js:956:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)
I tried also with:
phonegap build ios
But I get the same error and I don't know how to fix it. I've been looking on the Internet and I found some guy with the same problem but nobody could help him.
I run the commands with sudo, that isn't the problem.
I recently got the same error.
My problem was that I'm using Python3 by default. print in Python2 is a statement wherease in Python3 it's a function.
.cordova/lib/ios/cordova/3.3.0/bin/update_cordova_subproject has a shebang that calls /bin/python.
I had to replace #!/bin/python with #!/bin/python2.7 to use python2.7 on this script.
I have the exactly same problem with you. However, the way replace "#!/bin/python with #!/bin/python2.7" doesn't work for me.
Inspired by the explanation of Matthieu Riegler, I change print __doc__ to print(__doc__) in line 31 and print line to print(line) in line 97. Eventually, it works.

Resources