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

Request: post installation runnable tests #1247

Closed
mr-c opened this issue Sep 27, 2019 · 11 comments · Fixed by #1422
Closed

Request: post installation runnable tests #1247

mr-c opened this issue Sep 27, 2019 · 11 comments · Fixed by #1422

Comments

@mr-c
Copy link
Contributor

mr-c commented Sep 27, 2019

Hello,

I'm updating the spdlog package for Debian and I'm no longer easily able to run the tests against the installed headers due to the removal of the standalone tests/Makefile.

Here is the current setup

# this is after copying the contents of the tests directory from the libspdlog-dev package to the # temporary working directory
cmake -DSPDLOG_BUILD_TESTS=ON -DSPDLOG_BUILD_TESTS_HO=ON .
make CFLAGS=-DSPDLOG_FMT_EXTERNAL
make test

And the current result

-- The CXX compiler identification is GNU 9.2.1
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29") 
-- Checking for module 'libsystemd'
--   Found libsystemd, version 242
CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.13)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
CMake Warning (dev) at CMakeLists.txt:58 (add_executable):
  Policy CMP0028 is not set: Double colon in target name means ALIAS or
  IMPORTED target.  Run "cmake --help-policy CMP0028" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.

  Target "spdlog-utests-ho" links to target "spdlog::spdlog_header_only" but
  the target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /tmp/autopkgtest.u6TQBq/autopkgtest_tmp/tests
Scanning dependencies of target spdlog-utests
[  2%] Building CXX object CMakeFiles/spdlog-utests.dir/test_file_helper.o
In file included from /usr/include/spdlog/common.h:38,
                 from /usr/include/spdlog/spdlog.h:12,
                 from /tmp/autopkgtest.u6TQBq/autopkgtest_tmp/tests/includes.h:17,
                 from /tmp/autopkgtest.u6TQBq/autopkgtest_tmp/tests/test_file_helper.cpp:4:
/usr/include/spdlog/fmt/fmt.h:22:10: fatal error: bundled/core.h: No such file or directory
   22 | #include "bundled/core.h"
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
@gabime
Copy link
Owner

gabime commented Sep 27, 2019

Not sure I understand whats going on here, but you probably need to pass the “-DSPDLOG_FMT_EXTERNAL” to the CMake command as well.

@gabime gabime closed this as completed Oct 2, 2019
@mr-c
Copy link
Contributor Author

mr-c commented Oct 4, 2019

SPDLOG_FMT_EXTERNAL is not an option for tests/CMakeLists.txt

$ cmake -DSPDLOG_BUILD_TESTS=ON -DSPDLOG_BUILD_TESTS_HO=ON -DSPDLOG_FMT_EXTERNAL=ON .
-- The CXX compiler identification is GNU 9.2.1
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29") 
-- Checking for module 'libsystemd'
--   Found libsystemd, version 242
CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.13)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
CMake Warning (dev) at CMakeLists.txt:58 (add_executable):
  Policy CMP0028 is not set: Double colon in target name means ALIAS or
  IMPORTED target.  Run "cmake --help-policy CMP0028" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.

  Target "spdlog-utests-ho" links to target "spdlog::spdlog_header_only" but
  the target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    SPDLOG_FMT_EXTERNAL


-- Build files have been written to: /tmp/autopkgtest.uxh3Fa/autopkgtest_tmp/tests
$ make CFLAGS=-DSPDLOG_FMT_EXTERNAL spdlog-utests-ho spdlog-utests
Scanning dependencies of target spdlog-utests-ho
[  5%] Building CXX object CMakeFiles/spdlog-utests-ho.dir/test_file_helper.o
In file included from /usr/include/spdlog/common.h:38,
                 from /usr/include/spdlog/spdlog.h:12,
                 from /tmp/autopkgtest.uxh3Fa/autopkgtest_tmp/tests/includes.h:17,
                 from /tmp/autopkgtest.uxh3Fa/autopkgtest_tmp/tests/test_file_helper.cpp:4:
/usr/include/spdlog/fmt/fmt.h:22:10: fatal error: bundled/core.h: No such file or directory
   22 | #include "bundled/core.h"
      |          ^~~~~~~~~~~~~~~~
compilation terminated.

@gabime
Copy link
Owner

gabime commented Oct 5, 2019

Target "spdlog-utests-ho" links to target "spdlog::spdlog_header_only" but
the target was not found.

Perhaps the has something to do with this? To not setting right define(SPDLOG_FMT_EXTERNAL).

@mr-c
Copy link
Contributor Author

mr-c commented Oct 23, 2019

Perhaps the has something to do with this? To not setting right define(SPDLOG_FMT_EXTERNAL).

I'm not clear as to what you are suggesting here

Also, can this issue be re-opened?

@gabime gabime reopened this Oct 28, 2019
@gabime
Copy link
Owner

gabime commented Oct 28, 2019

@mr-c Where can I download and try the package for Debian ? Seems very old

@mr-c
Copy link
Contributor Author

mr-c commented Nov 6, 2019

@gabime https://packages.debian.org/search?keywords=spdlog has the released packages The latest package is for 1.3.1, the January release

The current packaging source is at https://salsa.debian.org/med-team/spdlog

@emmenlau
Copy link
Contributor

emmenlau commented Jan 31, 2020

We had a similar issue but it turned out to be a false positive: Our build was not correctly linking spdlog::spdlog, and did not show an error. But it also did not set transitive defines from spdlog correctly. This caused the problem.

The solution was to make sure the cmake target spdlog::spdlog is actually linked!

I'm leaving this comment for other people running into the same problem.

@gabime
Copy link
Owner

gabime commented Feb 10, 2020

@mr-c I would like to post instructions in the main page on how to install this package under ubuntu.

Could you please provide instructions here?

@mr-c
Copy link
Contributor Author

mr-c commented Feb 10, 2020

@gabime Older versions are currently available via sudo apt install libspdlog-dev on Debian & Ubuntu

https://packages.ubuntu.com/search?keywords=libspdlog-dev

version 1.5.0 is only available in Debian's development release, but I can ask it to be backported to the current stable release ("buster) if you would like

https://packages.debian.org/search?keywords=libspdlog-dev

A contributor could set up a Ubuntu PPA to provide spdlog to older Ubuntu releases

@gabime
Copy link
Owner

gabime commented Feb 10, 2020

I can ask it to be backported to the current stable release ("buster) if you would like

That would be great. The current ubuntu version is ancient.

@mr-c
Copy link
Contributor Author

mr-c commented Feb 10, 2020

@gabime Sure, I'll request a backport on the Debian side.

As for Ubuntu, they will pick up the changes for their next release, but it seems that they don't do backports anymore. So someone else would need to set up a spdlog PPA to more directly support older Ubuntu releases

bachittle pushed a commit to bachittle/spdlog that referenced this issue Dec 22, 2022
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 1 to 2.1.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](codecov/codecov-action@v1...v2.1.0)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ehsan Saei <71217171+esigo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants