Unable to declare template in same recipe where it's used

Bug #1418773 reported by Mario Daniel Ruiz Saavedra on 2015-02-06
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bake
Undecided
Unassigned

Bug Description

I am trying to declare a template on the same Recipe that the compilation files. However it crashes with a "small" allocation. I've already tried on different computers, but it still fails, trying to swallow the available memory.
The error log (bake --verbose -d):

Loading Recipe
Loading data/Recipe
Loading po/Recipe
Loading src/Recipe
Considering target %buildConsidering target data/%buildTarget data/%build defined in recipe data/RecipeConsidering target data/%buildConsidering target po/%buildTarget po/%build defined in recipe po/RecipeConsidering target po/%buildConsidering target po/system-info.potConsidering target src/.built/main.vala.potTarget src/.built/main.vala.pot defined in recipe src/RecipeConsidering target src/.built/main.vala.potConsidering target src/.built/Output src/.built/ is missingConsidering target src/main.valaConsidering target src/.built/window.vala.potTarget src/.built/window.vala.pot defined in recipe src/RecipeConsidering target src/.built/window.vala.potConsidering target src/.built/Considering target src/window.valaOutput src/.built/window.vala.pot is missingConsidering target src/.built/build-config.vala.potTarget src/.built/build-config.vala.pot defined in recipe src/RecipeConsidering target src/.built/build-config.vala.potConsidering target src/.built/Considering target src/build-config.valaConsidering target src/build-config.vala.templateOutput src/build-config.vala is missingConsidering target src/.built/datablock.vala.potTarget src/.built/datablock.vala.pot defined in recipe src/RecipeConsidering target src/.built/datablock.vala.potConsidering target src/.built/Considering target src/datablock.valaConsidering target data/.built/system-info.desktop.potTarget data/.built/system-info.desktop.pot defined in recipe data/RecipeConsidering target data/.built/system-info.desktop.potConsidering target data/.built/Considering target data/system-info.desktopConsidering target src/%buildTarget src/%build defined in recipe src/RecipeConsidering target src/%buildConsidering target src/build-config.valaConsidering target src/build-config.vala.templateConsidering target src/system-info[Entering directory src]
mkdir -p .built
bake-gettext --domain system-info --mime-type text/x-vala --output .built/main.vala.pot main.vala
bake-gettext --domain system-info --mime-type text/x-vala --output .built/window.vala.pot window.vala
bake-template build-config.vala.template build-config.vala @DATADIR@=/usr/share @PACKAGE_DATA_DIR@=/usr/share/system-info @GETTEXT_PACKAGE@=system-info @RELEASE_NAME@=system-info @VERSION_INFO@=Information and Performance. @VERSION@=0.1 @PROGRAM_NAME@=System Information @EXEC_NAME@=system-info @COPYRIGHT_YEARS@ =2015 @MAIN_URL@=https://launchpad.net/system-info @BUG_URL@=https://bugs.launchpad.net/system-info @HELP_URL@=https://answers.launchpad.net/system-info @TRANSLATE_URL@=https://translations.launchpad.net/system-info

(process:5515): GLib-ERROR **: /build/buildd/glib2.0-2.42.1/./glib/gmem.c:168: failed to allocate 4294967296 bytes
Trace/breakpoint trap (core dumped)
Command exited with return value 133
[Build failed]

The recipe:

templates.system-info{

    files = build-config.vala

    variables = @DATADIR@=$(options.data-directory) \
                @PACKAGE_DATA_DIR@=$(options.project-data-directory) \
                @GETTEXT_PACKAGE@=system-info \
                @RELEASE_NAME@=system-info \
                @VERSION_INFO@=Information and Performance. \
                @VERSION@=$(project.version) \
                @PROGRAM_NAME@=System Information \
                @EXEC_NAME@=system-info \
                @COPYRIGHT_YEARS@ =2015 \
                @MAIN_URL@=https://launchpad.net/system-info \
                @BUG_URL@=https://bugs.launchpad.net/system-info \
                @HELP_URL@=https://answers.launchpad.net/system-info \
                @TRANSLATE_URL@=https://translations.launchpad.net/system-info \

}

programs.system-info {

 sources = main.vala \
    window.vala\
    build-config.vala \
    datablock.vala \

 packages = gthread-2.0 \
    glib-2.0 >= 2.38.0 \
    gio-2.0 >= 2.28.0 \
    gtk+-3.0 >= 3.12.0 \
    gee-0.8 >= 0.8.0 \
    granite \

 vala-packages = glib-2.0 \
     gee-0.8 \
     gio-2.0 \
     posix \
     gtk+-3.0 \
     granite \

 gettext-domain = system-info

 compile-flags = -DGETTEXT_PACKAGE=\"system-info\"

 vala-compile-flags = --pkg gio-2.0 --target-glib=2.38 --thread --enable-checking --debug --enable-experimental --verbose --fatal-warnings

}

the template (build-config.vala.template):

namespace Build {
 public const string GETTEXT_PACKAGE = "@GETTEXT_PACKAGE@";
 public const string DATADIR = "@DATADIR@";
 public const string PACKAGE_DATA_DIR = "@PACKAGE_DATA_DIR@";
 public const string RELEASE_NAME = "@RELEASE_NAME@";
 public const string VERSION = "@VERSION@";
 public const string VERSION_INFO= "@VERSION_INFO@";
 public const string PROGRAM_NAME = "@PROGRAM_NAME@";
 public const string EXEC_NAME = "@EXEC_NAME@";
 public const string COPYRIGHT_YEARS = "@COPYRIGHT_YEARS@";
 public const string MAIN_URL = "@MAIN_URL@";
 public const string BUG_URL = "@BUG_URL@";
 public const string HELP_URL = "@HELP_URL@";
 public const string TRANSLATE_URL = "@TRANSLATE_URL@";
}

description: updated
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers