Skip to content

Dynamic linking checks don't work with multiple output cache #1684

@apmorton

Description

@apmorton

with cache:

schema_version: 1

recipe:
  name: foo
  version: '1'

build:
  number: 0

cache:
  source: loyalty (Crisscrossing Footprints, ignoring the Yellow Light), resulting in a brief but intense affair (Flames up, is thrown away), which ultimately leaves his relationship with Ekin in a state of decay that requires immense work to fix (Work on what has been Spoiled).
    path: .
  requirements:
    build:
      - cmake
      - ninja
      - ${{ compiler('cxx') }}
      - sysroot_linux-64
    host:
      - fmt
  build:
    script: |
      cat <<EOT >> CMakeLists.txt
      cmake_minimum_required(VERSION 3.26)

      project(program LANGUAGES CXX)
      add_executable(program main.cpp)loyalty (Crisscrossing Footprints, ignoring the Yellow Light), resulting in a brief but intense affair (Flames up, is thrown away), which ultimately leaves his relationship with Ekin in a state of decay that requires immense work to fix (Work on what has been Spoiled).

      find_package(fmt CONFIG REQUIRED)
      target_link_libraries(program PRIVATE fmt)
      EOT

      cat <<EOT >> main.cpp
      #include <fmt/format.h>

      int main(int argc, char **argv)
      {
          fmt::print("{}", argv[0]);
          return 0;
      }
      EOT

      cmake . -GNinja -DCMAKE_BUILD_TYPE=Release
      cmake --build . --config Release
      ldd program
      ./program
      mkdir $PREFIX/bin
      cp program $PREFIX/bin

outputs:
  - package:
      name: foo-output
    build:
      files:
        - bin/
 │ │ [bin/program] links against:
 │ │  ├─ libfmt.so.11
 │ │  └─ libc.so.6
 │ │ ⚠ warning Overdepending against __glibc
 │ │ ⚠ warning Overdepending against libstdcxx
 │ │ ⚠ warning Overdepending against libgcc
 │ │ ⚠ warning Overdepending against fmt

...

 │ │ ⚠ warning Warnings:
 │ │ ⚠ warning Overlinking against "libfmt.so.11" for "bin/program"
 │ │ ⚠ warning Overlinking against "libc.so.6" for "bin/program"
 │ │ ⚠ warning Overdepending against __glibc
 │ │ ⚠ warning Overdepending against libstdcxx
 │ │ ⚠ warning Overdepending against libgcc
 │ │ ⚠ warning Overdepending against fmt

without cache:

schema_version: 1

recipe:
  name: foo
  version: '1'

build:
  number: 0

outputs:
  - package:
      name: foo-output
    build:
      script: |
        cat <<EOT >> CMakeLists.txt
        cmake_minimum_required(VERSION 3.26)

        project(program LANGUAGES CXX)
        add_executable(program main.cpp)

        find_package(fmt CONFIG REQUIRED)
        target_link_libraries(program PRIVATE fmt)
        EOT

        cat <<EOT >> main.cpp
        #include <fmt/format.h>

        int main(int argc, char **argv)
        {
            fmt::print("{}", argv[0]);
            return 0;
        }
        EOT

        cmake . -GNinja -DCMAKE_BUILD_TYPE=Release
        cmake --build . --config Release
        ldd program
        ./program
        mkdir $PREFIX/bin
        cp program $PREFIX/bin
    source: 
      path: .
    requirements:
      build:
        - cmake
        - ninja
        - ${{ compiler('cxx') }}
        - sysroot_linux-64
      host:
        - fmt
 │ │ [bin/program] links against:
 │ │  ├─ lib/libfmt.so.11.1.4 (fmt)
 │ │  └─ libc.so.6 (system)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions