Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FakeVim doesn't work? #32

Open
linxd5 opened this issue Nov 4, 2015 · 15 comments
Open

FakeVim doesn't work? #32

linxd5 opened this issue Nov 4, 2015 · 15 comments

Comments

@linxd5
Copy link

linxd5 commented Nov 4, 2015

Hello, My ReText version is 5.2.1 (using PyMarkups 0.6.1), and FakeVim doesn't work ~ below is my configuration file:

[General]
autoSave=true
highlightCurrentLine=true
previewState=true
restorePreviewState=true
saveWindowGeometry=true
spellCheck=true
useFakeVim=true
useWebKit=true
windowGeometry="@bytearray(\x1\xd9\xd0\xcb\0\x2\0\0\0\0\x3\xe\0\0\0\xef\0\0\a\xa1\0\0\x4;\0\0\x3\x18\0\0\x1\x15\0\0\a\x97\0\0\x4\x31\0\0\0\0\0\0\0\0\a\x80)"

Thank you~

@hluk
Copy link
Owner

hluk commented Nov 5, 2015

The configuration file is from ReText and doesn't have anything to do with FakeVim library.

As mentioned in retext-project/retext#162, FakeVim library and Python bindings need to be installed. Unfortunately there is currently no package to make this easy.

@linxd5
Copy link
Author

linxd5 commented Nov 5, 2015

I have installed Python2 as well as Python3 in my Ubuntu15.04, and build the FakeVim as mentioned in README.md (qmake; make)
There are no errors occur in console, but I can't use FakeVim in ReText;
Does it has any additional instructions in order to use FakeVim in ReText while installing FakeVim?
Or how to "bindings" Python to FakeVim library as mentioned above ?

@hluk
Copy link
Owner

hluk commented Nov 5, 2015

I cannot test this currently but the whole build process is something like the following.

# From FakeVim repo ...
# Build FakeVim shared library.
make
qmake

# Build Python bindings (this also runs test application).
PYTHON=python3 ./python/build.sh

# Tell Python apps where to find the bindings.
export PYTHONPATH="$PWD/build:$PYTHONPATH"

# Run ReText.

If you have trouble building Python bindings read python/README.md.

Maybe you can run make install for the library and the bindings so you won't have to set the environment variables but I'm not sure if the qmake build files support this now.

@linxd5
Copy link
Author

linxd5 commented Nov 5, 2015

I get an error while I run the command: python3 ./build.sh

➜ python python3 ./build.sh
File "./build.sh", line 10
export QMAKE=${QMAKE:-qmake}
^
SyntaxError: invalid syntax

I don't understand why using python3 to execute shell script~

so I run the command this way: ./build.sh and the get the error as follow:

python: can't open file '/home/FakeVim-master/python/python/configure.py': [Errno 2] No such file or directory

I vim the build.sh, in the comment it tell me to

Example (see variable exports below):

QMAKE=qmake-qt4 PYTHON=python2 ./python/build.sh

I run the command QMAKE=qmake; PYTHON=python3; ./build.sh, but it fails again just as above~

@hluk
Copy link
Owner

hluk commented Nov 5, 2015

Sorry, yes, it should be PYTHON=python3 ./build.sh (comment above fixed).

@hluk
Copy link
Owner

hluk commented Nov 5, 2015

The project path seems to be currently wrong too so you should use:

PROJECT_PATH="$PWD/.." PYTHON=python3 ./build.sh

@linxd5
Copy link
Author

linxd5 commented Nov 5, 2015

The structure of this project is like this:

------------------- fakevim
|
------------------- python
                      |
                      ----------------------- fakevim.sip
                      |
                      ----------------------- build.sh
                      |
                      ----------------------- configure.py
                      |
                      ----------------------- test.py

However, the content in build.sh in as follow:

