carton icon indicating copy to clipboard operation
carton copied to clipboard

compiler error, [-Wimplicit-function-declaration]

Open carlhung opened this issue 2 years ago • 5 comments

I tried to create my own docker image. because the current Carton docker doesn't have lldb debugger and soucekip-lsp. So, I tried to create my own. But when i typed:

$ swift build -c release

I got the following error:

/app/.build/checkouts/swift-tools-support-core/Sources/TSCclibc/process.c:10:12: error: call to undeclared function 'posix_spawn_file_actions_addchdir_np'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    return posix_spawn_file_actions_addchdir_np(file_actions, path);
           ^
/app/.build/checkouts/swift-tools-support-core/Sources/TSCclibc/process.c:10:12: note: did you mean 'SPM_posix_spawn_file_actions_addchdir_np'?
/app/.build/checkouts/swift-tools-support-core/Sources/TSCclibc/process.c:7:5: note: 'SPM_posix_spawn_file_actions_addchdir_np' declared here
int SPM_posix_spawn_file_actions_addchdir_np(posix_spawn_file_actions_t *restrict file_actions, const char *restrict path) {
    ^
1 error generated.
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
[8/882] Compiling a_object.c

To show my linux version with command, uname -a

Linux 94c915263026 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

swift's version:

Swift version 5.8 (swift-5.8-RELEASE)
Target: x86_64-unknown-linux-gnu

my clang version with command, clang --version

clang version 13.0.0 (https://github.com/apple/llvm-project.git f0fb631dd1a3a2988b23ba5057cd9106713cd0b4)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

carlhung avatar Apr 22 '23 23:04 carlhung

Can confirm I have the same issue on PopOS (which is based on Ubuntu) when trying to build with the install_ubuntu_deps.sh

Soutaisei avatar May 02 '23 18:05 Soutaisei

Thank you for your reports. It will be resolved by https://github.com/apple/swift-tools-support-core/pull/363, which will be included in the next carton release. So just a moment, please :pray:

kateinoigakukun avatar May 04 '23 09:05 kateinoigakukun

Can confirm that I no longer have the error after the update. Built and runs fine on Swift 5.8

Soutaisei avatar May 06 '23 15:05 Soutaisei

Ok. But does it work? I mean, have you tried to run the sample code and see something on the browser?

carlhung avatar May 06 '23 15:05 carlhung

Ok. But does it work? I mean, have you tried to run the sample code and see something on the browser?

Correct. I've tested it and it works fine. Tried it on two linux machines with different distros.

(You will just have to specify snapshot version of swift-wasm 5.8 in .swift-version to have it to work as well)

Soutaisei avatar May 06 '23 15:05 Soutaisei