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

Vala: specify generated vala headers as dependencies of other subfolders in the same project #1229

Open
arrufat opened this issue Dec 19, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@arrufat
Copy link

commented Dec 19, 2016

Here's a detailed explaination of the issue.

I have a project which depends on a header file generated by the Vala compiler in a subfolder.
AFAIK, there's no way to telling meson that the project depends on that header file (which does not exist at configure time, but will be generated at build time).

How could this be done?
I guess one solution would be to have a separate Vala project that builds a shared/static library and installs the header file and then add it as a subproject, but I came accross issue #892.

Thanks in advance.

@nirbheek nirbheek added the vala label Dec 19, 2016

@nirbheek

This comment has been minimized.

Copy link
Member

commented Dec 19, 2016

The usual way to do this for generated headers is to use a declare_dependency() and add the generated header to the sources: kwarg inside that. However you can't do this with Vala generated headers because there's no way to get a 'reference' to that yet. #892 is also about that.

@nirbheek

This comment has been minimized.

Copy link
Member

commented Dec 19, 2016

This has been on my list for two releases now, but it was blocked because we weren't sure how to implement it, and then I didn't have time. I'll work on it for the next release.

@arrufat

This comment has been minimized.

Copy link
Author

commented Dec 19, 2016

Thank you :)

@nirbheek nirbheek modified the milestone: 0.38.0 Dec 20, 2016

@nirbheek nirbheek modified the milestones: 0.38.0, 0.39.0 Feb 1, 2017

@nirbheek nirbheek modified the milestones: 0.39.0, 0.40.0 Mar 9, 2017

gnomesysadmins pushed a commit to GNOME/tracker that referenced this issue Mar 11, 2017

Meson build instructions for Tracker
See <http://mesonbuild.com/> for information about Meson.

These build instructions are close to completion.

Differences from Autotools:

  * There's no `make dist` equivalent. We currently produce release
    tarballs containing the output files of the Vala compiler. We need
    to think through whether we can stop doing that.
  * The apps and userguides miners are not built
  * The Firefox, Thunderbird, Evolution and Nautilus plugins are not
    built
  * tracker-needle is not built
  * The stopwords are not installed
  * tracker-writeback is not built
  * Perhaps some other regressions, who knows.

There are a couple of Meson bugs which make the Meson rules more
complex than they'd otherwise need to be:

  * mesonbuild/meson#671 -- means we can't
    depend on tracker_common_dep in most places and have to manually
    set link_with, include_directories and sources instead.
  * mesonbuild/meson#892 -- means we have
    to install generated Vala headers using a script
  * mesonbuild/meson#1229 -- means adding
    the #include guard to libtracker-sparql/tracker-generated-no-checks.h
    is a pain

Here's a rough speed comparison.

Meson:
        time sh -c 'meson .. --prefix=/opt/tracker-meson -D bash_completion=/opt/tracker-meson/share/bash-completion -Dsystemd_services=/opt/tracker-meson/lib/systemd/user -Ddbus_services=/opt/tracker-meson/share/dbus-1/services && ninja-build -j 4 && ninja-build install'

        real  0m59.017s
        user  2m1.208s
        sys   0m18.125s

Autotools:

        still waiting for ./configure to finish

gnomesysadmins pushed a commit to GNOME/tracker that referenced this issue Mar 11, 2017

Meson build instructions for Tracker
See <http://mesonbuild.com/> for information about Meson.

These build instructions are close to completion.

Main sticking point: how to generate the introspection data for
libtracker-sparql ??

Also: writeback, needle, that's it!

Differences from Autotools:

  * There's no `make dist` equivalent. We currently produce release
    tarballs containing the output files of the Vala compiler. We need
    to think through whether we can stop doing that.
  * The Firefox, Thunderbird, Evolution and Nautilus plugins are not
    built
  * tracker-needle is not built
  * The stopwords are not installed
  * tracker-writeback is not built
  * Perhaps some other regressions, who knows.

There are a couple of Meson bugs which make the Meson rules more
complex than they'd otherwise need to be:

  * mesonbuild/meson#671 -- means we can't
    depend on tracker_common_dep in most places and have to manually
    set link_with, include_directories and sources instead.
  * mesonbuild/meson#892 -- means we have
    to install generated Vala headers using a script
  * mesonbuild/meson#1229 -- means adding
    the #include guard to libtracker-sparql/tracker-generated-no-checks.h
    is a pain

Here's a rough speed comparison.

Meson:
        time sh -c 'meson .. --prefix=/opt/tracker-meson -D bash_completion=/opt/tracker-meson/share/bash-completion -Dsystemd_user_services=/opt/tracker-meson/lib/systemd/user -Ddbus_services=/opt/tracker-meson/share/dbus-1/services && ninja-build -j 4 && ninja-build install'

        real  1m8.194s
        user  2m16.962s
        sys   0m20.532s

Autotools:
        time sh -c './configure --prefix=/opt/tracker-autotools --with-bash-completion-dir=/opt/tracker-autotools/share/bash-completion --with-session-bus-services-dir=/opt/tracker-autotools/share/dbus-1/services --disable-nautilus-extension && make -j 4 && make install'

        real  2m37.750s
        user  4m37.214s
        sys   0m54.806s

        Plus 30+ seconds of ./autogen.sh first.

Note that Meson builds may fail if your source tree has generated
files from an Autotools build in there. If you see errors about
duplicate definitions, first try cleaning your source tree (use `git clean
-dfx`, but make sure you commit any work first!!)

gnomesysadmins pushed a commit to GNOME/tracker that referenced this issue Mar 22, 2017

Meson build instructions for Tracker
See <http://mesonbuild.com/> for information about Meson.

These build instructions are close to completion.

writeback, stopwords and it can be merged.

Differences from Autotools:

  * There's no `make dist` equivalent. We currently produce release
    tarballs containing the output files of the Vala compiler. We need
    to think through whether we can stop doing that.
  * The Firefox, Thunderbird, Evolution and Nautilus plugins are not
    built
  * The stopwords are not installed
  * tracker-writeback is not built
  * GIR may have regressions
  * Perhaps some other regressions, who knows.

There are a couple of Meson bugs which make the Meson rules more
complex than they'd otherwise need to be:

  * mesonbuild/meson#671 -- means we can't
    depend on tracker_common_dep in most places and have to manually
    set link_with, include_directories and sources instead.
  * mesonbuild/meson#892 -- means we have
    to install generated Vala headers using a script
  * mesonbuild/meson#1229 -- means adding
    the #include guard to libtracker-sparql/tracker-generated-no-checks.h
    is a pain

Here's a rough speed comparison.

Meson:
        time sh -c 'meson .. --prefix=/opt/tracker-meson -D bash_completion=/opt/tracker-meson/share/bash-completion -Dsystemd_user_services=/opt/tracker-meson/lib/systemd/user -Ddbus_services=/opt/tracker-meson/share/dbus-1/services && ninja-build -j 4 && ninja-build install'

        real  1m8.194s
        user  2m16.962s
        sys   0m20.532s

Autotools:
        time sh -c './configure --prefix=/opt/tracker-autotools --with-bash-completion-dir=/opt/tracker-autotools/share/bash-completion --with-session-bus-services-dir=/opt/tracker-autotools/share/dbus-1/services --disable-nautilus-extension && make -j 4 && make install'

        real  2m37.750s
        user  4m37.214s
        sys   0m54.806s

        Plus 30+ seconds of ./autogen.sh first.

Note that Meson builds may fail if your source tree has generated
files from an Autotools build in there. If you see errors about
duplicate definitions, first try cleaning your source tree (use `git clean
-dfx`, but make sure you commit any work first!!)

gnomesysadmins pushed a commit to GNOME/tracker that referenced this issue Mar 30, 2017

Meson build instructions for Tracker
See <http://mesonbuild.com/> for information about Meson.

These build instructions are close to completion.

