Turning off optimization

classic Classic list List threaded Threaded
23 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Turning off optimization

Derrell Lipman
I tried adding the last stanza in this otherwise working config.json file, to turn off all optimization in the "build" version.  It has no effect.  The only success I've had at disabling optimization in the build was to replace the "optimize" line in base.json with "optimize":[].  That's clearly the wrong way to do it, but I needed to prove that it was possible.

What am I doing wrong in the last stanza?  Althougn in this case, I'm using the "extend" key, I also tried copying the entire "build-script" section from base.json and pasting it in here, and I tried replacing "build-script" with "appconf::build-script".

{
  "name"    : "lifeline",

  "include" :
  [
    {
      "path" : "../../../qooxdoo.git/trunk/qooxdoo/tool/data/config/application.json",
      "as"   : "appconf"
    }
  ],

  "let" :
  {
    "APPLICATION"  : "lifeline",
    "QOOXDOO_PATH" : "../../../qooxdoo.git/trunk/qooxdoo/framework",
    "QOOXDOO_URI"  : "../${QOOXDOO_PATH}",
    "QXTHEME"      : "lifeline.theme.Modern",
    "API_EXCLUDE"  : ["qx.legacy.*"],
    "LOCALES"      : [ "en" ],
    "ROOT"         : "."
  },

  "jobs" :
  {
    "include-contrib" :
    {
      "library":
      [
        {
          "manifest" : "../../../qooxdoo.git/qooxdoo-contrib/trunk/qooxdoo-contrib/TimeChooser/trunk/Manifest.json",
          "uri"      : "../../../qooxdoo.git/qooxdoo-contrib/trunk/qooxdoo-contrib/TimeChooser/trunk"
        }
      ]
    },

    "api" :
    {
      "extend" : ["include-contrib", "appconf::api"]
    },

    "build" :
    {
      "extend" : ["include-contrib", "appconf::build"]
    },

    "clean" :
    {
      "extend" : ["include-contrib", "appconf::clean"]
    },

    "distclean" :
    {
      "extend" : ["include-contrib", "appconf::distclean"]
    },

    "fix" :
    {
      "extend" : ["include-contrib", "appconf::fix"]
    },

    "lint" :
    {
      "extend" : ["include-contrib", "appconf::lint"]
    },

    "migration" :
    {
      "extend" : ["appconf::migration"]
    },

    "pretty" :
    {
      "extend" : ["appconf::pretty"]
    },

    "publish" :
    {
      "extend" : ["appconf::publish"]
    },

    "source" :
    {
      "extend" : ["include-contrib", "appconf::source"]
    },

    "test" :
    {
      "extend" : ["appconf::test"]
    },

    "test-source" :
    {
      "extend" : ["appconf::test-source"]
    },

    "translate" :
    {
      "extend" : ["appconf::translate"]
    },

    //
    // Added this to try to turn off optimizing.  What's wrong with this?
    //
    "build-script" :
    {
      "extend" : ["appconf::build-script"],
      "compile-dist" :
      {
        "target" : "${BUILD_PATH}",
        "file" : "${BUILD_PATH}/script/${APPLICATION}.js",
        "uri"  : "script/${APPLICATION}.js",
        "root" : "${BUILD_PATH}",
        "format" : "on",
        "locales" : "${LOCALES}",
        "optimize" : []
      }
    }
  }
}



Thanks for the help!

Derrell


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Turning off optimization

thron7
Hi Derrell,

it's a recurring theme on the mailing list, and I'm happy to rephrase
the answer, everytime from a slightly different angle so it becomes more
transparent, hopefully :).

Start from the job you are invoking on the command line. I suppose it is
"generate.py build", right?! If you look into your config, "build"
basically runs appconf::build. appconf::build is the "build" job from
base.json. It is itself just a "run" job that is replace by the sequence
of "build-script", "build-resources" and the like. Jobs are always
resolved *relative to the config in which they are referenced*.
Remember, job names are scoped identifiers (with the config file
defining the scope). This is why base.json's "build-script" job is run,
and not your's.

In order to make your build-script job run, I recommend changing your
"build" job in the following manner:

  "build" :
  {
    "extend" : ["include-contrib"],
    "run": ["build-script", "appconf::build-resources",
"appconf::build-files"]
  }

This way, your own build-script job is used, and you still get the
benefit of reusing the other appconf::build-* jobs. The  appconf::build
job itself would be substituted entirely this way.

HTH,
Thomas

Derrell Lipman wrote:

> I tried adding the last stanza in this otherwise working config.json file,
> to turn off all optimization in the "build" version.  It has no effect.  The
> only success I've had at disabling optimization in the build was to replace
> the "optimize" line in base.json with "optimize":[].  That's clearly the
> wrong way to do it, but I needed to prove that it was possible.
>
> What am I doing wrong in the last stanza?  Althougn in this case, I'm using
> the "extend" key, I also tried copying the entire "build-script" section
> from base.json and pasting it in here, and I tried replacing "build-script"
> with "appconf::build-script".
>
> {
>   "name"    : "lifeline",
>
>   "include" :
>   [
>     {
>       "path" :
> "../../../qooxdoo.git/trunk/qooxdoo/tool/data/config/application.json",
>       "as"   : "appconf"
>     }
>   ],
>
>   "let" :
>   {
>     "APPLICATION"  : "lifeline",
>     "QOOXDOO_PATH" : "../../../qooxdoo.git/trunk/qooxdoo/framework",
>     "QOOXDOO_URI"  : "../${QOOXDOO_PATH}",
>     "QXTHEME"      : "lifeline.theme.Modern",
>     "API_EXCLUDE"  : ["qx.legacy.*"],
>     "LOCALES"      : [ "en" ],
>     "ROOT"         : "."
>   },
>
>   "jobs" :
>   {
>     "include-contrib" :
>     {
>       "library":
>       [
>         {
>           "manifest" :
> "../../../qooxdoo.git/qooxdoo-contrib/trunk/qooxdoo-contrib/TimeChooser/trunk/Manifest.json",
>           "uri"      :
> "../../../qooxdoo.git/qooxdoo-contrib/trunk/qooxdoo-contrib/TimeChooser/trunk"
>         }
>       ]
>     },
>
>     "api" :
>     {
>       "extend" : ["include-contrib", "appconf::api"]
>     },
>
>     "build" :
>     {
>       "extend" : ["include-contrib", "appconf::build"]
>     },
>
>     "clean" :
>     {
>       "extend" : ["include-contrib", "appconf::clean"]
>     },
>
>     "distclean" :
>     {
>       "extend" : ["include-contrib", "appconf::distclean"]
>     },
>
>     "fix" :
>     {
>       "extend" : ["include-contrib", "appconf::fix"]
>     },
>
>     "lint" :
>     {
>       "extend" : ["include-contrib", "appconf::lint"]
>     },
>
>     "migration" :
>     {
>       "extend" : ["appconf::migration"]
>     },
>
>     "pretty" :
>     {
>       "extend" : ["appconf::pretty"]
>     },
>
>     "publish" :
>     {
>       "extend" : ["appconf::publish"]
>     },
>
>     "source" :
>     {
>       "extend" : ["include-contrib", "appconf::source"]
>     },
>
>     "test" :
>     {
>       "extend" : ["appconf::test"]
>     },
>
>     "test-source" :
>     {
>       "extend" : ["appconf::test-source"]
>     },
>
>     "translate" :
>     {
>       "extend" : ["appconf::translate"]
>     },
>
>     //
>     // Added this to try to turn off optimizing.  What's wrong with this?
>     //
>     "build-script" :
>     {
>       "extend" : ["appconf::build-script"],
>       "compile-dist" :
>       {
>         "target" : "${BUILD_PATH}",
>         "file" : "${BUILD_PATH}/script/${APPLICATION}.js",
>         "uri"  : "script/${APPLICATION}.js",
>         "root" : "${BUILD_PATH}",
>         "format" : "on",
>         "locales" : "${LOCALES}",
>         "optimize" : []
>       }
>     }
>   }
> }
>
>
>
> Thanks for the help!
>
> Derrell
>
>  
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> ------------------------------------------------------------------------
>
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>  

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Turning off optimization

Derrell Lipman
On Tue, Oct 14, 2008 at 4:04 AM, thron7 <[hidden email]> wrote:

In order to make your build-script job run, I recommend changing your
"build" job in the following manner:

Hi Thomas,

Thanks for the explanation.  I'm really trying to understand this black art of config file writing, but I still don't grok it.  When I add the stanza you specified, I get an error.  I've tried simplifying it to just have my own local "build" that does exactly what the "build" in base.conf does, but I get the same error.  The error is:

============================================================================
    INITIALIZING: GUI2
============================================================================
>>> Configuration: config.json
>>> Jobs: build
>>> Resolving jobs...
Traceback (most recent call last):
  File "/home/derrell/=/qooxdoo.git/trunk/qooxdoo/tool/bin/generator.py", line 133, in <module>
    main()
  File "/home/derrell/=/qooxdoo.git/trunk/qooxdoo/tool/bin/generator.py", line 114, in main
    expandedjobs = config.resolveExtendsAndRuns(options.jobs[:])
  File "/home/derrell/=/qooxdoo.git/trunk/qooxdoo/tool/pylib/generator/config/Config.py", line 292, in resolveExtendsAndRuns
    self._resolveRuns(jobList)
  File "/home/derrell/=/qooxdoo.git/trunk/qooxdoo/tool/pylib/generator/config/Config.py", line 347, in _resolveRuns
    raise RuntimeError, "No such job: %s" % subjob
RuntimeError: No such job: appconf::build-resources


Here's the complete config.json file.  The only difference from a working version is the working one's "build" contains only the single line

  "extend" : ["include-contrib", "appconf::build"]

whereas this version attempts to redefine the "build" to use the appconf job descriptions.

{
  "name"    : "lifeline",

  "include" :
  [
    {
      "path" : "../../../qooxdoo.git/trunk/qooxdoo/tool/data/config/application.json",
      "as"   : "appconf"
    }
  ],

  "let" :
  {
    "APPLICATION"  : "lifeline",
    "QOOXDOO_PATH" : "../../../qooxdoo.git/trunk/qooxdoo/framework",
    "QOOXDOO_URI"  : "../${QOOXDOO_PATH}",
    "QXTHEME"      : "lifeline.theme.Modern",
    "API_EXCLUDE"  : ["qx.legacy.*"],
    "LOCALES"      : [ "en" ],
    "ROOT"         : "."
  },

  "jobs" :
  {
    "include-contrib" :
    {
      "library":
      [
        {
          "manifest" : "../../../qooxdoo.git/qooxdoo-contrib/trunk/qooxdoo-contrib/TimeChooser/trunk/Manifest.json",
          "uri"      : "../../../qooxdoo.git/qooxdoo-contrib/trunk/qooxdoo-contrib/TimeChooser/trunk"
        }
      ]
    },

    "api" :
    {
      "extend" : ["include-contrib", "appconf::api"]
    },

    "build" :
    {
      "extend" : ["include-contrib"],
      "run" :
      [
        "appconf::build-resources",
        "appconf::build-script",
        "appconf::build-files"
      ]
    },

    "clean" :
    {
      "extend" : ["include-contrib", "appconf::clean"]
    },

    "distclean" :
    {
      "extend" : ["include-contrib", "appconf::distclean"]
    },

    "fix" :
    {
      "extend" : ["include-contrib", "appconf::fix"]
    },

    "lint" :
    {
      "extend" : ["include-contrib", "appconf::lint"]
    },

    "migration" :
    {
      "extend" : ["appconf::migration"]
    },

    "pretty" :
    {
      "extend" : ["appconf::pretty"]
    },

    "publish" :
    {
      "extend" : ["appconf::publish"]
    },

    "source" :
    {
      "extend" : ["include-contrib", "appconf::source"]
    },

    "test" :
    {
      "extend" : ["appconf::test"]
    },

    "test-source" :
    {
      "extend" : ["appconf::test-source"]
    },

    "translate" :
    {
      "extend" : ["appconf::translate"]
    }

  }
}



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Turning off optimization

thron7

> Traceback (most recent call last):
>   File "/home/derrell/=/qooxdoo.git/trunk/qooxdoo/tool/bin/generator.py",
> line 133, in <module>
>     main()
>   File "/home/derrell/=/qooxdoo.git/trunk/qooxdoo/tool/bin/generator.py",
> line 114, in main
>     expandedjobs = config.resolveExtendsAndRuns(options.jobs[:])
>   File
> "/home/derrell/=/qooxdoo.git/trunk/qooxdoo/tool/pylib/generator/config/Config.py",
> line 292, in resolveExtendsAndRuns
>     self._resolveRuns(jobList)
>   File
> "/home/derrell/=/qooxdoo.git/trunk/qooxdoo/tool/pylib/generator/config/Config.py",
> line 347, in _resolveRuns
>     raise RuntimeError, "No such job: %s" % subjob
> RuntimeError: No such job: appconf::build-resources
>  

Oups, sorry, my fault. A config file can choose which of its jobs it
wants to export, in case it is included by some other. While the
(higher-level) "build" job is exported by application.json, the
(lower-level) subjobs are not. Just to get you going, in your
environment please edit application.json and base.json and comment out
the "export" keys near the top of the files. This should render jobs
like "build-resources" valid.

As an alternativ, you could just copy the missing jobs from base.json
over to your config file.

Cheers,
Thomas

>
> Here's the complete config.json file.  The only difference from a working
> version is the working one's "build" contains only the single line
>
>   "extend" : ["include-contrib", "appconf::build"]
>
> whereas this version attempts to redefine the "build" to use the appconf job
> descriptions.
>
> {
>   "name"    : "lifeline",
>
>   "include" :
>   [
>     {
>       "path" :
> "../../../qooxdoo.git/trunk/qooxdoo/tool/data/config/application.json",
>       "as"   : "appconf"
>     }
>   ],
>
>   "let" :
>   {
>     "APPLICATION"  : "lifeline",
>     "QOOXDOO_PATH" : "../../../qooxdoo.git/trunk/qooxdoo/framework",
>     "QOOXDOO_URI"  : "../${QOOXDOO_PATH}",
>     "QXTHEME"      : "lifeline.theme.Modern",
>     "API_EXCLUDE"  : ["qx.legacy.*"],
>     "LOCALES"      : [ "en" ],
>     "ROOT"         : "."
>   },
>
>   "jobs" :
>   {
>     "include-contrib" :
>     {
>       "library":
>       [
>         {
>           "manifest" :
> "../../../qooxdoo.git/qooxdoo-contrib/trunk/qooxdoo-contrib/TimeChooser/trunk/Manifest.json",
>           "uri"      :
> "../../../qooxdoo.git/qooxdoo-contrib/trunk/qooxdoo-contrib/TimeChooser/trunk"
>         }
>       ]
>     },
>
>     "api" :
>     {
>       "extend" : ["include-contrib", "appconf::api"]
>     },
>
>     "build" :
>     {
>       "extend" : ["include-contrib"],
>       "run" :
>       [
>         "appconf::build-resources",
>         "appconf::build-script",
>         "appconf::build-files"
>       ]
>     },
>
>     "clean" :
>     {
>       "extend" : ["include-contrib", "appconf::clean"]
>     },
>
>     "distclean" :
>     {
>       "extend" : ["include-contrib", "appconf::distclean"]
>     },
>
>     "fix" :
>     {
>       "extend" : ["include-contrib", "appconf::fix"]
>     },
>
>     "lint" :
>     {
>       "extend" : ["include-contrib", "appconf::lint"]
>     },
>
>     "migration" :
>     {
>       "extend" : ["appconf::migration"]
>     },
>
>     "pretty" :
>     {
>       "extend" : ["appconf::pretty"]
>     },
>
>     "publish" :
>     {
>       "extend" : ["appconf::publish"]
>     },
>
>     "source" :
>     {
>       "extend" : ["include-contrib", "appconf::source"]
>     },
>
>     "test" :
>     {
>       "extend" : ["appconf::test"]
>     },
>
>     "test-source" :
>     {
>       "extend" : ["appconf::test-source"]
>     },
>
>     "translate" :
>     {
>       "extend" : ["appconf::translate"]
>     }
>
>   }
> }
>
>  
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> ------------------------------------------------------------------------
>
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>  

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Turning off optimization

Derrell Lipman
On Tue, Oct 14, 2008 at 10:16 AM, thron7 <[hidden email]> wrote:

> Traceback (most recent call last):
>   File "/home/derrell/=/qooxdoo.git/trunk/qooxdoo/tool/bin/generator.py",
> line 133, in <module>
>     main()
>   File "/home/derrell/=/qooxdoo.git/trunk/qooxdoo/tool/bin/generator.py",
> line 114, in main
>     expandedjobs = config.resolveExtendsAndRuns(options.jobs[:])
>   File
> "/home/derrell/=/qooxdoo.git/trunk/qooxdoo/tool/pylib/generator/config/Config.py",
> line 292, in resolveExtendsAndRuns
>     self._resolveRuns(jobList)
>   File
> "/home/derrell/=/qooxdoo.git/trunk/qooxdoo/tool/pylib/generator/config/Config.py",
> line 347, in _resolveRuns
>     raise RuntimeError, "No such job: %s" % subjob
> RuntimeError: No such job: appconf::build-resources
>

Oups, sorry, my fault. A config file can choose which of its jobs it
wants to export, in case it is included by some other. While the
(higher-level) "build" job is exported by application.json, the
(lower-level) subjobs are not. Just to get you going, in your
environment please edit application.json and base.json and comment out
the "export" keys near the top of the files. This should render jobs
like "build-resources" valid.

As an alternativ, you could just copy the missing jobs from base.json
over to your config file.

Ok.  Is the proper, permanent fix to delete those export keys in the standard application.json and base.json?  Should there be a ticket for this?  Should I just do that and check it in?  Or are you planning something entirely different?

Thanks,

Derrell



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Turning off optimization

thron7
Derrell,

>
> Ok.  Is the proper, permanent fix to delete those export keys in the
> standard application.json and base.json?  Should there be a ticket for
> this?  Should I just do that and check it in?  Or are you planning something
> entirely different?
>  

Gaetan was hitting at the same issue recently (s.
http://www.nabble.com/forum/ViewPost.jtp?post=19954437&framed=y). There
is a tradeoff here. Deleting the export keys from the json files is fine
with me, but it (a) clutters the job list obtained with "generate.py ?",
and (b) it increases the possibility of name clashes with existing job
names. On the other hand it allows for re-use of all the jobs in those
files. One is probably more relevant for entry-level users that just
start a new qooxdoo project, the other is more relevant for existing
users that try to migrate their 0.7 apps. I'm interested to take votes
as to what is regarded more important. A ticket is always fine :).

Plans are to change the import semantics (s. bug#1417), and this would
probably also affect the "export" key in one way or another. Which
wouldn't preclude commenting out the keys in the files in trunk for the
time being.

Thomas

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Turning off optimization

Gaetan de Menten
On Tue, Oct 14, 2008 at 6:19 PM, thron7 <[hidden email]> wrote:

> Derrell,
>
>>
>> Ok.  Is the proper, permanent fix to delete those export keys in the
>> standard application.json and base.json?  Should there be a ticket for
>> this?  Should I just do that and check it in?  Or are you planning something
>> entirely different?
>>
>
> Gaetan was hitting at the same issue recently (s.
> http://www.nabble.com/forum/ViewPost.jtp?post=19954437&framed=y). There
> is a tradeoff here. Deleting the export keys from the json files is fine
> with me, but it (a) clutters the job list obtained with "generate.py ?",
> and (b) it increases the possibility of name clashes with existing job
> names. On the other hand it allows for re-use of all the jobs in those
> files. One is probably more relevant for entry-level users that just
> start a new qooxdoo project, the other is more relevant for existing
> users that try to migrate their 0.7 apps. I'm interested to take votes
> as to what is regarded more important. A ticket is always fine :).
>
> Plans are to change the import semantics (s. bug#1417), and this would
> probably also affect the "export" key in one way or another. Which
> wouldn't preclude commenting out the keys in the files in trunk for the
> time being.

May I suggest an import mechanism similar to/inspired by python's? That is:
- everything is importable, whether you export it or not (in Python
terms, that'd be whether it is in __all__ or not)
- you can either import jobs without explicitely listing them in which
case all exported job are imported (and only those)
- but you can also import one or several job you list explicitly.

As for the "?" clutering problem, you could only list jobs in the
"root" namespace. So someone who doesn't want to clutter "?" would
import the jobs in a seperate namespace.

One more comment: I suggest you change "?" to something like "jobs",
"list", "list_jobs" or even "help", because "?" has a special meaning
in many shells so it simply doesn't work if you type it without
quotes:

ged@plaf:~/devel/ohxp-web/ > ./generate.py ?
zsh: no matches found: ?

If you type it with surrounding quotes it sort of works (since its not
a valid job, it prints the list of jobs), but still, this is a very
unusual practice.

--
Gaƫtan de Menten
http://openhex.org

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Turning off optimization

Jim Hunter
OK, I have tried just about everything I can to turn off all optimization and nothing is working. The string optimization if failing so I can't even test my program, let alone try and fix anything when I find an error. I have some code that looks like this:

            if (typeof AboutBox == "undefined")
            {
                AboutBox = new swep.sfAboutBox;
                mainWinContainer.add(AboutBox);
            }
            AboutBox.show();


it is getting generated as this:

if(typeof AboutBox==bg){AboutBox=new swep.sfAboutBox;
mainWinContainer.add(AboutBox);
}AboutBox.show();
});

The problem is that when you run the application, at the point in time where this code gets hit, the variable bg now contains #E6E6E6 and not 'undefined' so the compare fails and the AboutBox is never created. Then when you try and do AboutBox.show() you get an exception.

So I need to be able to turn off optimization so I can get back to testing my application.

Thanks,
Jim

here is my config.json (the current version, I have tried may variations):

{
  "name"    : "swep",

  "include" :
  [
    {
      "path" : "../../tool/data/config/application.json"
    }
  ],

  "let" :
  {
    "APPLICATION"  : "swep",
    "QOOXDOO_PATH" : "../../framework",
    "QOOXDOO_URI"  : "../${QOOXDOO_PATH}",
    "QXTHEME"      : "qx.theme.Modern",
    "API_EXCLUDE"  : ["qx.legacy.*"],
    "LOCALES"      : [ "en" ],
    "ROOT"         : "."
  },
  "compile-dist" :
  {
    "target" : "${BUILD_PATH}",
    "file" : "${BUILD_PATH}/script/${APPLICATION}.js",
    "uri"  : "script/${APPLICATION}.js",
    "root" : "${BUILD_PATH}",
    "format" : "on",
    "locales" : "${LOCALES}",
    "optimize" : []
  },
 
    "build-script" :
    {
      "extend" : ["common"],

      "variants" :
      {
        "qx.debug" : ["off"]
      }

    },


    "build-files" :
    {
      "extend" : ["common"],

      "copy-files" :
      {
        "files" :
        [
          "index.html"
        ],

        "target" : "${BUILD_PATH}"
      }
    },


    "build-resources":
    {
      "extend" : ["common"],

      "copy-resources" :
      {
        "target"          : "${BUILD_PATH}",
        "resource-filter" : true
      }
    },


    "build" :
    {
      "run" :
      [
        "compile-dist",
        "build-resources",
        "build-script",
        "build-files"
      ]
    }
}



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Turning off optimization

thron7
Jim,

a few remarks:

1. Are you working against trunk? Then you could just set
   OPTIMIZE = []
in your global "let" map.

2. Why are you debugging the build version? Is the issue reproduceable in
the source version too?

3. From the generated code it seems you got rid of some of the
optimization at least (e.g. variables). Why not the string optimization?

4. Could you post the whole class code, so we could test the issue?

5. If bg is not showing the correct value this is of course an issue. Can
you see the initialization of bg in the generated code?

6. Your config.json has some flaws: First, you need to wrap all your jobs
into a "jobs" map that will be on the same level as e.g. the top-level
"let" and "include". Then, beneath the "jobs" level you have specific job
names. The job names can be arbitrary identifiers as long as they are
unique.

7. You can name a job "compile-dist" if you like, but it has to *contain*
a key "compile-dist", if you want that job to create a build version of
your app. This key then takes a map with all the settings you have listed.
So it appears your job is missing one level of nesting.

There are a few more things, but I leave it for now, for you to give some
initial feedback.

Cheers,
Thomas


> OK, I have tried just about everything I can to turn off all optimization
> and nothing is working. The string optimization if failing so I can't even
> test my program, let alone try and fix anything when I find an error. I
> have
> some code that looks like this:
>
>             if (typeof AboutBox == "undefined")
>             {
>                 AboutBox = new swep.sfAboutBox;
>                 mainWinContainer.add(AboutBox);
>             }
>             AboutBox.show();
>
>
> it is getting generated as this:
>
> if(typeof AboutBox==bg){AboutBox=new swep.sfAboutBox;
> mainWinContainer.add(AboutBox);
> }AboutBox.show();
> });
>
> The problem is that when you run the application, at the point in time
> where
> this code gets hit, the variable bg now contains #E6E6E6 and not
> 'undefined'
> so the compare fails and the AboutBox is never created. Then when you try
> and do AboutBox.show() you get an exception.
>
> So I need to be able to turn off optimization so I can get back to testing
> my application.
>
> Thanks,
> Jim
>
> here is my config.json (the current version, I have tried may variations):
>
> {
>   "name"    : "swep",
>
>   "include" :
>   [
>     {
>       "path" : "../../tool/data/config/application.json"
>     }
>   ],
>
>   "let" :
>   {
>     "APPLICATION"  : "swep",
>     "QOOXDOO_PATH" : "../../framework",
>     "QOOXDOO_URI"  : "../${QOOXDOO_PATH}",
>     "QXTHEME"      : "qx.theme.Modern",
>     "API_EXCLUDE"  : ["qx.legacy.*"],
>     "LOCALES"      : [ "en" ],
>     "ROOT"         : "."
>   },
>   "compile-dist" :
>   {
>     "target" : "${BUILD_PATH}",
>     "file" : "${BUILD_PATH}/script/${APPLICATION}.js",
>     "uri"  : "script/${APPLICATION}.js",
>     "root" : "${BUILD_PATH}",
>     "format" : "on",
>     "locales" : "${LOCALES}",
>     "optimize" : []
>   },
>
>     "build-script" :
>     {
>       "extend" : ["common"],
>
>       "variants" :
>       {
>         "qx.debug" : ["off"]
>       }
>
>     },
>
>
>     "build-files" :
>     {
>       "extend" : ["common"],
>
>       "copy-files" :
>       {
>         "files" :
>         [
>           "index.html"
>         ],
>
>         "target" : "${BUILD_PATH}"
>       }
>     },
>
>
>     "build-resources":
>     {
>       "extend" : ["common"],
>
>       "copy-resources" :
>       {
>         "target"          : "${BUILD_PATH}",
>         "resource-filter" : true
>       }
>     },
>
>
>     "build" :
>     {
>       "run" :
>       [
>         "compile-dist",
>         "build-resources",
>         "build-script",
>         "build-files"
>       ]
>     }
> }
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the
> world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/_______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Turning off optimization

Jim Hunter
Thanks for the reply, my answers are below each question:

On Thu, Nov 6, 2008 at 3:24 PM, <[hidden email]> wrote:
Jim,

a few remarks:

1. Are you working against trunk? Then you could just set
  OPTIMIZE = []
in your global "let" map.

  I am using the SDK.


2. Why are you debugging the build version? Is the issue reproduceable in
the source version too?

  The source version worked fine, I am now testing against what I will deliver to the client and it is failing.


3. From the generated code it seems you got rid of some of the
optimization at least (e.g. variables). Why not the string optimization?

  As far as I know, I got rid of all optimiation. Why do you think strings is still on? The optimization list is empty.


4. Could you post the whole class code, so we could test the issue?

  One class code is not going to matter, it is optimizing all strings and I don't want any optimized.  And this class is large, it's an entire status panel at the bottom of my app.


5. If bg is not showing the correct value this is of course an issue. Can
you see the initialization of bg in the generated code?

  I think this is the problem. bg is defined in MANY places. Initially it's defined in a global space, but since it is re-defined in other places it's initial value is getting over-ridden with new values that are not correct for the scope where it is failing. 


6. Your config.json has some flaws: First, you need to wrap all your jobs
into a "jobs" map that will be on the same level as e.g. the top-level
"let" and "include". Then, beneath the "jobs" level you have specific job
names. The job names can be arbitrary identifiers as long as they are
unique.

7. You can name a job "compile-dist" if you like, but it has to *contain*
a key "compile-dist", if you want that job to create a build version of
your app. This key then takes a map with all the settings you have listed.
So it appears your job is missing one level of nesting.

  Initially, compile-dist was inside build-script, but that didn't work so I was moving it around to see if I got any changes, I didn't. But if you are saying that I have a missing 'jobs' section, that might be why none of my changes are taking. I will re-structure it and try again. FYI, the wiki page tells all about what small changes can be made to do certain things, but really gives no information of the overall structure of the config.json file. It doesn't really tell how the file is to be laid out. The sample that comes with the SDK has almost nothing in it, so knowing where to add information from the wiki is simply hit or miss.

Thanks,
Jim


There are a few more things, but I leave it for now, for you to give some
initial feedback.

Cheers,
Thomas


> OK, I have tried just about everything I can to turn off all optimization
> and nothing is working. The string optimization if failing so I can't even
> test my program, let alone try and fix anything when I find an error. I
> have
> some code that looks like this:
>
>             if (typeof AboutBox == "undefined")
>             {
>                 AboutBox = new swep.sfAboutBox;
>                 mainWinContainer.add(AboutBox);
>             }
>             AboutBox.show();
>
>
> it is getting generated as this:
>
> if(typeof AboutBox==bg){AboutBox=new swep.sfAboutBox;
> mainWinContainer.add(AboutBox);
> }AboutBox.show();
> });
>
> The problem is that when you run the application, at the point in time
> where
> this code gets hit, the variable bg now contains #E6E6E6 and not
> 'undefined'
> so the compare fails and the AboutBox is never created. Then when you try
> and do AboutBox.show() you get an exception.
>
> So I need to be able to turn off optimization so I can get back to testing
> my application.
>
> Thanks,
> Jim
>
> here is my config.json (the current version, I have tried may variations):
>
> {
>   "name"    : "swep",
>
>   "include" :
>   [
>     {
>       "path" : "../../tool/data/config/application.json"
>     }
>   ],
>
>   "let" :
>   {
>     "APPLICATION"  : "swep",
>     "QOOXDOO_PATH" : "../../framework",
>     "QOOXDOO_URI"  : "../${QOOXDOO_PATH}",
>     "QXTHEME"      : "qx.theme.Modern",
>     "API_EXCLUDE"  : ["qx.legacy.*"],
>     "LOCALES"      : [ "en" ],
>     "ROOT"         : "."
>   },
>   "compile-dist" :
>   {
>     "target" : "${BUILD_PATH}",
>     "file" : "${BUILD_PATH}/script/${APPLICATION}.js",
>     "uri"  : "script/${APPLICATION}.js",
>     "root" : "${BUILD_PATH}",
>     "format" : "on",
>     "locales" : "${LOCALES}",
>     "optimize" : []
>   },
>
>     "build-script" :
>     {
>       "extend" : ["common"],
>
>       "variants" :
>       {
>         "qx.debug" : ["off"]
>       }
>
>     },
>
>
>     "build-files" :
>     {
>       "extend" : ["common"],
>
>       "copy-files" :
>       {
>         "files" :
>         [
>           "index.html"
>         ],
>
>         "target" : "${BUILD_PATH}"
>       }
>     },
>
>
>     "build-resources":
>     {
>       "extend" : ["common"],
>
>       "copy-resources" :
>       {
>         "target"          : "${BUILD_PATH}",
>         "resource-filter" : true
>       }
>     },
>
>
>     "build" :
>     {
>       "run" :
>       [
>         "compile-dist",
>         "build-resources",
>         "build-script",
>         "build-files"
>       ]
>     }
> }
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the
> world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/_______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Turning off optimization

Jim Hunter
OK, I made the changes you suggested and this is the result from my build:

============================================================================
    INITIALIZING: SWEP
============================================================================
>>> Configuration: config.json
>>> Jobs: build
Traceback (most recent call last):
  File "C:\qooxdoo-sdk\tool\bin\generator.py", line 133, in <module>
    main()
  File "C:\qooxdoo-sdk\tool\bin\generator.py", line 98, in main
    config.resolveIncludes()
  File "C:\qooxdoo-sdk\tool\pylib\generator\config\Config.py", line 242, in reso
lveIncludes
    self._integrateExternalConfig(econfig, namespace, importList, blockList)
  File "C:\qooxdoo-sdk\tool\pylib\generator\config\Config.py", line 261, in _int
egrateExternalConfig
    raise KeyError, "Job already exists: \"%s\"" % newjobname
KeyError: u'Job already exists: "build"'


Here is the new config.json file I am using:

{
  "name"    : "swep",

  "include" :
  [
    {
      "path" : "../../tool/data/config/application.json"
    }
  ],

  "let" :
  {
    "APPLICATION"  : "swep",
    "QOOXDOO_PATH" : "../../framework",
    "QOOXDOO_URI"  : "../${QOOXDOO_PATH}",
    "QXTHEME"      : "qx.theme.Modern",
    "API_EXCLUDE"  : ["qx.legacy.*"],
    "LOCALES"      : [ "en" ],
    "ROOT"         : "."
  },
 
  "jobs":
  {
    "build-script" :
    {
      "extend" : ["common"],

      "variants" :
      {
        "qx.debug" : ["off"]
      },
      "compile-dist" :
      {
        "target" : "${BUILD_PATH}",
        "file" : "${BUILD_PATH}/script/${APPLICATION}.js",
        "uri"  : "script/${APPLICATION}.js",
        "root" : "${BUILD_PATH}",
        "format" : "on",
        "locales" : "${LOCALES}",
        "optimize" : []
      }
    },


    "build-files" :
    {
      "extend" : ["common"],

      "copy-files" :
      {
        "files" :
        [
          "index.html"
        ],

        "target" : "${BUILD_PATH}"
      }
    },


    "build-resources":
    {
      "extend" : ["common"],

      "copy-resources" :
      {
        "target"          : "${BUILD_PATH}",
        "resource-filter" : true
      }
    },


    "build" :
    {
      "run" :
      [
        "compile-dist",
        "build-resources",
        "build-script",
        "build-files"
      ]
    }
  }
}


Thanks,
Jim


On Thu, Nov 6, 2008 at 3:40 PM, Jim Hunter <[hidden email]> wrote:
Thanks for the reply, my answers are below each question:

On Thu, Nov 6, 2008 at 3:24 PM, <[hidden email]> wrote:
Jim,

a few remarks:

1. Are you working against trunk? Then you could just set
  OPTIMIZE = []
in your global "let" map.

  I am using the SDK.


2. Why are you debugging the build version? Is the issue reproduceable in
the source version too?

  The source version worked fine, I am now testing against what I will deliver to the client and it is failing.


3. From the generated code it seems you got rid of some of the
optimization at least (e.g. variables). Why not the string optimization?

  As far as I know, I got rid of all optimiation. Why do you think strings is still on? The optimization list is empty.


4. Could you post the whole class code, so we could test the issue?

  One class code is not going to matter, it is optimizing all strings and I don't want any optimized.  And this class is large, it's an entire status panel at the bottom of my app.


5. If bg is not showing the correct value this is of course an issue. Can
you see the initialization of bg in the generated code?

  I think this is the problem. bg is defined in MANY places. Initially it's defined in a global space, but since it is re-defined in other places it's initial value is getting over-ridden with new values that are not correct for the scope where it is failing. 


6. Your config.json has some flaws: First, you need to wrap all your jobs
into a "jobs" map that will be on the same level as e.g. the top-level
"let" and "include". Then, beneath the "jobs" level you have specific job
names. The job names can be arbitrary identifiers as long as they are
unique.

7. You can name a job "compile-dist" if you like, but it has to *contain*
a key "compile-dist", if you want that job to create a build version of
your app. This key then takes a map with all the settings you have listed.
So it appears your job is missing one level of nesting.

  Initially, compile-dist was inside build-script, but that didn't work so I was moving it around to see if I got any changes, I didn't. But if you are saying that I have a missing 'jobs' section, that might be why none of my changes are taking. I will re-structure it and try again. FYI, the wiki page tells all about what small changes can be made to do certain things, but really gives no information of the overall structure of the config.json file. It doesn't really tell how the file is to be laid out. The sample that comes with the SDK has almost nothing in it, so knowing where to add information from the wiki is simply hit or miss.

Thanks,
Jim


There are a few more things, but I leave it for now, for you to give some
initial feedback.

Cheers,
Thomas




-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Turning off optimization

thron7
In reply to this post by Jim Hunter

>   I am using the SDK.
>  

Ok, then we have to do it the old way.

>   As far as I know, I got rid of all optimiation. Why do you think strings
> is still on? The optimization list is empty.
>  

But "undefined" gets replace by bg. If string optimization was off, this
shouldn't happen. Do you see any other way this replacement could occur?

>   I think this is the problem. bg is defined in MANY places. Initially it's
> defined in a global space, but since it is re-defined in other places it's
> initial value is getting over-ridden with new values that are not correct
> for the scope where it is failing.
>  

Maybe it's a case of variable capture. Is bg also one of your
self-defined variables? If I'm not mistaken generated variables are
confined in the enclosing scope, and therefore shouldn't interfer with
same names elsewhere.

>   Initially, compile-dist was inside build-script, but that didn't work so I
> was moving it around to see if I got any changes, I didn't. But if you are
> saying that I have a missing 'jobs' section, that might be why none of my
> changes are taking. I will re-structure it and try again. FYI, the wiki page
>  

I will send a complete version that should work.

> tells all about what small changes can be made to do certain things, but
> really gives no information of the overall structure of the config.json
> file. It doesn't really tell how the file is to be laid out. The sample that
> comes with the SDK has almost nothing in it, so knowing where to add
> information from the wiki is simply hit or miss.
>  

Mh. There is an entire section in the wiki dedicated to the overall
structure. It's entitled "Listing of Keys in Context"
(http://qooxdoo.org/documentation/0.8/generator_config#listing_of_keys_in_context).
It shows the overall structure of a config file as nested lists,
indicating the scope and potential nesting of keys. Maybe it's not all
too obvious, but I couldn't think of a better way to represent it...
Suggestions are welcome.


Thomas

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Turning off optimization

thron7
In reply to this post by Jim Hunter
Jim,

Please do the following:

Edit the files {qx}/tool/data/config/[base,application].json and comment
out the "export" key in both (e.g. by enclosing it in /* ... */). This
ensures all jobs will be exported by the configs.

Then try the following config for you app (this is working fine with a
skeleton):

{
  "name"    : "swep",

  "include" :
  [
    {

      "path" : "../../tool/data/config/application.json",
      "as"   : "appconf"
    }

  ],

  "let" :
  {
    "APPLICATION"  : "swep",
    "QOOXDOO_PATH" : "../qooxdoo-0.8-sdk/framework",
    "QOOXDOO_URI"  : "../${QOOXDOO_PATH}",
    "QXTHEME"      : "qx.theme.Modern",
    "API_EXCLUDE"  : ["qx.legacy.*"],
    "LOCALES"      : [ "en" ],
    "ROOT"         : "."
  },

  "jobs":
  {
    "build-script" :
    {
      "extend" : ["appconf::build-script"],

      "variants" :
      {
        "qx.debug" : ["off"]
      },
      "compile-dist" :
      {
        "target" : "${BUILD_PATH}",
        "file" : "${BUILD_PATH}/script/${APPLICATION}.js",
        "uri"  : "script/${APPLICATION}.js",
        "root" : "${BUILD_PATH}",
        "format" : "on",
        "locales" : "${LOCALES}",
        "optimize" : []
      }
    },


    "build-files" :
    {
      "extend" : ["appconf::build-files"],

      "copy-files" :
      {
        "files" :
        [
          "index.html"
        ],

        "target" : "${BUILD_PATH}"
      }
    },


    "build-resources":
    {
      "extend" : ["appconf::build-resources"],

      "copy-resources" :
      {
        "target"          : "${BUILD_PATH}",
        "resource-filter" : true
      }
    },


    "build" :
    {
      "run" :
      [
        "build-resources",
        "build-script",
        "build-files"
      ]
    }
  }
}



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Turning off optimization

thron7
In reply to this post by Jim Hunter
[I'm re-posting this, since my initial post is pending since hours.
Sorry for duplicates.]

>   I am using the SDK.
>  

Ok, then we have to do it the old way.

>   As far as I know, I got rid of all optimiation. Why do you think strings
> is still on? The optimization list is empty.
>  

But "undefined" gets replace by bg. If string optimization was off, this
shouldn't happen. Do you see any other way this replacement could occur?

>   I think this is the problem. bg is defined in MANY places. Initially it's
> defined in a global space, but since it is re-defined in other places it's
> initial value is getting over-ridden with new values that are not correct
> for the scope where it is failing.
>  

Maybe it's a case of variable capture. Is bg also one of your
self-defined variables? If I'm not mistaken generated variables are
confined in the enclosing scope, and therefore shouldn't interfer with
same names elsewhere.

>   Initially, compile-dist was inside build-script, but that didn't work so I
> was moving it around to see if I got any changes, I didn't. But if you are
> saying that I have a missing 'jobs' section, that might be why none of my
> changes are taking. I will re-structure it and try again. FYI, the wiki page
>  

I will send a complete version that should work.

> tells all about what small changes can be made to do certain things, but
> really gives no information of the overall structure of the config.json
> file. It doesn't really tell how the file is to be laid out. The sample that
> comes with the SDK has almost nothing in it, so knowing where to add
> information from the wiki is simply hit or miss.
>  

Mh. There is an entire section in the wiki dedicated to the overall
structure. It's entitled "Listing of Keys in Context"
(http://qooxdoo.org/documentation/0.8/generator_config#listing_of_keys_in_context).

It shows the overall structure of a config file as nested lists,
indicating the scope and potential nesting of keys. Maybe it's not all
too obvious, but I couldn't think of a better way to represent it...
Suggestions are welcome.


Thomas


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Turning off optimization

Jim Hunter
In reply to this post by thron7
I did what you asked but this is the result:

============================================================================
    INITIALIZING: SWEP
============================================================================
>>> Configuration: config.json
>>> Jobs: build
>>> Resolving jobs...
Traceback (most recent call last):
  File "C:\qooxdoo-sdk\tool\bin\generator.py", line 133, in <module>
    main()
  File "C:\qooxdoo-sdk\tool\bin\generator.py", line 114, in main
    expandedjobs = config.resolveExtendsAndRuns(options.jobs[:])
  File "C:\qooxdoo-sdk\tool\pylib\generator\config\Config.py", line 291, in reso
lveExtendsAndRuns
    self._resolveExtends(jobList)
  File "C:\qooxdoo-sdk\tool\pylib\generator\config\Config.py", line 309, in _res
olveExtends
    job.resolveExtend()
  File "C:\qooxdoo-sdk\tool\pylib\generator\config\Job.py", line 96, in resolveE
xtend
    entryJob.resolveExtend(entryTrace + [self.name])
  File "C:\qooxdoo-sdk\tool\pylib\generator\config\Job.py", line 93, in resolveE
xtend
    raise RuntimeError, "No such job: \"%s\" (trace: %s)" % (entry, entryTrace+[
self.name])
RuntimeError: No such job: "appconf::build-resources" (trace: [u'build::build-re
sources', u'build-resources'])

build-resources is defined in base.json, not in application.json.
Here are what I have for base.json and application.json:

base:
// base.json
{
  "name"    : "base.json",

  "let" :
  {
    "ROOT"         : ".",
    "QOOXDOO_PATH" : "../../framework",
    "QOOXDOO_URI"  : "../${QOOXDOO_PATH}",
    "CACHE"        : "cache",
    "QXTHEME"      : "qx.theme.Classic",
    "QXVERSION"    : "0.8",
    "LOCALES"      : [ "en" ],
    "BUILD_PATH"   : "${ROOT}/build"
  },
/*
  "export" :
  [
    "build",
    "clean",
    "distclean",
    "fix",
    "lint",
    "migration",
    "pretty",
    "profiling",
    "publish",
    "source",
    "translation"
  ],
*/

  "jobs" :
  {
    // the next one is needed wherever the local lib is to be scanned
    "scan-local-lib" :
    {
      "library" :
      [
        {
          "manifest" : "${ROOT}/Manifest.json",
          "uri"      : ".."
        }
      ],

      "cache" :
      {
        "compile" :  "${CACHE}"
      }
    },


    "common" :
    {
      "library" :
      [
        {
          "manifest" : "${QOOXDOO_PATH}/Manifest.json",
          "uri"      : "${QOOXDOO_URI}"
        },

        {
          "manifest" : "${ROOT}/Manifest.json",
          "uri"      : ".."
        }
      ],

      "include" :
      [
        "${APPLICATION}.Application",
        "${QXTHEME}"
      ],

      "cache" :
      {
        "compile" :  "${CACHE}"
      },

      "settings" :
      {
        "qx.version"     : "${QXVERSION}",
        "qx.theme"       : "${QXTHEME}",
        "qx.application" : "${APPLICATION}.Application"
      }
    },


    // -- source jobs --------------------------------------------------

    "source-script" :
    {
      "extend" : ["common"],

      "compile-source" :
      {
        "file" : "${ROOT}/source/script/${APPLICATION}.js",
        "locales" : "${LOCALES}",
        "root" : "source"
      }
    },


    "source" :
    {
      "run" :
      [
        "source-script"
      ]
    },

    // -- build jobs ---------------------------------------------------

    "build-script" :
    {
      "extend" : ["common"],

      "variants" :
      {
        "qx.debug" : ["off"]
      },

      "compile-dist" :
      {
        "target" : "${BUILD_PATH}",
        "file" : "${BUILD_PATH}/script/${APPLICATION}.js",
        "uri"  : "script/${APPLICATION}.js",
        "root" : "${BUILD_PATH}",
        "format" : "on",
        "locales" : "${LOCALES}",
        "optimize" : ["basecalls", "variables", "privates", "strings"]
      }
    },


    "build-files" :
    {
      "extend" : ["common"],

      "copy-files" :
      {
        "files" :
        [
          "index.html"
        ],

        "target" : "${BUILD_PATH}"
      }
    },


    "build-resources":
    {
      "extend" : ["common"],

      "copy-resources" :
      {
        "target"          : "${BUILD_PATH}",
        "resource-filter" : true
      }
    },


    "build" :
    {
      "run" :
      [
        "build-resources",
        "build-script",
        "build-files"
      ]
    },

    // -- various jobs -------------------------------------------------

    "translation" :
    {
      "extend" : ["common"],

      "translate" :
      {
        "locales": "${LOCALES}",
        "namespaces" : ["${APPLICATION}"]
      }
    },


    // can be used as an 'extend' to activate profiling
    "profiling" :
    {
      "variants" :
      {
        "qx.aspects" : ["on"]
      },

      "require" :
      {
        "qx.Class" : [ "qx.core.Aspect", "qx.dev.Profile" ]
      }
    },


    "pretty" :
    {
      "extend" : [ "scan-local-lib" ],

      "include" : [ "=${APPLICATION}.*" ],

      "pretty-print" : {}
    },


    "clean" :
    {
      // scan-local-lib is here (like various similar others) only in for the cache setting;
      // can be removed once the forced library scan for each job is disabled
      "extend" : [ "scan-local-lib" ],

      "clean-files" :
      {
        "Cleaning up build" :
        [
          "${BUILD_PATH}/script/${APPLICATION}.js",
          "${BUILD_PATH}/script/${APPLICATION}[_-]*.js"
        ],
        "Cleaning up source" :
        [
          "${ROOT}/cache",
          "${ROOT}/source/script/${APPLICATION}.js"
        ],
        "Cleaning up framework" :
        [

        ]
      }
    },


    "distclean" :
    {
      "extend" : [ "scan-local-lib" ],

      "clean-files" :
      {
        "Deleting build" :
        [
          "${BUILD_PATH}"
        ],
        "Deleting api" :
        [
          "${ROOT}/api"
        ],
        "Deleting debug" :
        [
        ],
        "Deleting AIR application" :
        [
        ],
        "Deleting buildtool" :
        [
          "${ROOT}/tool/buildtool"
        ],
        "Deleting test" :
        [
          "${ROOT}/test"
        ],
        "Cleaning up source" :
        [
          "${ROOT}/source/script"
        ],
        "Cleaning up framework" :
        [
          "${CACHE}"
        ]
      }
    },


    "lint" :
    {
      "extend" : [ "scan-local-lib" ],

      "lint-check" :
      {
        "allowed-globals" : [ "qx", "qxsettings", "qxvariants", "${APPLICATION}" ]
      }
    },


    "migration" :
    {
      "extend" : [ "scan-local-lib" ],

      "migrate-files" :
      {
        //"from-version" : "0.7",
        "migrate-html" : false
      }
    },


    "publish" :
    {
      "extend" : [ "scan-local-lib" ],

      "shell" :
      {
        "command" : "rsync --checksum --compress --recursive --delete --inplace --links --safe-links --exclude .svn ${BUILD_PATH}/* [hidden email]:/var/www/qooxdoo/demo/${QXVERSION}/${APPLICATION}"
      }
    },


    "fix" :
    {
      "extend" : [ "scan-local-lib" ],

      "fix-files" : {}
    }
  }
}


On Fri, Nov 7, 2008 at 2:09 AM, thron7 <[hidden email]> wrote:
Jim,

Please do the following:

Edit the files {qx}/tool/data/config/[base,application].json and comment
out the "export" key in both (e.g. by enclosing it in /* ... */). This
ensures all jobs will be exported by the configs.

Then try the following config for you app (this is working fine with a
skeleton):

{
 "name"    : "swep",

 "include" :
 [
   {

     "path" : "../../tool/data/config/application.json",
     "as"   : "appconf"
   }

 ],

 "let" :
 {
   "APPLICATION"  : "swep",
   "QOOXDOO_PATH" : "../qooxdoo-0.8-sdk/framework",
   "QOOXDOO_URI"  : "../${QOOXDOO_PATH}",
   "QXTHEME"      : "qx.theme.Modern",
   "API_EXCLUDE"  : ["qx.legacy.*"],
   "LOCALES"      : [ "en" ],
   "ROOT"         : "."
 },

 "jobs":
 {
   "build-script" :
   {
     "extend" : ["appconf::build-script"],

     "variants" :
     {
       "qx.debug" : ["off"]
     },
     "compile-dist" :
     {
       "target" : "${BUILD_PATH}",
       "file" : "${BUILD_PATH}/script/${APPLICATION}.js",
       "uri"  : "script/${APPLICATION}.js",
       "root" : "${BUILD_PATH}",
       "format" : "on",
       "locales" : "${LOCALES}",
       "optimize" : []
     }
   },


   "build-files" :
   {
     "extend" : ["appconf::build-files"],

     "copy-files" :
     {
       "files" :
       [
         "index.html"
       ],

       "target" : "${BUILD_PATH}"
     }
   },


   "build-resources":
   {
     "extend" : ["appconf::build-resources"],

     "copy-resources" :
     {
       "target"          : "${BUILD_PATH}",
       "resource-filter" : true
     }
   },


   "build" :
   {
     "run" :
     [
       "build-resources",
       "build-script",
       "build-files"
     ]
   }
 }
}


application.josn:
{
  "name"    : "Generic application.json",

  "include" :
  [
    {
      "path" : "./base.json"
    },

    {
      "path" : "../../../component/apiviewer/api.json",
      "as"   : "apiconf"
    },
   
    {
      "path" : "../../../component/testrunner/testrunner.json",
      "as"   : "testrunner"
    }
  ],
/*
  "export" :
  [
    "api",
    "build",
    "clean",
    "distclean",
    "fix",
    "lint",
    "migration",
    "pretty",
    "profiling",
    "publish",
    "source",
    "test",
    "test-source",
    "translation"
  ],
*/


  "let" :
  {
    "ROOT"         : ".",
    "QOOXDOO_PATH" : "../../framework",
    "QOOXDOO_URI"  : "../${QOOXDOO_PATH}",
    "CACHE"        : "cache",
    "QXTHEME"      : "qx.theme.Classic",
    "QXVERSION"    : "0.8",
    "LOCALES"      : [ "en" ],
    "BUILD_PATH"   : "${ROOT}/build"
  },

  "jobs" :
  {
    "api" :
    {
      "extend" : ["apiconf::build"],

      "let" :
      {
        "APIVIEWER_ROOT" : "${QOOXDOO_PATH}/../component/apiviewer",
        "BUILD_PATH" : "./api",
        "API_INCLUDE" : ["qx.*", "${APPLICATION}.*"]
      },

      "library" :
      [
        {
          "manifest" : "Manifest.json",
          "uri"      : ".."
        }
      ]
    },


    "test" :
    {
      "extend" : ["testrunner::build"],

      "let" :
      {
        "TESTRUNNER_ROOT" : "${QOOXDOO_PATH}/../component/testrunner",
        "TEST_INCLUDE"    : "${APPLICATION}.test.*",
        "BUILD_PATH"      : "./test"
      },

      "library" :
      [
        {
          "manifest" : "Manifest.json",
          "uri"      : ".."
        }
      ]
    },

    "test-source" :
    {
      "extend" : ["testrunner::build-with-tests-source"],

      "let" :
      {
        "TESTRUNNER_ROOT" : "${QOOXDOO_PATH}/../component/testrunner",
        "TEST_INCLUDE"    : "${APPLICATION}.test.*",
        "BUILD_PATH"      : "./test"
      },

      "library" :
      [
        {
          "manifest" : "Manifest.json",
          "uri"      : ".."
        }
      ]
    }
  }
}


and lastly, config.json:
{
 "name"    : "swep",

 "include" :
 [
   {

     "path" : "../../tool/data/config/application.json",
     "as"   : "appconf"
   }

 ],

 "let" :
 {
   "APPLICATION"  : "swep",
   "QOOXDOO_PATH" : "../qooxdoo-0.8-sdk/framework",
   "QOOXDOO_URI"  : "../${QOOXDOO_PATH}",
   "QXTHEME"      : "qx.theme.Modern",
   "API_EXCLUDE"  : ["qx.legacy.*"],
   "LOCALES"      : [ "en" ],
   "ROOT"         : "."
 },

 "jobs":
 {
   "build-script" :
   {
     "extend" : ["appconf::build-script"],

     "variants" :
     {
       "qx.debug" : ["off"]
     },
     "compile-dist" :
     {
       "target" : "${BUILD_PATH}",
       "file" : "${BUILD_PATH}/script/${APPLICATION}.js",
       "uri"  : "script/${APPLICATION}.js",
       "root" : "${BUILD_PATH}",
       "format" : "on",
       "locales" : "${LOCALES}",
       "optimize" : []
     }
   },


   "build-files" :
   {
     "extend" : ["appconf::build-files"],

     "copy-files" :
     {
       "files" :
       [
         "index.html"
       ],

       "target" : "${BUILD_PATH}"
     }
   },


   "build-resources":
   {
     "extend" : ["appconf::build-resources"],

     "copy-resources" :
     {
       "target"          : "${BUILD_PATH}",
       "resource-filter" : true
     }
   },


   "build" :
   {
     "run" :
     [
       "build-resources",
       "build-script",
       "build-files"
     ]
   }
 }
}


Thanks for your assistance so far,
Jim

 


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Turning off optimization

thron7
Jim,

can you send me the output of "generate.py x" in the swep directory.

T.



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Turning off optimization

thron7
In reply to this post by Jim Hunter
Jim,

could you create a new project somewhere, with

  tool/bin/create-application.py -n swep

and copy the config.json you attached to the new folder. In it, adapt the
path to the application.json of the SDK. Then run "generate.py build".

I did the same just now with a vanilla qooxdoo-0.8-sdk, and it worked
perfectly.

Thomas



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Turning off optimization

Jim Hunter
In reply to this post by thron7
Here it is:

>>> Configuration: config.json
>>> Jobs: x
>>> No such job: x
>>> Available jobs:
  - appconf::api
  - appconf::build
  - appconf::clean
  - appconf::distclean
  - appconf::fix
  - appconf::lint
  - appconf::migration
  - appconf::pretty
  - appconf::profiling
  - appconf::publish
  - appconf::source
  - appconf::test
  - appconf::test-source
  - appconf::translation
  - build
  - build-files
  - build-resources
  - build-script



On Fri, Nov 7, 2008 at 1:59 PM, <[hidden email]> wrote:
Jim,

can you send me the output of "generate.py x" in the swep directory.

T.



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Turning off optimization

thron7
In reply to this post by Jim Hunter
> build-resources is defined in base.json, not in application.json.

This is fine, since application.json is including base.json. The jobs from
base.json are passed through verbatim (transitive closure, so to speak):

> application.josn:
> {
>   "name"    : "Generic application.json",
>
>   "include" :
>   [
>     {
>       "path" : "./base.json"
>     },

T.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Turning off optimization

thron7
In reply to this post by Jim Hunter
This is exactly the list you get with the "export" keys *intact* in
base.json / application.json. Are you sure you are including the files you
edited? Maybe you have multiple SDK's installed side by side?! Could you
send me the output of "cat ../../tool/data/config/application.json" and
"cat ../../tool/data/config/base.json" issued from the swep directory?!

T.

> Here it is:
>
>>>> Configuration: config.json
>>>> Jobs: x
>>>> No such job: x
>>>> Available jobs:
>   - appconf::api
>   - appconf::build
>   - appconf::clean
>   - appconf::distclean
>   - appconf::fix
>   - appconf::lint
>   - appconf::migration
>   - appconf::pretty
>   - appconf::profiling
>   - appconf::publish
>   - appconf::source
>   - appconf::test
>   - appconf::test-source
>   - appconf::translation
>   - build
>   - build-files
>   - build-resources
>   - build-script
>
>
>
> On Fri, Nov 7, 2008 at 1:59 PM, <[hidden email]> wrote:
>
>> Jim,
>>
>> can you send me the output of "generate.py x" in the swep directory.
>>
>> T.
>>
>>
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>> challenge
>> Build the coolest Linux based applications with Moblin SDK & win great
>> prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the
>> world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the
> world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/_______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
12