I am trying to install an add-on to clean up my PHP called Atom beautify.
Every time I run the plugin to make my PHP file pretty (Atom Beautify) I get this showing up:
Error: spawn EACCES
at exports._errnoException (util.js:1026:11)
at ChildProcess.spawn (internal/child_process.js:313:11)
at exports.spawn (child_process.js:392:9)
at /Users/myusername/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee:349:13
at Promise._execute (/Users/myusername/.atom/packages/atom-beautify/node_modules/bluebird/js/release/debuggability.js:300:9)
at Promise._resolveFromExecutor (/Users/myusername/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:483:18)
at new Promise (/Users/myusername/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:79:10)
at PHPCSFixer.module.exports.Beautifier.spawn (/Users/myusername/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee:346:16)
at /Users/myusername/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee:308:10
at tryCatcher (/Users/myusername/.atom/packages/atom-beautify/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/myusername/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/Users/myusername/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/Users/myusername/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/Users/myusername/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:693:18)
at Promise._fulfill (/Users/myusername/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:638:18)
at PromiseArray._resolve (/Users/myusername/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise_array.js:126:19)
at PromiseArray._promiseFulfilled (/Users/myusername/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise_array.js:144:14)
at Promise._settlePromise (/Users/myusername/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:574:26)
at Promise._settlePromise0 (/Users/myusername/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/Users/myusername/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:693:18)
at Async._drainQueue (/Users/myusername/.atom/packages/atom-beautify/node_modules/bluebird/js/release/async.js:133:16)
at Async._drainQueues (/Users/myusername/.atom/packages/atom-beautify/node_modules/bluebird/js/release/async.js:143:10)
at Async.drainQueues (/Users/myusername/.atom/packages/atom-beautify/node_modules/bluebird/js/release/async.js:17:14)
I am currently using a Mac computer if that matters at all.
Line 349 of beautifier.coffee is:
cmd = spawn(exe, args, options)
This is where it would make a call to the beautify program. For PHP, that seems to default to php-cs-fixer, as shown in php.coffee:
defaultBeautifier: "PHP-CS-Fixer"
So you probably want to verify that PHP-CS-Fixer is installed and that it is set up properly (the program is readable / executable, preferably in your PATH).
The PHP-CS-Fixer README has installation instructions.
Related
i am learning how to use Alire using the Ada binding to SFML which is ASFML. So far I have downloaded
and installed ASFML using Alire and have successfully imported it into my test project. When I go to compile it, it does compile and bind but gets stuck on the Linker phase.
Here is the error:
gprbuild -d -PC:\Users\Amynu\testproj\testproj.gpr -XASFML_BUILD_MODE=optimize -XASFML_CONTRACTS=enabled -XASFML_STYLE_CHECKS=enabled -XASFML_RUNTIME_CHECKS=enabled -XASFML_COMPILE_CHECKS=enabled -XOS=Windows_NT -XTESTPROJ_BUILD_MODE=optimize -XTESTPROJ_CONTRACTS=disabled -XTESTPROJ_STYLE_CHECKS=disabled -XTESTPROJ_RUNTIME_CHECKS=disabled -XTESTPROJ_COMPILE_CHECKS=disabled
Compile
[Ada] testproj.adb
Bind
[gprbind] testproj.bexch
[Ada] testproj.ali
Link
[link] testproj.adb
c:/gnat/2021/bin/../libexec/gcc/x86_64-w64-mingw32/10.3.1/ld.exe: C:\Users\Amynu\testproj\alire\cache\dependencies\asfml_2.5.2_b775db19\lib\libasfml.a: error adding symbols: archive has no index; run ranlib to add one
collect2.exe: error: ld returned 1 exit status
gprbuild: link of testproj.adb failed
I have absolutely no idea what a "ranlib" is, I searched Alire but it's not a known crate or a library. I tried various options in Alire such as
alr with libranlib
and
alr get ranlib
To no avail. Is it an option within GNAT's command line? I did look into the GPR file for the project and that all looks alright. One the GPR's being auto generated by Alire when I build the project with
alr init --bin testproj
alr cd testproj
alr with libasfml
alr build
I did a Google search and found a lot of solutions connected to Unix and IBM(?) something about ranlib being outdated as most compilers use "rm" now? I couldn't find a solution to GNAT flagging the same error.
Am I just using an outdated audio library?
Thanks in advance for any help :)
Thank you guys! That solved the problem. Now I am stuck with a loads of "undefined references to..." I actually went through all the source files and got rid of all the warnings by addIng Constant to most variable names. I am guessing it's looking for a dependency that is missing?
Build Libraries [gprlib] asfml.lexch [link library] libasfml.dll c:/gnat/2021/bin/../libexec/gcc/x86_64-w64-mingw32/10.3.1/ld.exe: C:\Users\Amynu\testproj\alire\cache\dependencies\asfml_2.5.2_b775db19\obj\sf-audio-music.o:sf-audio-music.adb:(.text+0x32): undefined reference to `sfMusic_createFromFile'
And about 15 lines under that with the same error type. After looking into it, I had a look a the lines of code the error were referring to and found the errors are referencing what look like external files? Is their a part of ASFML that didn't download with the library?
I scoured the code for the first linker error and found line it's referring to.
with Interfaces.C.Strings;
package body Sf.Audio.Music is
use Interfaces.C.Strings;
--//////////////////////////////////////////////////////////
--/ Create a new music and load it from a file
--/
--/ #param Filename Path of the music file to open
--/
--/ #return A new sfMusic object (NULL if failed)
--/
--//////////////////////////////////////////////////////////
function CreateFromFile (Filename : String) return sfMusic_Ptr is
function Internal (Filename : chars_ptr) return sfMusic_Ptr;
pragma Import (C, Internal, "sfMusic_createFromFile");
Temp : chars_ptr := New_String (Filename);
R : sfMusic_Ptr := Internal (Temp);
begin
Free (Temp);
return R;
end CreateFromFile;
I cannot find the file it's trying to reference anywhere in the ASFML library. Was it left out?
So far, I have managed to successfully build ASFML in Alire with
alr get asfml
cd asfml
alr build asfml
This worked fine. Then I successfully imported into my project with
cd myproj
alr myproj with asfml
Again, do problems. Then I attempted to build it (after correcting the ranlib error) and I got the same load of linker errors. I don't understand why, as I successfully built the asfml library before I imported it wit Alire. Is it just a file I am missing, or do I have to explicitly tell the linker where the asfml file is?
Some of the errors.
Compile
[Ada] alicegame.adb
Build Libraries
[gprlib] asfml.lexch
[link library] libasfml.dll
c:/gnat/2021/bin/../libexec/gcc/x86_64-w64-mingw32/10.3.1/ld.exe: C:\Users\Amynu\alicegame\alire\cache\dependencies\asfml_2.5.2_b775db19\obj\sf-audio-music.o:sf-audio-music.adb:(.text+0x32): undefined reference to `sfMusic_createFromFile'
c:/gnat/2021/bin/../libexec/gcc/x86_64-w64-mingw32/10.3.1/ld.exe: C:\Users\Amynu\alicegame\alire\cache\dependencies\asfml_2.5.2_b775db19\obj\sf-audio-soundbuffer.o:sf-audio-soundbuffer.adb:(.text+0x22): undefined reference to `sfSoundBuffer_createFromFile'
I'm trying to use llvm binding in ocaml, in my file test.ml, I have one line of code:
open Llvm
When I run the command
ocamlbuild -use-ocamlfind test.byte -package llvm
I get this result:
+ ocamlfind ocamldep -package llvm -modules test.ml > test.ml.depends
ocamlfind: Package `llvm' not found
Command exited with code 2.
Compilation unsuccessful after building 1 target (0 cached) in 00:00:00.
What did I do wrong in this? Thanks.
BTW, the _tag file contains:
"src": traverse
<src/{lexer,parser}.ml>: use_camlp4, pp(camlp4of)
<*.{byte,native}>: g++, use_llvm, use_llvm_analysis
myocamlbuild.ml contains:
open Ocamlbuild_plugin;;
ocaml_lib ~extern:true "llvm";;
ocaml_lib ~extern:true "llvm_analysis";;
flag ["link"; "ocaml"; "g++"] (S[A"-cc"; A"g++"]);;
I don't know why the instructions that you're using are so complex. You don't have to do anything like this to use llvm bindings in OCaml, provided you have installed them via opam.
Here is the recipe:
Install llvm bindings via opam.
it could be as simple as
opam install llvm
However, opam may try to install the latest version that is not available on your system, so pick a particular version, that you have and do the following (suppose you have llvm-3.8):
opam install conf-llvm.3.8
opam install llvm --criteria=-changed
(The -criteria flag will prevent opam from upgrading conf-llvm to the newest version)
Once it succeeds, you can easily compile your programs without any additional scaffolding.
Create and build your project
create a fresh new folder, e.g.,
mkdir llvm-project
cd llvm-project
create a sample application (borrowed from some tutorial, that I've found online):
cat >test.ml<<EOF
open Llvm
let _ =
let llctx = Llvm.global_context () in
let llmem = Llvm.MemoryBuffer.of_file Sys.argv.(1) in
let llm = Llvm_bitreader.parse_bitcode llctx llmem in
Llvm.dump_module llm ;
()
EOF
compile it for bytecode
ocamlbuild -pkgs llvm,llvm.bitreader test.byte
or to the native code
ocamlbuild -pkgs llvm,llvm.bitreader test.native
run it
./test.native mycode.bc
On "./configure" of an open source project I get:
user agent OS = Linux
./configure: line 13957: syntax error near unexpected token 0.9.3'
./configure: line 13957: GOBJECT_INTROSPECTION_CHECK(0.9.3)'
make: *** [config.status] Error 2
Ubuntu 12.04 package "gobject-introspection" and "libgirepository1.0-dev" are present. Removing the GOBJECT_INTROSPECTION_CHECK line allows configure to complete, but the project fails a dependency later.
How can I get past this configure step cleanly? Googling for this issue shows bugs filed against numerous OS projects for this same blocking issue, but the usual answer is "install gobject-introspection".
As the OP discovered on his own he had to install the gobject-introspection package to get the m4 macros that were being used.
The error message has the raw macro in it, as configure scripts are generated from configure.in/configure.ac files via m4/etc the fact that the raw macro is in the output file indicates that the macro did not get translated at generation time.
The gobject-introspection m4 files were apparently installed after autogen.sh (or equivalent) was run to generate the configure script. Re-running the autogen.sh script should regenerate the configure script and run the macro correctly.
I am trying to compile a deb package for my server. When I go to build, everything looks good until it gets to dh_usrlocal The build stops and make returns an error. The problem is I am trying this for the first time and I really don't know where to look for the problem.
This is the output from my terminal, I also included the command I ran at the bottom of the output.
make[2]: Leaving directory `/home/ian/Desktop/scst-2.1.0/src'
make[1]: Leaving directory `/home/ian/Desktop/scst-2.1.0'
dh_install
dh_installdocs
dh_installchangelogs
dh_installexamples
dh_installman
dh_installcatalogs
dh_installcron
dh_installdebconf
dh_installemacsen
dh_installifupdown
dh_installinfo
dh_pysupport
dh_installinit
dh_installmenu
dh_installmime
dh_installmodules
dh_installlogcheck
dh_installlogrotate
dh_installpam
dh_installppp
dh_installudev
dh_installwm
dh_installxfonts
dh_bugfiles
dh_lintian
dh_gconf
dh_icons
dh_perl
dh_usrlocal
dh_usrlocal: debian/scst/usr/local/include/scst/scst.h is not a directory
dh_usrlocal: debian/scst/usr/local/include/scst/scst_user.h is not a directory
dh_usrlocal: debian/scst/usr/local/include/scst/Module.symvers is not a directory
dh_usrlocal: debian/scst/usr/local/include/scst/scst_debug.h is not a directory
dh_usrlocal: debian/scst/usr/local/include/scst/scst_const.h is not a directory
dh_usrlocal: debian/scst/usr/local/include/scst/scst_sgv.h is not a directory
rmdir: failed to remove `debian/scst/usr/local/include/scst': Directory not empty
dh_usrlocal: rmdir debian/scst/usr/local/include/scst returned exit code 1
make: *** [binary] Error 1
dpkg-buildpackage: error: debian/rules binary gave error exit status 2
ian#vm01:~/Desktop/scst-2.1.0$ sudo dpkg-buildpackage -rfakeroot
Any help would be appreciated.
you should skip running dh_usrlocal. to do it you just add this to debian/rules file: override_dh_usrlocal:
In general manner if you have a problem with a specific target, you just override it by adding override_{target} in your debian/rules file.
example, you have a problem with dh_icons. you just add this in your debian/rules file.
override_dh_icons:
{insert your processing commands or do nothing to skip it when building package}
A proper Debian package is not allowed to generate stuff there but empty directories.That is why it is complaining that it can not delete the directory. It doesnt expect files to be there.the only thing you can have is a directory in /usr/local and that's what dh_usrlocal tries to handle
but you shouldn't have files
Users only put files in /usr/local/.
Also i think if you have usr/local name in your directory path it will cause the error also like even though it is not the correct usr/local. An example of what could cause the problem also. I think the regex in build software looks for usr/local.
/var/tmp/usr/local/
I know this is an old post but it is ranked #1 on google so needs a good answer so people solve this problem quickly.
IMPORTANT: This error ONLY occurs when you try to install to /usr/local/
I moved my package to install from /usr/local/lib/python3/dist-packages/ to /usr/lib/python3/dist-packages and the error disappeared. dh_usrlocal seems to be broken or my package is not abiding by rules it expects.
I started getting the error after adding a package.install file to my debian package so it would copy the package contents to the filesystem. (I was installing to /usr/local/ at the time)
Contents of my install file when it failed:
usr/* usr/
Contents when it works correctly:
usr/ usr/
File structure of debian package:
packagename-0.1/
debian/
usr/
local/
lib/
python3/
packagename/
Edit:
This seems only to work when copying root directories. Once I try to specify copying past usr/, it breaks with the same error. See top of answer to find my solution.
I've been installing lispbuilder-sdl family with quicklisp and encountered error in sdl-gfx:
CL-USER> (ql:quickload "lispbuilder-sdl-gfx")
To load "lispbuilder-sdl-gfx":
Load 1 ASDF system:
lispbuilder-sdl-gfx
; Loading "lispbuilder-sdl-gfx"
...........;
; compilation unit aborted
; caught 1 fatal ERROR condition
Unable to load any of the alternatives:
("libSDL_gfx.dylib" (:FRAMEWORK "SDL_gfx"))
[Condition of type CFFI:LOAD-FOREIGN-LIBRARY-ERROR]
I use slime+emacs+SBCL under macosx 10.6. I've installed SDL.framework from this link:
http://thirdcog.eu/apps/frameworks#glew
a file called sdl_with_friends.zip and put things under /Library/Frameworks. However it still complains about cannot find framework.
Any idea on this?
The easiest way to install lispbuilder-sdl on Mac OSX is to fire up SBCL and use Quicklisp:
(ql:quickload "lispbuilder-sdl")
It will probably fail, but you can then compile the OS-X specific helper library located in "~quicklisp/dists/quicklisp/software/lispbuilder-20110619-svn/lispbuilder-sdl/cocoahelper"; just cd to this directory and type "make"
To verify that worked, try this:
(ql:quickload "lispbuilder-sdl-examples")
(lispbuilder-sdl-examples:bezier)
Another common gotcha is when you are using Emacs / SLIME. The cocoa bits must run on the primary thread, so you have to invoke things like this:
#+darwin #+sb-thread
(let ((thread (first (last (sb-thread:list-all-threads)))))
(sb-thread:interrupt-thread thread #'(lambda () (ql:quickload "lispbuilder-sdl-examples")))
(sb-thread:interrupt-thread thread #'(lambda () (lispbuilder-sdl-examples:bezier))))
The error is complaining that it can't load the dynamic library for SDL. I'm sorry - I don't know much about the directory layout on macs (which appears to be where you're working), so I can't exactly tell you how to fix this. But somewhere you should have installed a file called libSDL_gfx.dylib (probably this extension) and the error message means that CFFI is failing to find it.
using homebrew you can brew install sdl_gfx