Remaining issues:

  * Some Vala problem:

        ninja: error: 'src/libtracker-sparql/tracker-sparql-intermediate.vapi', needed by
        'src/libtracker-sparql-backend/tracker-sparql-1.0@sha/tracker-backend.c',
        missing and no known rule to make it

    Possibly Meson bug (is it ignoring the vapi_name parameter we pass
    for the libtracker-sparql library and assuming a different .vapi
    name?)

  * There's no `make dist` equivalent. We currently produce release
    tarballs containing the output files of the Vala compiler. We need
    to think through whether we can stop doing that. Shipping the
    generated .c files does make the Vala preprocessor useless so
    it would be good if we can stop.

  * The Firefox, Thunderbird, Evolution and Nautilus plugins are not
    built

There are a couple of Meson bugs which make the Meson rules more
complex than they'd otherwise need to be:

  * mesonbuild/meson#671 -- means we can't
    depend on tracker_common_dep in most places and have to manually
    set link_with, include_directories and sources instead.
  * mesonbuild/meson#892 -- means we have
    to install generated Vala headers using a script
  * mesonbuild/meson#1229 -- means adding
    the #include guard to libtracker-sparql/tracker-generated-no-checks.h
    is a pain

Here's a rough speed comparison.

Meson:
        time sh -c 'meson .. --prefix=/opt/tracker-meson -D bash_completion=/opt/tracker-meson/share/bash-completion -Dsystemd_user_services=/opt/tracker-meson/lib/systemd/user -Ddbus_services=/opt/tracker-meson/share/dbus-1/services && ninja-build -j 4 && ninja-build install'

        real  1m8.194s
        user  2m16.962s
        sys   0m20.532s

Autotools:
        time sh -c './configure --prefix=/opt/tracker-autotools --with-bash-completion-dir=/opt/tracker-autotools/share/bash-completion --with-session-bus-services-dir=/opt/tracker-autotools/share/dbus-1/services --disable-nautilus-extension && make -j 4 && make install'

        real  2m37.750s
        user  4m37.214s
        sys   0m54.806s

        Plus 30+ seconds of ./autogen.sh first.

Note that Meson builds may fail if your source tree has generated
files from an Autotools build in there. If you see errors about
duplicate definitions, first try cleaning your source tree (use `git clean
-dfx`, but make sure you commit any work first!!)

gnomesysadmins pushed a commit to GNOME/tracker that referenced this issue Mar 30, 2017

Meson build instructions for Tracker
See <http://mesonbuild.com/> for information about Meson.

Remaining issues:

  * There's no `make dist` equivalent. We currently produce release
    tarballs containing the output files of the Vala compiler. We need
    to think through whether we can stop doing that. Shipping the
    generated .c files does make the Vala preprocessor useless so
    it would be good if we can stop.

  * The Firefox, Thunderbird, Evolution and Nautilus plugins are not
    built

  * mesonbuild/meson#671 -- means we can't
    depend on tracker_common_dep in most places and have to manually
    set link_with, include_directories and sources instead.

  * mesonbuild/meson#1469 -- without this we
    have to install generated Vala headers using a script

  * mesonbuild/meson#1229 -- means adding
    the #include guard to libtracker-sparql/tracker-generated-no-checks.h
    is a pain

Here's a rough speed comparison.

Meson:
        time sh -c 'meson .. --prefix=/opt/tracker-meson -D bash_completion=/opt/tracker-meson/share/bash-completion -Dsystemd_user_services=/opt/tracker-meson/lib/systemd/user -Ddbus_services=/opt/tracker-meson/share/dbus-1/services && ninja-build -j 4 && ninja-build install'

        real  1m8.194s
        user  2m16.962s
        sys   0m20.532s

Autotools:
        time sh -c './configure --prefix=/opt/tracker-autotools --with-bash-completion-dir=/opt/tracker-autotools/share/bash-completion --with-session-bus-services-dir=/opt/tracker-autotools/share/dbus-1/services --disable-nautilus-extension && make -j 4 && make install'

        real  2m37.750s
        user  4m37.214s
        sys   0m54.806s

        Plus 30+ seconds of ./autogen.sh first.

Note that Meson builds may fail if your source tree has generated files
from an Autotools build in there. If you see errors about duplicate
definitions, first try cleaning your source tree (use `git clean -dfx`,
but make sure you commit any work first!!)

@nirbheek nirbheek modified the milestone: 0.40.0 Apr 22, 2017

gnomesysadmins pushed a commit to GNOME/tracker that referenced this issue May 21, 2017

Meson build instructions for Tracker
See <http://mesonbuild.com/> for information about Meson.

Remaining issues:

  * There's no `make dist` equivalent. We currently produce release
    tarballs containing the output files of the Vala compiler. We need
    to think through whether we can stop doing that. Shipping the
    generated .c files does make the Vala preprocessor useless so
    it would be good if we can stop.

  * The Firefox, Thunderbird, Evolution and Nautilus plugins are not
    built

  * mesonbuild/meson#671 -- means we can't
    depend on tracker_common_dep in most places and have to manually
    set link_with, include_directories and sources instead.

  * mesonbuild/meson#1469 -- without this we
    have to install generated Vala headers using a script

  * mesonbuild/meson#1229 -- means adding
    the #include guard to libtracker-sparql/tracker-generated-no-checks.h
    is a pain

Here's a rough speed comparison.

Meson:
        time sh -c 'meson .. --prefix=/opt/tracker-meson -D bash_completion=/opt/tracker-meson/share/bash-completion -Dsystemd_user_services=/opt/tracker-meson/lib/systemd/user -Ddbus_services=/opt/tracker-meson/share/dbus-1/services && ninja-build -j 4 && ninja-build install'

        real  1m8.194s
        user  2m16.962s
        sys   0m20.532s

Autotools:
        time sh -c './configure --prefix=/opt/tracker-autotools --with-bash-completion-dir=/opt/tracker-autotools/share/bash-completion --with-session-bus-services-dir=/opt/tracker-autotools/share/dbus-1/services --disable-nautilus-extension && make -j 4 && make install'

        real  2m37.750s
        user  4m37.214s
        sys   0m54.806s

        Plus 30+ seconds of ./autogen.sh first.

Note that Meson builds may fail if your source tree has generated files
from an Autotools build in there. If you see errors about duplicate
definitions, first try cleaning your source tree (use `git clean -dfx`,
but make sure you commit any work first!!)

gnomesysadmins pushed a commit to GNOME/tracker that referenced this issue May 22, 2017

Meson build instructions for Tracker
See <http://mesonbuild.com/> for information about Meson.

Remaining issues:

  * There's no `make dist` equivalent. We currently produce release
    tarballs containing the output files of the Vala compiler. We need
    to think through whether we can stop doing that. Shipping the
    generated .c files does make the Vala preprocessor useless so
    it would be good if we can stop.

  * The Firefox, Thunderbird, Evolution and Nautilus plugins are not
    built

  * mesonbuild/meson#671 -- means we can't
    depend on tracker_common_dep in most places and have to manually
    set link_with, include_directories and sources instead.

  * mesonbuild/meson#1469 -- without this we
    have to install generated Vala headers using a script

  * mesonbuild/meson#1229 -- means adding
    the #include guard to libtracker-sparql/tracker-generated-no-checks.h
    is a pain

  * The test suite has some spurious failures.

Here's a rough speed comparison.

Meson:
        time sh -c 'meson .. --prefix=/opt/tracker-meson -D bash_completion=/opt/tracker-meson/share/bash-completion -Dsystemd_user_services=/opt/tracker-meson/lib/systemd/user -Ddbus_services=/opt/tracker-meson/share/dbus-1/services && ninja-build -j 4 && ninja-build install'

        real  1m8.194s
        user  2m16.962s
        sys   0m20.532s

Autotools:
        time sh -c './configure --prefix=/opt/tracker-autotools --with-bash-completion-dir=/opt/tracker-autotools/share/bash-completion --with-session-bus-services-dir=/opt/tracker-autotools/share/dbus-1/services --disable-nautilus-extension && make -j 4 && make install'

        real  2m37.750s
        user  4m37.214s
        sys   0m54.806s

        Plus 30+ seconds of ./autogen.sh first.

Note that Meson builds may fail if your source tree has generated files
from an Autotools build in there. If you see errors about duplicate
definitions, first try cleaning your source tree (use `git clean -dfx`,
but make sure you commit any work first!!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.