This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Headless build: Build configuration ignored sometimes

Other Parts Discussed in Thread: CCSTUDIO

I'm trying to do a headless build of a very simple project: configs.zip

This is with CCS 6.1.3.00033 on Ubuntu 16.04. The project has a Debug and a release Config, with #warning directives to output which config is built.

Debug is the default config, and I'm selecting Release via -ccs.configuration. However, that only works around 50-80% of the time. In the remaining cases, the debug config is built instead.

Every build imports the project into an empty workspace:

$ /root/ccs/ccsv6/eclipse/eclipse -noSplash -application com.ti.ccstudio.apps.projectImport -data /tmp/tmp3pwywabo -ccs.location /builds/brf/prg1175-ccs-docker/ccsutils/tests/proj/buildconfigs

--------------------------------------------------------------------------------
Importing project from '/builds/brf/prg1175-ccs-docker/ccsutils/tests/proj/buildconfigs'...


Done!

Then it's built using -ccs.configuration Release. Here is an example where it didn't work:

$ /root/ccs/ccsv6/eclipse/eclipse -noSplash -application com.ti.ccstudio.apps.projectBuild -data /tmp/tmp3pwywabo -ccs.configuration Release -ccs.workspace

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CCS headless build starting... [Thu May 19 06:14:50 UTC 2016] 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

================================================================================
Pre processing...


================================================================================
Building...


**** Clean-only build of configuration Debug for project buildconfigs ****

/root/ccs/ccsv6/utils/bin/gmake -k clean 
rm -rf  "buildconfigs.out"  "buildconfigs.hex" 
rm -rf "main.d" 
rm -rf "main.obj" 
Finished clean
 

**** Build Finished ****

**** Build of configuration Debug for project buildconfigs ****

/root/ccs/ccsv6/utils/bin/gmake -k all 
Building file: ../main.c
Invoking: MSP430 Compiler
"/root/ccs/ccsv6/tools/compiler/ti-cgt-msp430_15.12.1.LTS/bin/cl430" -vmsp --abi=eabi --use_hw_mpy=none --include_path="/root/ccs/ccsv6/ccs_base/msp430/include" --include_path="/root/ccs/ccsv6/tools/compiler/ti-cgt-msp430_15.12.1.LTS/include" --advice:power=all -g --define=__MSP430F2272__ --define=CONFIG_DEBUG --diag_warning=225 --diag_wrap=off --display_error_number --printf_support=minimal --preproc_with_compile --preproc_dependency="main.d"  "../main.c"
"../main.c", line 3: warning #1181-D: #warning directive: "config: debug"
Finished building: ../main.c

Note how I passed -ccs.configuration Release, but CCS told me "Clean-only build of configuration Debug" and actually built the debug config (as evident by the #warning).

Am I missing something, or is this a CCS bug? If it is, is there a workaround available?

  • I just reproduced this on another machine and did 100 builds using this commandline:

    while :; do rm -rf /tmp/ws && ~/ti/ccs/ccsv6/eclipse/eclipse -noSplash -application com.ti.ccstudio.apps.projectImport -data /tmp/ws -ccs.location ~/proj/CI/ccs-docker/ccsutils/tests/proj/buildconfigs >/dev/null && ~/ti/ccs/ccsv6/eclipse/eclipse -noSplash -application com.ti.ccstudio.apps.projectBuild -data /tmp/ws -ccs.configuration Release -ccs.workspace | grep Debug; done

    75 builds were correct (Release), while 25 builds did build Debug instead of Release.

  • I found out it's actually an issue during import - this script always builds either Release (often) or always Debug (sometimes) after it's started:

    rm -rf /tmp/ws
    ~/ti/ccs/ccsv6/eclipse/eclipse -noSplash -data /tmp/ws \
        -application com.ti.ccstudio.apps.projectImport \
        -ccs.location ~/proj/CI/ccs-docker/ccsutils/tests/proj/buildconfigs >/dev/null
    
    while :; do
        rm -rf ~/proj/CI/ccs-docker/ccsutils/tests/proj/buildconfigs/{Debug,Release}
        ~/ti/ccs/ccsv6/eclipse/eclipse -noSplash -data /tmp/ws \
            -application com.ti.ccstudio.apps.projectBuild \
            -ccs.configuration Release -ccs.workspace 2>/dev/null | \
                grep 'Build of configuration'
    done

    So after that, I used the oneliner from above again to do more import/build cycles so I can play with import options and figure out if anything works as a workaround for this bug.

    No option worked, except -ccs.captureCopiedFileOrigins. That only writes an empty copiedFileOrigins.txt file (as nothing is copied into the workspace) from an outside view, but with it I've not seen the issue happen in 50 import/build cycles...

    EDIT: I just had it happen even with captureCopiedFileOrigins... But it's definitely much less likely to happen.

  • While trying to reproduce this and playing around with the options, I observed that the commands have changed in CCS 6.1.3. For example, com.ti.ccstudio.apps.projectBuild has become com.ti.ccstudio.apps.buildProject. Similarly for the project import command.

    I found this out by typing the following command on a command prompt (my tests were on Windows but it should be the same in Linux):

    C:\CCStudio_v6.1.3.00033\ccsv6\eclipse\eclipsec -noSplash -data c:\workspaces\ccsv613\new_workspace -application com.ti.ccstudio.apps.projectBuild -ccs.help

    and seeing the following output:

    Usage:
    eclipsec -noSplash -data "<workspace_dir>"
    -application com.ti.ccstudio.apps.buildProject
    (-ccs.projects <name1>[ <name2>]* | -ccs.workspace) [<options>]


    I did some tests with CCS 6.1.3 and found that I could reproduce the type of behavior you reported with the projectBuild and projectImport commands (inconsistency in which build configuration was getting built), but not with importProject and buildProject commands. Could you please change to these commands and let us know how it works?

  • Florian,

    I consulted with an engineer who clarified that the importProject and buildProject commands are simply aliases for the existing projectImport and projectBuild commands, so both should work the same way. It may have been by chance that the tests I did above resulted in the correct configuration being built.

    The behavior you are seeing appears to be a bug in Eclipse. We are tracking this in bug # CCSIDE-2883 and we will be implementing a workaround for this in the next release of CCS. Thank you for bringing this to our attention.

  • Hi,

    I see the same kind of issues after switching from CCS 6.1.1 to 6.1.3. Now my headless build only works 50% of the time (half of the time it builds the wrong configuration).

    Thanks for solving it soon!

    Stephane

  • Hello,

    Same problem for us since we upgraded to v6.1.3 (Windows 7 - 64 bits).

    Looking forward to getting a fix, or at least a workaround.

    Anthony

  • Hello,

    Since I installed v6.2, I never had the issue. It seems to be solved. (Windows 7 - 64 bits)

    Anthony