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

vsgi-server-module.vala:67: libvsgi-http.so: cannot open shared object file: No such file or directory #224

Open
devnix opened this issue Apr 8, 2019 · 9 comments · May be fixed by valum-framework/vsgi#8
Assignees
Milestone

Comments

@devnix
Copy link

devnix commented Apr 8, 2019

Hi! As soon as I include a gnome.compile_resources line in my meson.build, I'm getting a runtime error like the one of the title:

 ** (process:1): CRITICAL **: vsgi-server-module.vala:67: libvsgi-http.so: cannot open shared object file: No such file or director
 ** (process:1): CRITICAL **: vsgi_server_run: assertion 'self != NULL' failed

My meson.build looks like this:

project('valabb', 'c', 'vala')
gnome = import('gnome')

dependencies = [
	dependency('glib-2.0'),
	dependency('gobject-2.0'),
	dependency('gio-2.0'),
	dependency('libsoup-2.4'),
	dependency('vsgi-0.3'),
	dependency('valum-0.3'),
	dependency('template-glib-1.0'),
]

sources = files(
	'src/Application.vala',
	'src/Controller/IndexController.vala',
	'src/Controller/RegisterController.vala',
	'src/Controller/Admin/IndexController.vala',
)

sources += gnome.compile_resources(
	'template-glib-resources',
	'resources/app.gresource.xml',
	source_dir: './src'
)

vala_flags = '--gresourcesdir=' + join_paths(meson.current_source_dir(), 'resources')

executable(
	'valabb',
	sources,
	dependencies: dependencies,
	vala_args: vala_flags
)

If this is not related at all with Valum, please just let me know to open an issue somewhere else 😄

@arteymix
Copy link
Member

arteymix commented Apr 8, 2019

Server modules are loaded dynamically using -rtpath and $ORIGIN and I noticed it's not very robust in some linking setup.

Have you tried to use Meson built-in support for GResource?

@devnix
Copy link
Author

devnix commented Apr 9, 2019

I don't know any other way to use gresource with Meson, I thought that gnome.compile_resources was the supported method...

@arteymix
Copy link
Member

arteymix commented Apr 9, 2019

You shouldn't have to pass --gresourcedir if you already pass the result of gnome.compile_resources to your target.

There's a working example in https://github.com/valum-framework/valum/blob/master/examples/app/meson.build

I'm currently investigating how libgda does load its providers.

@devnix
Copy link
Author

devnix commented Apr 10, 2019

In my first attempts I was not passing any --gresourcedir. I've modified again my meson.build to look a little more like the example you are showing me but with the same results:

project('valabb', 'c', 'vala')
gnome = import('gnome')

dependencies = [
	dependency('glib-2.0'),
	dependency('gobject-2.0'),
	dependency('gio-2.0'),
	dependency('libsoup-2.4'),
	dependency('vsgi-0.3'),
	dependency('valum-0.3'),
	dependency('template-glib-1.0'),
]

sources = [
	'src/Application.vala',
	'src/Controller/IndexController.vala',
	'src/Controller/RegisterController.vala',
	'src/Controller/Admin/IndexController.vala',
]

sources += gnome.compile_resources(
	'template-glib-resources',
	'resources/app.gresource.xml',
	source_dir: './src'
)

executable(
	'valabb',
	sources,
	dependencies: dependencies
)

By the way, my initial work was based on https://github.com/valum-framework/valum/blob/master/examples/template-glib/meson.build

@msmaldi
Copy link

msmaldi commented Oct 4, 2019

Some problem

@arteymix
Copy link
Member

Is this still happening in the current trunk? I think we've addressed this in valum-framework/vsgi#6 by passing -Wl,--disable-new-dtags.

Maybe @colinkiama could have a look?

@colinkiama colinkiama self-assigned this Nov 16, 2021
@colinkiama
Copy link
Member

colinkiama commented Nov 17, 2021

I replicated the template-glib example and managed to get it working but only after adding the linker flags and rpath like I did in valum-framework/vsgi#6

Here's what the meson.build file looks like:

sources = [
  'main.vala'
]

sources += gnome.compile_resources(
  'template-glib-resources',
  'app.gresource.xml',
  source_dir: '.'
)

executable('valabb',
  sources,
  dependencies: dependencies,
  link_args: ['-Wl,--disable-new-dtags'],
  build_rpath: join_paths(get_option('prefix'), get_option('libdir'), 'vsgi-@0@/servers'.format('0.4')),
  install: true)

@arteymix arteymix added this to the 0.3.19 milestone Sep 7, 2022
@arteymix
Copy link
Member

It's about time we get this fixed.

The -rpath trick I've been using does not reliably work. We need a solution that works both when compiling as a Meson subproject and when linking against a regular installation.

@colinkiama
Copy link
Member

I suggest introducing some sort of configuration file system that allows us to load modules dynamically, like Apache and NGINX do.

What do you think?

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

Successfully merging a pull request may close this issue.

4 participants