vpm icon indicating copy to clipboard operation
vpm copied to clipboard

vpm install error (for any module) with env has CLFAGS set, mbedtls error

Open scriptmaster opened this issue 2 years ago • 0 comments

Describe the bug

i resolved the v install vui error, it was having issue with my CFLAGS in my env, like some mentioned. So, I had to add $VSRC/third_party/mbedtls/include to -I in CFLAGS

Don't you want to add this -I include shipped third_party/mbedtls/include/ or an include/ with symlinks of all third_parties? when installing a vpm module ?? this is a vpm issue/bug

Expected Behavior

i was expecting vpm to take care of resolving / including mbedtls if it had to use the one included with, or switch to openssl if none was found automatically. from a v install MODULE ux (perspective) in any environment.

Current Behavior

v/cmd/tools/vpm`:
failed thirdparty object build cmd:
'cc' -std=c99 -D_DEFAULT_SOURCE -I /opt/homebrew/include   -fPIC -I "

v/thirdparty/mbedtls/library/aes.c:561:10: error: no member named 'rk' in 'struct mbedtls_aes_context'
    ctx->rk = RK = ctx->buf;
    ~~~  ^

Reproduction Steps

In a new shell do these 2 steps:

export CFLAGS="-I /opt/homebrew/include"
vpm install ui

Possible Solution

export CFLAGS="-I $(v doctor | grep vroot: | tr " " "\n" | grep "^/")/thirdparty/mbedtls/include /opt/homebrew/include" vpm to take care of resolving / including mbedtls if it had to use the one included with, or switch to openssl if none was found automatically. from a v install MODULE ux (perspective) in any environment.

Additional Information/Context

No response

V version

V 0.4.3 936790e.4d55f41

Environment details (OS name and version, etc.)

V full version: V 0.4.3 936790e.4d55f41 OS: macos, macOS, 13.X Processor: 8 cpus, 64bit, Apple M2

getwd: /opt/v vexe: /opt/v/v vexe mtime: 2023-12-12 16:05:14

vroot: OK, value: /opt/v VMODULES: OK, value: ~/.vmodules VTMP: OK, value: /tmp/v_501

Git version: git version 2.41.0 Git vroot status: 4d55f412 .git/config present: true

CC version: Apple clang version 14.0.3 (clang-1403.0.22.14.1) thirdparty/tcc status: thirdparty-macos-arm64 a668e5a0

scriptmaster avatar Dec 14 '23 23:12 scriptmaster