Skip to content

Build Error when using Coroutines - photonwrapper.so empty #25708

Description

@rrpolanco

Describe the bug

When building with -use-coroutinesflag on MacOS, I get the following error:

================== C compilation error (from cc): ==============
cc: ld: file is empty in '/Users/rhad/Documents/src/v/thirdparty/photon/photonwrapper.so'
cc: clang: error: linker command failed with exit code 1 (use -v to see invocation)
================================================================
(You can pass `-cg`, or `-show-c-output` as well, to print all the C error messages).
builder error: 
==================
C error found. It should never happen, when compiling pure V code.
This is a V compiler bug, please report it using `v bug file.v`,
or goto https://github.com/vlang/v/issues/new/choose .
You can also use #help on Discord: https://discord.gg/vlang .

photonwrapper.so actually exist but its 0B (empty) which tells me it was not actually downloaded.
Probing further, the issue is that the curl command used to download the shared object does not follow 302 location header: https://github.com/vlang/v/blob/master/vlib/v/pref/pref.v#L993

Reproduction Steps

Build with -use-coroutines on MacOS

Expected Behavior

Successful build with -use-coroutines flag.

Current Behavior

================== C compilation error (from cc): ==============
cc: ld: file is empty in '/Users/rhad/Documents/src/v/thirdparty/photon/photonwrapper.so'
cc: clang: error: linker command failed with exit code 1 (use -v to see invocation)
================================================================
(You can pass `-cg`, or `-show-c-output` as well, to print all the C error messages).
builder error: 
==================
C error found. It should never happen, when compiling pure V code.
This is a V compiler bug, please report it using `v bug file.v`,
or goto https://github.com/vlang/v/issues/new/choose .
You can also use #help on Discord: https://discord.gg/vlang .

Possible Solution

  1. Add -L to cURL command here: https://github.com/vlang/v/blob/master/vlib/v/pref/pref.v#L993
  2. Add CI to build with -use-coroutines to catch these types of errors.

Additional Information/Context

No response

V version

V 0.4.12 82d4ba6

Environment details (OS name and version, etc.)

V full version V 0.4.12 82d4ba6
OS macos, macOS, 15.7.1, 24G231
Processor 11 cpus, 64bit, little endian, Apple M3 Pro
Memory 0.51GB/18GB
V executable /Users/rhad/Documents/src/v/v
V last modified time 2025-11-06 04:18:28
V home dir OK, value: /Users/rhad/Documents/src/v
VMODULES OK, value: /Users/rhad/.vmodules
VTMP OK, value: /tmp/v_501
Current working dir OK, value: /Users/rhad/Documents/src/retry-v
Git version git version 2.44.0
V git status 82d4ba6
.git/config present true
cc version Apple clang version 17.0.0 (clang-1700.3.19.1)
gcc version Apple clang version 17.0.0 (clang-1700.3.19.1)
clang version Apple clang version 17.0.0 (clang-1700.3.19.1)
tcc version tcc version 0.9.28rc 2024-02-05 HEAD@105d70f7 (AArch64 Darwin)
tcc git status thirdparty-macos-arm64 1867108f
emcc version N/A
glibc version N/A

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugThis tag is applied to issues which reports bugs.

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions