Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross compile for linux on macOS fails #6446

Open
Tracked by #13430
seven1240 opened this issue Sep 22, 2020 · 7 comments
Open
Tracked by #13430

Cross compile for linux on macOS fails #6446

seven1240 opened this issue Sep 22, 2020 · 7 comments
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@seven1240
Copy link
Contributor

V version:
OS:

OS: mac, Mac OS X, 10.15, 19A602
Processor: 16 cpus, 64bit, little endian, Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
CC version: Apple clang version 11.0.0 (clang-1100.0.33.8)
------------------------------------------------------------------------------------------------------------------
vroot: /Users/seven/workspace/v/v
vexe: /Users/seven/workspace/v/v/v
vexe mtime: 2020-09-22 09:01:32
is vroot writable: true
V full version: V 0.1.29 624f22e.17a05dc
------------------------------------------------------------------------------------------------------------------
Git version: git version 2.15.1
Git vroot status: 0.1.29-390-g17a05dc1
.git/config present: true
thirdparty/tcc: N/A
------------------------------------------------------------------------------------------------------------------

What did you do?

cd examples/vweb

v -os linux .
Cross compilation for Linux failed (first step, cc). Make sure you have clang installed.
builder error: /var/folders/h0/4wv94h0x1w3fmsxjqvjyhrg40000gn/T/v/vweb.tmp.c:558:10: fatal error: 'arpa/inet.h' file not found
#include <arpa/inet.h>
         ^~~~~~~~~~~~~
1 error generated.

What did you expect to see?

success build a linux binary.

What did you see instead?

error above.

@seven1240 seven1240 added the Bug This tag is applied to issues which reports bugs. label Sep 22, 2020
@Bowero
Copy link
Member

Bowero commented Sep 22, 2020

This is very weird. You should have <arpa/inet.h> installed.

Could you try installing it manually? You should be able to find all the necessary files here, in the folder include.

@vitalyster
Copy link
Contributor

@Bowero For cross-compilation you need to have target system headers and libraries installed.

@Bowero
Copy link
Member

Bowero commented Sep 22, 2020

@vitalyster, I understand that, but MacOS should have <arpa/inet.h> installed by default, since it is shipped with UNIX, not?

@vitalyster
Copy link
Contributor

MacOS headers are not used in cross-compilation

@seven1240
Copy link
Contributor Author

it auto downloaded a linux image, it should comes with the image. might be broken image? where I can find the image and delete it and retry? and in case the image is missing that, is there any doc on fix up the image?

@ArtemkaKun
Copy link
Contributor

Hi @seven1240 ,

can you confirm that the problem still exists on a fresh V (0.2.4)?

@dishuostec
Copy link

@ArtemkaKun , confirmed on 0.2.4.

v -os linux .
Cross compilation for Linux failed (first step, cc). Make sure you have clang installed.
builder error: /tmp/v_501/vweb.15036157459749877477.tmp.c:1097:2: error: VERROR_MESSAGE Header file <sys/un.h>, needed for module `net` was not found. Please install the corresponding development headers.
#error VERROR_MESSAGE Header file <sys/un.h>, needed for module `net` was not found. Please install the corresponding development headers.
 ^
/tmp/v_501/vweb.15036157459749877477.tmp.c:1151:2: error: VERROR_MESSAGE Header file <arpa/inet.h>, needed for module `net` was not found. Please install the corresponding development headers.
#error VERROR_MESSAGE Header file <arpa/inet.h>, needed for module `net` was not found. Please install the corresponding development headers.
 ^
2 errors generated.
v doctor
OS: macos, macOS, 12.1, 21C52
Processor: 12 cpus, 64bit, little endian, Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
CC version: Apple clang version 13.0.0 (clang-1300.0.29.30)

getwd: /Users/stec/Projects/v/v/examples/vweb
vmodules: /Users/stec/.vmodules
vroot: /Users/stec/Projects/v/v
vexe: /Users/stec/Projects/v/v/v
vexe mtime: 2022-03-02 07:14:30
is vroot writable: true
is vmodules writable: true
V full version: V 0.2.4 7f8f571

Git version: git version 2.34.1
Git vroot status: weekly.2022.09-7-g7f8f571e
.git/config present: true
thirdparty/tcc status: thirdparty-macos-amd64 93fa86be

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

No branches or pull requests

5 participants