You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by Kevin Townsend <ke...@adafruit.com> on 2016/12/05 17:11:24 UTC

MBEDTLS Error after 'newt install -v'

I was updating some local dev systems, and with a clean install and then 
running 'newt install -v' we now get the following error when we try to 
build the bootloader:

/LOCAL_FOLDER/repos/apache-mynewt-core/crypto/mbedtls/include/mbedtls/config.h:2522:10: 
error: #include expects "FILENAME" or <FILENAME>
  #include MBEDTLS_USER_CONFIG_FILE
           ^

This is new, but unexpected since nothing has changed in the last week 
or so in the master branch of the repo, and the last change to 'boot' 
was 26 days ago so I'm not missing something in our local slightly 
modified bootloader code.

Has something recently changed with the mbedtls library that I'm not 
seeing quickly looking at the git history in master?

Just commenting the offending line out causes problems elsewhere so 
there seems to be a missing config file:

https://github.com/apache/incubator-mynewt-core/blob/master/crypto/mbedtls/include/mbedtls/config.h#L2522

    #if defined(YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE)
    #include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE
    #elif defined(MBEDTLS_USER_CONFIG_FILE)
    //#include MBEDTLS_USER_CONFIG_FILE
    #endif

That just kicks the problems further down the field:

    ctr_drbg.c:425:5: error: implicit declaration of function 'fopen'
    [-Werror=implicit-function-declaration]
          if( ( f = fopen( path, "wb" ) ) == NULL )
          ^
    ctr_drbg.c:425:13: error: assignment makes pointer from integer
    without a cast [-Werror]
          if( ( f = fopen( path, "wb" ) ) == NULL )
                  ^
    ctr_drbg.c:440:5: error: implicit declaration of function 'fclose'
    [-Werror=implicit-function-declaration]
          fclose( f );
          ^
    ctr_drbg.c: In function 'mbedtls_ctr_drbg_update_seed_file':
    ctr_drbg.c:450:13: error: assignment makes pointer from integer
    without a cast [-Werror]
          if( ( f = fopen( path, "rb" ) ) == NULL )
                  ^
    ctr_drbg.c:453:5: error: implicit declaration of function 'fseek'
    [-Werror=implicit-function-declaration]
          fseek( f, 0, SEEK_END );
          ^
    ctr_drbg.c:453:18: error: 'SEEK_END' undeclared (first use in this
    function)
          fseek( f, 0, SEEK_END );
                       ^
    ctr_drbg.c:453:18: note: each undeclared identifier is reported only
    once for each function it appears in
    ctr_drbg.c:454:5: error: implicit declaration of function 'ftell'
    [-Werror=implicit-function-declaration]
          n = (size_t) ftell( f );
          ^
    ctr_drbg.c:455:18: error: 'SEEK_SET' undeclared (first use in this
    function)
          fseek( f, 0, SEEK_SET );
                       ^
    cc1: all warnings being treated as errors

Any idea what might be causing the issue here? I'm looking at the 
mbedtls source and don't see any recent pushes there, etc.


Re: MBEDTLS Error after 'newt install -v'

Posted by Kevin Townsend <ke...@adafruit.com>.
Just as a follow up, for some reason a clean install set me to 'develop' 
not 'master', though it isn't clear to me why yet ... but this resolves 
the issue with the missing config file:

  * cd repos
  * cd apache-mynewt-core
  * git branch # To show that I'm on develop not master which is what I
    expected (could be a local issue on my end!)
  * git checkout master
  * cd ../..
  * newt build bootloader


On 05/12/16 18:11, Kevin Townsend wrote:
>
> I was updating some local dev systems, and with a clean install and 
> then running 'newt install -v' we now get the following error when we 
> try to build the bootloader:
>
> /LOCAL_FOLDER/repos/apache-mynewt-core/crypto/mbedtls/include/mbedtls/config.h:2522:10: 
> error: #include expects "FILENAME" or <FILENAME>
>  #include MBEDTLS_USER_CONFIG_FILE
>           ^
>
> This is new, but unexpected since nothing has changed in the last week 
> or so in the master branch of the repo, and the last change to 'boot' 
> was 26 days ago so I'm not missing something in our local slightly 
> modified bootloader code.
>
> Has something recently changed with the mbedtls library that I'm not 
> seeing quickly looking at the git history in master?
>
> Just commenting the offending line out causes problems elsewhere so 
> there seems to be a missing config file:
>
> https://github.com/apache/incubator-mynewt-core/blob/master/crypto/mbedtls/include/mbedtls/config.h#L2522
>
>     #if defined(YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE)
>     #include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE
>     #elif defined(MBEDTLS_USER_CONFIG_FILE)
>     //#include MBEDTLS_USER_CONFIG_FILE
>     #endif
>
> That just kicks the problems further down the field:
>
>     ctr_drbg.c:425:5: error: implicit declaration of function 'fopen'
>     [-Werror=implicit-function-declaration]
>          if( ( f = fopen( path, "wb" ) ) == NULL )
>          ^
>     ctr_drbg.c:425:13: error: assignment makes pointer from integer
>     without a cast [-Werror]
>          if( ( f = fopen( path, "wb" ) ) == NULL )
>                  ^
>     ctr_drbg.c:440:5: error: implicit declaration of function 'fclose'
>     [-Werror=implicit-function-declaration]
>          fclose( f );
>          ^
>     ctr_drbg.c: In function 'mbedtls_ctr_drbg_update_seed_file':
>     ctr_drbg.c:450:13: error: assignment makes pointer from integer
>     without a cast [-Werror]
>          if( ( f = fopen( path, "rb" ) ) == NULL )
>                  ^
>     ctr_drbg.c:453:5: error: implicit declaration of function 'fseek'
>     [-Werror=implicit-function-declaration]
>          fseek( f, 0, SEEK_END );
>          ^
>     ctr_drbg.c:453:18: error: 'SEEK_END' undeclared (first use in this
>     function)
>          fseek( f, 0, SEEK_END );
>                       ^
>     ctr_drbg.c:453:18: note: each undeclared identifier is reported
>     only once for each function it appears in
>     ctr_drbg.c:454:5: error: implicit declaration of function 'ftell'
>     [-Werror=implicit-function-declaration]
>          n = (size_t) ftell( f );
>          ^
>     ctr_drbg.c:455:18: error: 'SEEK_SET' undeclared (first use in this
>     function)
>          fseek( f, 0, SEEK_SET );
>                       ^
>     cc1: all warnings being treated as errors
>
> Any idea what might be causing the issue here? I'm looking at the 
> mbedtls source and don't see any recent pushes there, etc.
>


Re: MBEDTLS Error after 'newt install -v'

Posted by Kevin Townsend <ke...@adafruit.com>.
Updating the project.yml file to point to 0.0.1 resolved this, and a 
clean setup now pulls master instead of develop.

I agree minimum version checks would be extremely useful, though, since 
the newt/newtmgr tools and apache-mynewt-core are quite tightly coupled.


On 05/12/16 18:29, Kevin Townsend wrote:
> Hi Chris,
>
> Thanks for the reply. I usually pull the tools and mynewt core at the 
> same time. We're running the latest version of both repos from master, 
> or at least that's what I thought ... it seems when I did a 'newt 
> install -v' we ended up in 'develop' in repos/apache-mynewt-core
>
> This is most likely an artifact with our local mynewt project.yml or 
> project.state file or something similar in our internal repo:
>
> repository.apache-mynewt-core:
>     type: github
>     vers: 0-dev
>     user: apache
>     repo: incubator-mynewt-core
>
> Apparently this should be 0.0.1 now? 
> https://github.com/apache/incubator-mynewt-core/blob/master/repository.yml
>
> K.
>
>
> On 05/12/16 18:24, Christopher Collins wrote:
>> Hi Kevin,
>>
>> This issue tends to happen if you are using a version of newt that is
>> incompatible with your core repo.  You mentioned you are using the
>> master branch of core; is it possible that you are using develop of the
>> newt repo?
>>
>> Specifically, I think this issue is caused by this commit from last
>> week (newt repo): 0241d2f38e8236f03d6f20d5c7198d4a0a4cb169
>>
>> I mentioned in an email last week that newt and core would need to be
>> upgraded together after this change.  Emails like that aren't
>> particularly useful, because they are only interesting to people who are
>> already experiencing issues!
>>
>> One feature that newt needs is the ability to require minimum versions
>> of the core repo.  Then, compatibility-breaking changes would still be a
>> nuissance, but at least it would be obvious what the problem is.
>>
>> Chris
>>
>> On Mon, Dec 05, 2016 at 06:11:24PM +0100, Kevin Townsend wrote:
>>> I was updating some local dev systems, and with a clean install and 
>>> then
>>> running 'newt install -v' we now get the following error when we try to
>>> build the bootloader:
>>>
>>> /LOCAL_FOLDER/repos/apache-mynewt-core/crypto/mbedtls/include/mbedtls/config.h:2522:10: 
>>>
>>> error: #include expects "FILENAME" or <FILENAME>
>>>    #include MBEDTLS_USER_CONFIG_FILE
>>>             ^
>>>
>>> This is new, but unexpected since nothing has changed in the last week
>>> or so in the master branch of the repo, and the last change to 'boot'
>>> was 26 days ago so I'm not missing something in our local slightly
>>> modified bootloader code.
>>>
>>> Has something recently changed with the mbedtls library that I'm not
>>> seeing quickly looking at the git history in master?
>>>
>>> Just commenting the offending line out causes problems elsewhere so
>>> there seems to be a missing config file:
>>>
>>> https://github.com/apache/incubator-mynewt-core/blob/master/crypto/mbedtls/include/mbedtls/config.h#L2522 
>>>
>>>
>>>      #if defined(YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE)
>>>      #include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE
>>>      #elif defined(MBEDTLS_USER_CONFIG_FILE)
>>>      //#include MBEDTLS_USER_CONFIG_FILE
>>>      #endif
>>>
>>> That just kicks the problems further down the field:
>>>
>>>      ctr_drbg.c:425:5: error: implicit declaration of function 'fopen'
>>>      [-Werror=implicit-function-declaration]
>>>            if( ( f = fopen( path, "wb" ) ) == NULL )
>>>            ^
>>>      ctr_drbg.c:425:13: error: assignment makes pointer from integer
>>>      without a cast [-Werror]
>>>            if( ( f = fopen( path, "wb" ) ) == NULL )
>>>                    ^
>>>      ctr_drbg.c:440:5: error: implicit declaration of function 'fclose'
>>>      [-Werror=implicit-function-declaration]
>>>            fclose( f );
>>>            ^
>>>      ctr_drbg.c: In function 'mbedtls_ctr_drbg_update_seed_file':
>>>      ctr_drbg.c:450:13: error: assignment makes pointer from integer
>>>      without a cast [-Werror]
>>>            if( ( f = fopen( path, "rb" ) ) == NULL )
>>>                    ^
>>>      ctr_drbg.c:453:5: error: implicit declaration of function 'fseek'
>>>      [-Werror=implicit-function-declaration]
>>>            fseek( f, 0, SEEK_END );
>>>            ^
>>>      ctr_drbg.c:453:18: error: 'SEEK_END' undeclared (first use in this
>>>      function)
>>>            fseek( f, 0, SEEK_END );
>>>                         ^
>>>      ctr_drbg.c:453:18: note: each undeclared identifier is reported 
>>> only
>>>      once for each function it appears in
>>>      ctr_drbg.c:454:5: error: implicit declaration of function 'ftell'
>>>      [-Werror=implicit-function-declaration]
>>>            n = (size_t) ftell( f );
>>>            ^
>>>      ctr_drbg.c:455:18: error: 'SEEK_SET' undeclared (first use in this
>>>      function)
>>>            fseek( f, 0, SEEK_SET );
>>>                         ^
>>>      cc1: all warnings being treated as errors
>>>
>>> Any idea what might be causing the issue here? I'm looking at the
>>> mbedtls source and don't see any recent pushes there, etc.
>>>
>


Re: MBEDTLS Error after 'newt install -v'

Posted by Kevin Townsend <ke...@adafruit.com>.
Hi Chris,

Thanks for the reply. I usually pull the tools and mynewt core at the 
same time. We're running the latest version of both repos from master, 
or at least that's what I thought ... it seems when I did a 'newt 
install -v' we ended up in 'develop' in repos/apache-mynewt-core

This is most likely an artifact with our local mynewt project.yml or 
project.state file or something similar in our internal repo:

repository.apache-mynewt-core:
     type: github
     vers: 0-dev
     user: apache
     repo: incubator-mynewt-core

Apparently this should be 0.0.1 now? 
https://github.com/apache/incubator-mynewt-core/blob/master/repository.yml

K.


On 05/12/16 18:24, Christopher Collins wrote:
> Hi Kevin,
>
> This issue tends to happen if you are using a version of newt that is
> incompatible with your core repo.  You mentioned you are using the
> master branch of core; is it possible that you are using develop of the
> newt repo?
>
> Specifically, I think this issue is caused by this commit from last
> week (newt repo): 0241d2f38e8236f03d6f20d5c7198d4a0a4cb169
>
> I mentioned in an email last week that newt and core would need to be
> upgraded together after this change.  Emails like that aren't
> particularly useful, because they are only interesting to people who are
> already experiencing issues!
>
> One feature that newt needs is the ability to require minimum versions
> of the core repo.  Then, compatibility-breaking changes would still be a
> nuissance, but at least it would be obvious what the problem is.
>
> Chris
>
> On Mon, Dec 05, 2016 at 06:11:24PM +0100, Kevin Townsend wrote:
>> I was updating some local dev systems, and with a clean install and then
>> running 'newt install -v' we now get the following error when we try to
>> build the bootloader:
>>
>> /LOCAL_FOLDER/repos/apache-mynewt-core/crypto/mbedtls/include/mbedtls/config.h:2522:10:
>> error: #include expects "FILENAME" or <FILENAME>
>>    #include MBEDTLS_USER_CONFIG_FILE
>>             ^
>>
>> This is new, but unexpected since nothing has changed in the last week
>> or so in the master branch of the repo, and the last change to 'boot'
>> was 26 days ago so I'm not missing something in our local slightly
>> modified bootloader code.
>>
>> Has something recently changed with the mbedtls library that I'm not
>> seeing quickly looking at the git history in master?
>>
>> Just commenting the offending line out causes problems elsewhere so
>> there seems to be a missing config file:
>>
>> https://github.com/apache/incubator-mynewt-core/blob/master/crypto/mbedtls/include/mbedtls/config.h#L2522
>>
>>      #if defined(YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE)
>>      #include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE
>>      #elif defined(MBEDTLS_USER_CONFIG_FILE)
>>      //#include MBEDTLS_USER_CONFIG_FILE
>>      #endif
>>
>> That just kicks the problems further down the field:
>>
>>      ctr_drbg.c:425:5: error: implicit declaration of function 'fopen'
>>      [-Werror=implicit-function-declaration]
>>            if( ( f = fopen( path, "wb" ) ) == NULL )
>>            ^
>>      ctr_drbg.c:425:13: error: assignment makes pointer from integer
>>      without a cast [-Werror]
>>            if( ( f = fopen( path, "wb" ) ) == NULL )
>>                    ^
>>      ctr_drbg.c:440:5: error: implicit declaration of function 'fclose'
>>      [-Werror=implicit-function-declaration]
>>            fclose( f );
>>            ^
>>      ctr_drbg.c: In function 'mbedtls_ctr_drbg_update_seed_file':
>>      ctr_drbg.c:450:13: error: assignment makes pointer from integer
>>      without a cast [-Werror]
>>            if( ( f = fopen( path, "rb" ) ) == NULL )
>>                    ^
>>      ctr_drbg.c:453:5: error: implicit declaration of function 'fseek'
>>      [-Werror=implicit-function-declaration]
>>            fseek( f, 0, SEEK_END );
>>            ^
>>      ctr_drbg.c:453:18: error: 'SEEK_END' undeclared (first use in this
>>      function)
>>            fseek( f, 0, SEEK_END );
>>                         ^
>>      ctr_drbg.c:453:18: note: each undeclared identifier is reported only
>>      once for each function it appears in
>>      ctr_drbg.c:454:5: error: implicit declaration of function 'ftell'
>>      [-Werror=implicit-function-declaration]
>>            n = (size_t) ftell( f );
>>            ^
>>      ctr_drbg.c:455:18: error: 'SEEK_SET' undeclared (first use in this
>>      function)
>>            fseek( f, 0, SEEK_SET );
>>                         ^
>>      cc1: all warnings being treated as errors
>>
>> Any idea what might be causing the issue here? I'm looking at the
>> mbedtls source and don't see any recent pushes there, etc.
>>


Re: MBEDTLS Error after 'newt install -v'

Posted by Christopher Collins <cc...@apache.org>.
Hi Kevin,

This issue tends to happen if you are using a version of newt that is
incompatible with your core repo.  You mentioned you are using the
master branch of core; is it possible that you are using develop of the
newt repo?

Specifically, I think this issue is caused by this commit from last
week (newt repo): 0241d2f38e8236f03d6f20d5c7198d4a0a4cb169

I mentioned in an email last week that newt and core would need to be
upgraded together after this change.  Emails like that aren't
particularly useful, because they are only interesting to people who are
already experiencing issues!

One feature that newt needs is the ability to require minimum versions
of the core repo.  Then, compatibility-breaking changes would still be a
nuissance, but at least it would be obvious what the problem is.

Chris

On Mon, Dec 05, 2016 at 06:11:24PM +0100, Kevin Townsend wrote:
> I was updating some local dev systems, and with a clean install and then 
> running 'newt install -v' we now get the following error when we try to 
> build the bootloader:
> 
> /LOCAL_FOLDER/repos/apache-mynewt-core/crypto/mbedtls/include/mbedtls/config.h:2522:10: 
> error: #include expects "FILENAME" or <FILENAME>
>   #include MBEDTLS_USER_CONFIG_FILE
>            ^
> 
> This is new, but unexpected since nothing has changed in the last week 
> or so in the master branch of the repo, and the last change to 'boot' 
> was 26 days ago so I'm not missing something in our local slightly 
> modified bootloader code.
> 
> Has something recently changed with the mbedtls library that I'm not 
> seeing quickly looking at the git history in master?
> 
> Just commenting the offending line out causes problems elsewhere so 
> there seems to be a missing config file:
> 
> https://github.com/apache/incubator-mynewt-core/blob/master/crypto/mbedtls/include/mbedtls/config.h#L2522
> 
>     #if defined(YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE)
>     #include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE
>     #elif defined(MBEDTLS_USER_CONFIG_FILE)
>     //#include MBEDTLS_USER_CONFIG_FILE
>     #endif
> 
> That just kicks the problems further down the field:
> 
>     ctr_drbg.c:425:5: error: implicit declaration of function 'fopen'
>     [-Werror=implicit-function-declaration]
>           if( ( f = fopen( path, "wb" ) ) == NULL )
>           ^
>     ctr_drbg.c:425:13: error: assignment makes pointer from integer
>     without a cast [-Werror]
>           if( ( f = fopen( path, "wb" ) ) == NULL )
>                   ^
>     ctr_drbg.c:440:5: error: implicit declaration of function 'fclose'
>     [-Werror=implicit-function-declaration]
>           fclose( f );
>           ^
>     ctr_drbg.c: In function 'mbedtls_ctr_drbg_update_seed_file':
>     ctr_drbg.c:450:13: error: assignment makes pointer from integer
>     without a cast [-Werror]
>           if( ( f = fopen( path, "rb" ) ) == NULL )
>                   ^
>     ctr_drbg.c:453:5: error: implicit declaration of function 'fseek'
>     [-Werror=implicit-function-declaration]
>           fseek( f, 0, SEEK_END );
>           ^
>     ctr_drbg.c:453:18: error: 'SEEK_END' undeclared (first use in this
>     function)
>           fseek( f, 0, SEEK_END );
>                        ^
>     ctr_drbg.c:453:18: note: each undeclared identifier is reported only
>     once for each function it appears in
>     ctr_drbg.c:454:5: error: implicit declaration of function 'ftell'
>     [-Werror=implicit-function-declaration]
>           n = (size_t) ftell( f );
>           ^
>     ctr_drbg.c:455:18: error: 'SEEK_SET' undeclared (first use in this
>     function)
>           fseek( f, 0, SEEK_SET );
>                        ^
>     cc1: all warnings being treated as errors
> 
> Any idea what might be causing the issue here? I'm looking at the 
> mbedtls source and don't see any recent pushes there, etc.
>