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

trouble with vte.h #125

Closed
SwissalpS opened this issue Jul 28, 2022 · 13 comments · Fixed by #131 · May be fixed by #129
Closed

trouble with vte.h #125

SwissalpS opened this issue Jul 28, 2022 · 13 comments · Fixed by #131 · May be fixed by #129

Comments

@SwissalpS
Copy link
Contributor

I have two versions of vte installed, 0.66.2 (vte-0.0) and 2.91 (vte-2.91).
cmake finds 0.66.2 but build (make) aborts with error "can't find vte/vte.h"

when I edit termit.c and .h to include vte-0.0/vte/vte.h, then there are missing commands.
When I edit to include vte-2.91/vte/vte.h I was able to build termit.

@SwissalpS
Copy link
Contributor Author

SwissalpS commented Sep 12, 2022

for the test builds by github workflows, I had to change the header statements for both ubuntu and fedora builds.
SwissalpS@30013cf or 7f7a4b6

@nonstop
Copy link
Owner

nonstop commented Sep 16, 2022

There is a CMake-rule for vte:
pkg_search_module(VTE REQUIRED libvte>=0.46 vte>=0.46 vte-2.91>=0.46)

Available names are: libvte, vte and vte-2.91.
Because in different linux distros libvte is named differently.
I'm using Slackware and in my case proper name is vte-2.91
pkg-config --list-all|grep vte
vte-2.91 vte - VTE widget for GTK+ 3.0

What is this package vte-0.0?

@SwissalpS
Copy link
Contributor Author

What is this package vte-0.0

on fedora the available packages are:

vte-0.28.2           vte-devel-0.28.2
vte291-0.68.0     vte291-devel-0.68.0

the header files are installed into /usr/include/vte-0.0/ and /usr/include/vte-2.91/
each directory contains a folder vte which then contains the header files.

without 7f7a4b6 I was unable to compile on either fedora nor ubuntu.

@nonstop
Copy link
Owner

nonstop commented Sep 17, 2022

OMG, vte-0.28 is 11 years old. Why are you using it in 2022?

Please show the output for this commands:
pkg-config --list-all|grep vte
pkg-config --modversion vte
pkg-config --modversion vte291
pkg-config --modversion libvte
pkg-config --modversion vte-2.91

Anyway version 0.28 should not be found. Minimum version in CMakeLists.txt is set to 0.46.

@SwissalpS
Copy link
Contributor Author

for the github workflow tests, I changed the order to:
(it stops processing after first error)

        pkg-config --list-all|grep vte
        pkg-config --modversion vte-2.91
        pkg-config --modversion vte291
        pkg-config --modversion libvte
        pkg-config --modversion vte

ubuntu from github workflow

