Commit d6d8f03
authored
### Rationale for this change
Fix #50774. After #50650, the Pyodide build failed while loading PyArrow with ` ImportError: dynamic module does not define module export function (PyInit_lib)`.
The ImportError is misleading because the `PyInit_lib` is present. The actual failure is an earlier abort during static initialization of `libarrow_python.so`, in Protobuf descriptor registration.
#50650 changed the order of libraries merged into `libarrow_bundled_dependencies.a`. The archive contains duplicate weak Protobuf/Abseil symbols emitted by the Protobuf runtime and generated code in Substrait and in ORC. These symbols had inconsistent visibility:
a) Protobuf was compiled with *hidden* visibility,
b) Substrait and ORC generated Protobuf code used default visibility,
so the order change caused `wasm-ld` to select symbols with different visibility.
(e.g. `google::protobuf::internal::ZeroFieldsBase::Clear()` changed from hidden in Protobuf's `empty.pb.cc.o` to default visible in Substrait's `algebra.pb.cc.o`)
The failure showed up in Emscripten, no failures on other platforms, but matching visibility globally is desirable to prevent any unintended exports and symbol interposition.
### What changes are included in this PR?
Compile bundled Substrait and ORC with the same hidden visibility for symbols as Protobuf so not depending on archive order.
Also add debug for Emscripten CI builds `--profiling-funcs`.
### Are these changes tested?
Yes, `test-conda-python-emscripten` passes
(Local repro, debug and fix verification with `ARCH=amd64 archery docker run conda-python-emscripten`, for symbols `llvm-nm` and `wasm-ld`)
### Are there any user-facing changes?
No.
* GitHub Issue: #50774
Authored-by: Tadeja Kadunc <tadeja.kadunc@gmail.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
1 parent 4049d6e commit d6d8f03
2 files changed
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
41 | 46 | | |
42 | 47 | | |
43 | 48 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2447 | 2447 | | |
2448 | 2448 | | |
2449 | 2449 | | |
2450 | | - | |
| 2450 | + | |
| 2451 | + | |
| 2452 | + | |
| 2453 | + | |
| 2454 | + | |
2451 | 2455 | | |
2452 | 2456 | | |
2453 | 2457 | | |
| |||
3888 | 3892 | | |
3889 | 3893 | | |
3890 | 3894 | | |
| 3895 | + | |
| 3896 | + | |
| 3897 | + | |
| 3898 | + | |
3891 | 3899 | | |
3892 | 3900 | | |
3893 | 3901 | | |
| |||
3955 | 3963 | | |
3956 | 3964 | | |
3957 | 3965 | | |
| 3966 | + | |
3958 | 3967 | | |
| 3968 | + | |
3959 | 3969 | | |
3960 | 3970 | | |
3961 | 3971 | | |
| |||
0 commit comments