export PROJECT_PATH=${PROJECT_PATH:-"$PWD"}
export LIBRARY_PATH=${LIBRARY_PATH:-"$PROJECT_PATH/fakevim"}
export SIP_FILE_PATH=${SIP_FILE_PATH:-"$PROJECT_PATH/python/fakevim.sip"}
...
"$PYTHON" "$PROJECT_PATH/python/configure.py"
...
"$PYTHON" "$PROJECT_PATH/python/test.py"

So I think the build.sh file need to be placed at the root of the project, not under the python directory;

I run the command mv build.sh ../; ./build.sh , it get the error as below:

/usr/bin/ld: cannot find -lfakevim
collect2: error: ld returned 1 exit status
Makefile:161: recipe for target 'FakeVim.so' failed
make: *** [FakeVim.so] Error 1

@hluk
Copy link
Owner

hluk commented Nov 5, 2015

You shouldn't move the script. Just set PROJECT_PATH or run the script from main repo directory (I've updated the commands to build the library and bindings).

@linxd5
Copy link
Author

linxd5 commented Nov 5, 2015

I follow the way, but get the following error:

/usr/bin/ld: cannot find -lfakevim
collect2: error: ld returned 1 exit status
Makefile:161: recipe for target 'FakeVim.so' failed
make: *** [FakeVim.so] Error 1

I run the command apt-cache search libfakevim-dev but get nothing;

Then I find the lfakevim in Makefile under the build directory, get nothing again;

I don't know where the lfakevim libray is generated ??

@hluk
Copy link
Owner

hluk commented Nov 5, 2015

And if you leave out setting LD_LIBRARY_PATH? I've tried it now and it seems to work without it (the build script takes care of passing correct path to bindings generator).

@linxd5
Copy link
Author

linxd5 commented Nov 5, 2015

I move to this step: PYTHON=python3 ./python/build.sh, and get the error:

+ export PYTHONPATH=/home/panjinbo/software/FakeVim-master/build
+ PYTHONPATH=/home/panjinbo/software/FakeVim-master/build
+ python3 /home/panjinbo/software/FakeVim-master/python/test.py
python3: siplib.c:8505: sip_api_can_convert_to_type: Assertion `(((td)->td_flags & 0x0007) == 0x0000) || (((td)->td_flags & 0x0007) == 0x0002)' failed.
./python/build.sh: line 39: 30588 Aborted                 (core dumped) "$PYTHON" "$PROJECT_PATH/python/test.py"

@hluk
Copy link
Owner

hluk commented Nov 5, 2015

Whoa, looks like bug in SIP (the bindings generator).

You can remove build subdirectory and try again -- perhaps it'll help. Also make sure that qmake is for Qt5 (qmake --version) and use the same for compiling library and building bindings.

@mitya57
Copy link

mitya57 commented Nov 5, 2015

python3: siplib.c:8505: sip_api_can_convert_to_type: Assertion `(((td)->td_flags & 0x0007) == 0x0000) || (((td)->td_flags & 0x0007) == 0x0002)' failed.

This usually means you are trying to run code compiled against old sip with new sip. We have got the same assertion with QScintilla packages in Ubuntu, and a rebuild fixed that. Such incompatibility was undocumented and could be treated as a sip bug, though.

@linxd5
Copy link
Author

linxd5 commented Nov 6, 2015

I feel confused when I rebuild PyQt-gpl-5.5.1 with sip-4.16.3 and the errors occur:

Error: This version of PyQt5 requires sip 4.16.6 or later.

In order to use FakeVim in ReText , we need to install python, python-markups, sip, pyqt5, fakevim, retext. And I install

  • python-3.4.3
  • markups-0.6.3
  • sip-4.16.3
  • pyqt5-5.5.1
  • fakevim-master
  • retext-master

I don't know what's the right version of these projects, respectively, or may be many ??

@mitya57
Copy link

mitya57 commented Nov 6, 2015

@linxd5 In retext-project/retext#162, you mentioned that you are using Ubuntu 15.04. Why can't you then just use the distro versions of sip and PyQt? Ubuntu 15.04 has sip 4.16.6 which is newer than your 4.16.3.

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

No branches or pull requests

3 participants