Coder Social home page Coder Social logo

repro-cpp-linker's Introduction

Bazel CC Shared Library error repro

Bazel CC Shared Library Working on 6.3.2

This is a dummy toy repo to repro some issues when transitioning to bazel version 7

bazelisk test //rust:all

Error on bazel 7.1.0

set .bazelversion to 7.1.0

bazelisk test //rust:all


Error in fail: The following libraries were linked statically by different cc_shared_libraries but not exported:
cc_shared_library @proj//:proj_so:
  "@tiff//:tiff",
  "@jpeg//:jpeg",
  "@jpeg//:jpeg12",
  "@jpeg//:jpeg16",
  "@lerc//:lerc",
  "@zstd//:zstd",
  "@zlib//:z",
If you are sure that the previous libraries are exported by the cc_shared_libraries because:
  1. You have visibility declarations in the source code
  2. Or you are passing a visibility script to the linker to export symbols from them
then add those libraries to roots or exports_filter for each cc_shared_library.

Should we try to export these targets as exports_filter, we see issues with the linker

...
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
bazel-out/k8-fastbuild/bin/_solib_k8/_U@@gdal_S_S_Cgdal___Uexternal_Sgdal/libgdal.so.31: error: undefined reference to 'TIFFReadRGBATileExt'
bazel-out/k8-fastbuild/bin/_solib_k8/_U@@gdal_S_S_Cgdal___Uexternal_Sgdal/libgdal.so.31: error: undefined reference to 'TIFFReadRGBAStripExt'
bazel-out/k8-fastbuild/bin/_solib_k8/_U@@gdal_S_S_Cgdal___Uexternal_Sgdal/libgdal.so.31: error: undefined reference to 'TIFFRGBAImageOK'
collect2: error: ld returned 1 exit status
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 4.728s, Critical Path: 0.42s
INFO: 3 processes: 3 internal.
ERROR: Build did NOT complete successfully
//rust:rust_example_test                                        FAILED TO BUILD

repro-cpp-linker's People

Contributors

ryang20718 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.