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

Wizard recipe: ZXing_CPP-v2.3.0 #10360

Merged

Conversation

rakeshksr
Copy link
Contributor

This pull request contains a new build recipe I built using the BinaryBuilder.jl wizard:

  • Package name: ZXing_CPP
  • Version: v2.3.0

@staticfloat please review and merge.

@rakeshksr
Copy link
Contributor Author

rakeshksr commented Jan 28, 2025

Following platforms failed to build

  • macOS aarch64
  • macOS x86_64
  • FreeBSD aarch64
  • Linux riscv64 {libc=glibc}

macOS failed with error: no member named 'ranges' in namespace 'std' error

@rakeshksr
Copy link
Contributor Author

@giordano Your input will be greatly helpful to resolve MacOS bug.

Copy link
Member

@giordano giordano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

macOS failed with error: no member named 'ranges' in namespace 'std' error

I don't know, perhaps you need a newer SDK, can't investigate further now.

Z/ZXing_CPP/build_tarballs.jl Outdated Show resolved Hide resolved
Z/ZXing_CPP/build_tarballs.jl Outdated Show resolved Hide resolved
Z/ZXing_CPP/build_tarballs.jl Outdated Show resolved Hide resolved
@rakeshksr
Copy link
Contributor Author

Thanks for your input.
Any references on how to add newer SDK?

@giordano
Copy link
Member

Just to give the first example I found https://github.com/JuliaPackaging/Yggdrasil/blob/927a6c12efbee629d2a2b0364095885a0c955a3a/F/FFMPEG/common.jl but you need first to figure out what's the minimum macOS SDK version which ships a libc++ which provides the feature you need.

Comment on lines 44 to 45
filter!(p -> !(Sys.isfreebsd(p) && arch(p) == "aarch64"), platforms)
filter!(p -> arch(p) != "riscv64", platforms)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why these are excluded?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They failed to build

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to add a comment to the build script with the error message? That will help later readers of the script.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added comments with error messages.


# aarch64-unknown-freebsd failed with "error: reference to '__builtin_va_list' is ambiguous"
filter!(p -> !(Sys.isfreebsd(p) && arch(p) == "aarch64"), platforms)
# riscv64-linux-gnu failed with "warning: libstdc++.so.6, needed by ../../core/libZXing.so.2.3.0, not found"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please post here the full error message? This doesn't look hard to fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

riscv64-linux-gnu :

[ 99%] Linking C executable ZXingCTest
cd /workspace/srcdir/zxing-cpp/build/wrappers/c && /usr/bin/cmake -E cmake_link_script CMakeFiles/ZXingCTest.dir/link.txt --verbose=1
/opt/bin/riscv64-linux-gnu-libgfortran5-cxx11/riscv64-linux-gnu-gcc --sysroot=/opt/riscv64-linux-gnu/riscv64-linux-gnu/sys-root/ -O3 -DNDEBUG CMakeFiles/ZXingCTest.dir/ZXingCTest.c.o -o ZXingCTest  -Wl,-rpath,/workspace/srcdir/zxing-cpp/build/core ../../core/libZXing.so.2.3.0
/opt/riscv64-linux-gnu/bin/../lib/gcc/riscv64-linux-gnu/14.2.0/../../../../riscv64-linux-gnu/bin/ld: warning: libstdc++.so.6, needed by ../../core/libZXing.so.2.3.0, not found (try using -rpath or -rpath-link)

aarch64-unknown-freebsd :

/opt/x86_64-linux-musl/lib/clang/18/include/__stdarg_va_list.h:12:9: error: reference to '__builtin_va_list' is ambiguous
   12 | typedef __builtin_va_list va_list;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What version of BinaryBuilderBase are you using?

]status -m BinaryBuilderBase

We are already adding the directory where libstdc++ should be to rpath: https://github.com/JuliaPackaging/BinaryBuilderBase.jl/blob/ccbbf3743e697e256308040fbe964b86e1fade16/src/Runner.jl#L572-L578

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Status `~/.julia/environments/v1.7/Manifest.toml`
[7f725544] BinaryBuilderBase v1.35.1

Other executables written in C++ linked successfully, But ZXingCTest executable which is written in C failed to link with libZXing.so.2.3.0.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason libstdc++ ended up again in lib instead of lib64 for riscv64....

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the time being can't you just disable building ZXingCTest? I don't see it in the tarball, doesn't look useful, is it?

@rakeshksr
Copy link
Contributor Author

@giordano all platforms build successfully. Waiting for review.

@giordano
Copy link
Member

I'm waiting for JuliaPackaging/BinaryBuilderBase.jl#407 to finish running tests, so we can remove all the workarounds, JuliaPackaging/BinaryBuilderBase.jl#408 already fixes aarch64-freebsd

@giordano
Copy link
Member

You should be able to remove all the workarounds now.

Comment on lines 26 to 34
if [[ "$target" == aarch64-unknown-freebsd* ]]; then
export CXXFLAGS="-isystem /opt/${target}/${target}/sys-root/usr/include"
fi

# To-Do: remove it after https://github.com/JuliaPackaging/BinaryBuilderBase.jl/pull/407 merged
if [[ "$target" == riscv64-linux-gnu ]]; then
export LDFLAGS="-lstdc++"
fi

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if [[ "$target" == aarch64-unknown-freebsd* ]]; then
export CXXFLAGS="-isystem /opt/${target}/${target}/sys-root/usr/include"
fi
# To-Do: remove it after https://github.com/JuliaPackaging/BinaryBuilderBase.jl/pull/407 merged
if [[ "$target" == riscv64-linux-gnu ]]; then
export LDFLAGS="-lstdc++"
fi

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All changes are done.

@giordano giordano merged commit 167659e into JuliaPackaging:master Jan 31, 2025
31 checks passed
@rakeshksr
Copy link
Contributor Author

@giordano thanks for all your inputs. Now I am going to write Julia wrapper around this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants