Code Monkey home page Code Monkey logo

Comments (2)

ericbmerritt avatar ericbmerritt commented on July 1, 2024

I have found the reason for this. It's complicated.

The bottom line is that Sinan is using the flavors.development.build.compile_args
that are defined in Sinan's priv/default_build file, and ignoring the one in the
user's _build.cfg.

sinan:do_task/4 calls sin_build_config:start_config/4. In the init([BuildId,
ProjectDir, Config, Override]), the key "tasks.build.compile_args" is merged from
"flavors.development.build.compile_args", but never overridden by the user's
task.build.compile_args.

Here's an extract from the config dict (converted to_list).

[{"task.build.compile_args","-DFOOBAR +debug_info"},
{"flavors.release.build.compile_args","-DNOTEST=1 -W1"},
{"flavors.development.build.compile_args","+debug_info -W1"},
{"default_flavor","development"}
]

The compile_args I want is the one in task.build.compile_args. But the
flavors.development.build.compile_args is the one that is used. It looks as if the
merging of the dictionaries is not quite right.

A workaround is to edit the priv/default_build file and out in the args you like
(which will apply to all projects, so it's not necessarily a good workaround).

I don't have a patch to correct this at this time. I'm hoping you will know exactly
how to fix this in 10 seconds :)

Also, there is a bug in sin_build_arg_parser.erl. In an attempt to remove spaces,
certain "whitespace" characters are defined, such as $\r, $\n, $\s, $\t and so on.
Unfortunately, in a number of places, one of the characters used to define "space" is
$\l. This is the lowercase "L" character. I think what was meant was $\f for formfeed
or maybe $\v for vertical tab.

The effect of this is that any compile_args identifiers that are parsed will lose all
lowercase "l" characters, so that "feel_the_love" will become "fee_the_ove". This is
easy to reproduce and verify.

Delete comment Comment 2 by emofine, Oct 18, 2008
I sent a patch that fixes this problem, as well as the bug in
sin_build_arg_parser.erl. The patch is based on the head branch, so it might not work
that well with your dev branch.

It must be noted that the _build.cfg file needs to include a section named "tasks"
(NOT "task"). Now I don't know if this was always the intention (to use "tasks"
instead of "task") so please take a look and see if I did this the right way.

Example _build.cfg tasks section:

tasks : {
build : {
compile_args : "+debug_info -Dwhatever"
}
}

I also put back the display of the compile flags, which seemed to have disappeared in
the meanwhile from the head.
Delete comment Comment 3 by emofine, Jan 06, 2009
This bug is still present as of version 0.12.0.6 of sinan. I am therefore unable to
use needed include directories outside of the actual Sinan application. This is a
showstopper that forces me to copy the include files into the application's include
directory to get it to compile.
Delete comment Comment 4 by emofine, Jan 06, 2009
Ok, I found that somehow, when sinan was upgraded from 0.11.0.1 to 0.12.0.6, the
bin/sinan and bin/sinserv scripts were not changed and still referred to the old
0.11.0.1 release. The problem is in fact solved in 0.12.0.6.
There is another issue to do with default_build config compile_args having arguments
in common with build.cfg, but it can be worked around (don't have common args) and
probably won't affect most people.

from sinan.

ericbmerritt avatar ericbmerritt commented on July 1, 2024

This is resolved in the current sinan

from sinan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.