vte-2.91              vte - VTE widget for GTK+ 3.0
0.68.0
Package vte2[9](https://github.com/SwissalpS/termit/actions/runs/3073685051/jobs/4965975010#step:9:10)1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `vte291.pc'
to the PKG_CONFIG_PATH environment variable
No package 'vte291' found

fedora from github workflow

vte-2.91                       vte - VTE widget for GTK+ 3.0
0.68.0
Package vte2[9](https://github.com/SwissalpS/termit/actions/runs/3073685051/jobs/4965975053#step:9:10)1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `vte291.pc'
to the PKG_CONFIG_PATH environment variable
Package 'vte291', required by 'virtual:world', not found

fedora on my desktop

$ pkg-config --list-all|grep vte
vte                            vte - Vte terminal widget.
vte-2.91                       vte - VTE widget for GTK+ 3.0

$ pkg-config --modversion vte
0.28.2

$ pkg-config --modversion vte291
Package vte291 was not found in the pkg-config search path.
Perhaps you should add the directory containing `vte291.pc'
to the PKG_CONFIG_PATH environment variable
Package 'vte291', required by 'virtual:world', not found

$ pkg-config --modversion libvte
Package libvte was not found in the pkg-config search path.
Perhaps you should add the directory containing `libvte.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libvte', required by 'virtual:world', not found

$ pkg-config --modversion vte-2.91
0.68.0

@nonstop
Copy link
Owner

nonstop commented Sep 19, 2022

fedora on my desktop
vte vte - Vte terminal widget

Remove this package and all troubles with "include"-s should be gone.

@SwissalpS
Copy link
Contributor Author

I improved the workflow output and made two branches:

Output of vteDump.sh on ubuntu:

> pkg-config --list-all|grep vte
vte-2.91              vte - VTE widget for GTK+ 3.0
> pkg-config --modversion vte-2.91
0.68.0
Package vte291 was not found in the pkg-config search path.
> pkg-config --modversion vte291
Perhaps you should add the directory containing `vte291.pc'
> pkg-config --modversion libvte
to the PKG_CONFIG_PATH environment variable
No package 'vte291' found
Package libvte was not found in the pkg-config search path.
> pkg-config --modversion vte
Perhaps you should add the directory containing `libvte.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libvte' found
> ls -al /usr/include/vte*
Package vte was not found in the pkg-config search path.
Perhaps you should add the directory containing `vte.pc'
to the PKG_CONFIG_PATH environment variable
No package 'vte' found

fedora:

> pkg-config --list-all|grep vte
vte-2.91                       vte - VTE widget for GTK+ 3.0
> pkg-config --modversion vte-2.91
0.68.0
> pkg-config --modversion vte291
Package vte291 was not found in the pkg-config search path.
Perhaps you should add the directory containing `vte291.pc'
to the PKG_CONFIG_PATH environment variable
Package 'vte291', required by 'virtual:world', not found
> pkg-config --modversion libvte
Package libvte was not found in the pkg-config search path.
Perhaps you should add the directory containing `libvte.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libvte', required by 'virtual:world', not found
> pkg-config --modversion vte
Package vte was not found in the pkg-config search path.
Perhaps you should add the directory containing `vte.pc'
to the PKG_CONFIG_PATH environment variable
Package 'vte', required by 'virtual:world', not found

workflow log of AA variant
https://github.com/SwissalpS/termit/actions/runs/3085519617/jobs/4988901299
fedora build stage fails with:

[  4%] Building C object src/CMakeFiles/termit.dir/termit.c.o
/__w/termit/termit/src/termit.c:22:10: fatal error: vte/vte.h: No such file or directory
   22 | #include <vte/vte.h>
      |          ^~~~~~~~~~~
compilation terminated.

@nonstop
Copy link
Owner

nonstop commented Sep 21, 2022

for fedora please show the output for
pkg-config --cflags vte-2.91
pkg-config --libs vte-2.91
find /usr/include -name vte -type d

SwissalpS added a commit to SwissalpS/termit that referenced this issue Sep 21, 2022
@SwissalpS
Copy link
Contributor Author

> pkg-config --cflags vte-2.91
-I/usr/include/vte-2.91 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/fribidi -I/usr/include/libxml2 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gtk-3.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cloudproviders -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/at-spi-2.0 -pthread 
> pkg-config --libs vte-2.91
-lvte-2.91 -lgtk-3 -lgdk-3 -lz -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 
> find /usr/include -name vte -type d
/usr/include/vte-2.91/vte

@nonstop
Copy link
Owner

nonstop commented Sep 27, 2022

According to proper include -I/usr/include/vte-2.91 and the presence of /usr/include/vte-2.91/vte the only remaining reason can be the content of this directory.
What is inside?
ls -l /usr/include/vte-2.91/vte

Next time please build termit with verbose logs: make VERBOSE=0

@SwissalpS
Copy link
Contributor Author

SwissalpS commented Sep 27, 2022

test workflow log (with VERBOSE=0)

contents of /usr/include/vte-2.91/vte:

total 80
-rw-r--r-- 1 root root  1211 Mar 27  2022 vte.h
-rw-r--r-- 1 root root  6626 Mar 27  2022 vtedeprecated.h
-rw-r--r-- 1 root root  6818 Mar 27  2022 vteenums.h
-rw-r--r-- 1 root root  1224 Mar 27  2022 vteglobals.h
-rw-r--r-- 1 root root  1718 Mar 27  2022 vtemacros.h
-rw-r--r-- 1 root root  5124 Mar 27  2022 vtepty.h
-rw-r--r-- 1 root root  26 Mar 27  2022 vteregex.h
-rw-r--r-- 1 root root 25207 Mar 27  2022 vteterminal.h
-rw-r--r-- 1 root root  1593 Mar 27  2022 vtetypebuiltins-gtk3.h
-rw-r--r-- 1 root root   970 Mar 27  2022 vtetypebuiltins.h
-rw-r--r-- 1 root root  2343 Mar 27  2022 vteversion.h

@Rongronggg9
Copy link
Contributor

Rongronggg9 commented Oct 17, 2022

Reproduced: https://oss.cipunited.com/ci/job/ciBuilds/job/termit/27/execution/node/47/log/

SET(TERMIT_CFLAGS "-I${LUA_INCLUDE_DIR}")
IF(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
SET(TERMIT_CFLAGS "${TERMIT_CFLAGS} -I/usr/local/include")
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
FOREACH(cflag ${VTE_CFLAGS} ${GTK_CFLAGS} ${LUA_CFLAGS})
SET(TERMIT_CFLAGS "${TERMIT_CFLAGS} ${cflag}")
ENDFOREACH(cflag)

LUA_INCLUDE_DIR is incorrect, the correct one is LUA_INCLUDEDIR (mistakenly introduced in df9295b and b08e498). Thus, "-I${LUA_INCLUDE_DIR}" will become "-I", suppressing the following argument (in both my and @SwissalpS's cases, it is -I/usr/include/vte-2.91). However, it can be simply dropped as d9731f1 has already included LUA_CFLAGS in TERMIT_CFLAGS.

CMake doc here: https://cmake.org/cmake/help/v3.24/module/FindPkgConfig.html

-SET(TERMIT_CFLAGS "-I${LUA_INCLUDE_DIR}")
+SET(TERMIT_CFLAGS "")

With this patch, built successfully on Arch Linux (mips64r6el, QEMU user): https://oss.cipunited.com/ci/job/ciBuilds/job/termit/42/execution/node/57/log/

Also built successfully on Arch Linux and Debian sid (both x86_64) in my local tests.


This is a weird issue. LUA_INCLUDE_DIR has been mistakenly used for 14 years and Debian shows that no patch is needed to build termit. Tried to build on Arch Linux and Debian sid, but I can only reproduce it on the former.

Let's do a deep dive. What makes Arch Linux (, Fedora and Ubuntu, according to #125 (comment)) behave differently from Debian sid? Why Debian sid is not affected by the mistake?

This is an interesting story.

On Arch Linux, we see /usr/sbin/cc -I/termit -Wall -I -I/usr/include/vte-2.91 ..., while on Debian sid, we see /usr/bin/cc -I/termit -Wall -I -pthread -I/usr/include/vte-2.91 .... It is -pthread who saves vte:

> pkg-config --cflags vte-2.91  # Arch Linux
-I/usr/include/vte-2.91 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-4 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/pixman-1 -I/usr/include/gtk-3.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cloudproviders -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -pthread
> pkg-config --cflags vte-2.91  # Debian sid
-pthread -I/usr/include/vte-2.91 -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/x86_64-linux-gnu -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include

However, -pthread has never gone as GTK3 requires it:

> pkg-config --cflags gtk+-3.0
-pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/x86_64-linux-gnu -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include

Thus, on Debian sid, nothing is missing. The coincidence lasted for 14 years!

build env

Arch Linux (x86_64)

  termit 3.1.0

Prefix dir:.......... /usr/local
Locales dir:......... /usr/local/share/locale
Xdg dir:............. /etc/xdg/termit
Gtk:................. 3.24.34
Vte:................. 0.68.0
Lua:................. 5.4.4
Debug:............... FALSE
cmake version 3.24.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).
[  3%] Building C object src/CMakeFiles/termit.dir/termit.c.o
cd /termit/build/src && /usr/sbin/cc  -I/termit -Wall -I -I/usr/include/vte-2.91 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-4 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/pixman-1 -I/usr/include/gtk-3.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cloudproviders -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -pthread -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-4 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cloudproviders -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -pthread -O2 -MD -MT src/CMakeFiles/termit.dir/termit.c.o -MF CMakeFiles/termit.dir/termit.c.o.d -o CMakeFiles/termit.dir/termit.c.o -c /termit/src/termit.c
/termit/src/termit.c:22:10: fatal error: vte/vte.h: No such file or directory
   22 | #include <vte/vte.h>
      |          ^~~~~~~~~~~
compilation terminated.

Debian sid (x86_64)

  termit 3.1.0

Prefix dir:.......... /usr/local
Locales dir:......... /usr/local/share/locale
Xdg dir:............. /etc/xdg/termit
Gtk:................. 3.24.34
Vte:................. 0.70.0
Lua:................. 5.4.4
Debug:............... FALSE
cmake version 3.24.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).
[  4%] Building C object src/CMakeFiles/termit.dir/termit.c.o
cd /termit/build/src && /usr/bin/cc  -I/termit -Wall -I -pthread -I/usr/include/vte-2.91 -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/x86_64-linux-gnu -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/x86_64-linux-gnu -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/lua5.4 -O2 -MD -MT src/CMakeFiles/termit.dir/termit.c.o -MF CMakeFiles/termit.dir/termit.c.o.d -o CMakeFiles/termit.dir/termit.c.o -c /termit/src/termit.c

@nonstop
Copy link
Owner

nonstop commented Oct 27, 2022

Luke, is everything fine?
Can I close this issue?

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