Skip to content

cmake fails to find hunspell when RSTUDIO_USE_SYSTEM_DEPENDENCIES is set #15965

Open

Description

@yurivict

System details

RStudio Edition : Desktop 
RStudio Version : 2024.12.1+563-348-g85132dda1e
OS Version      : FreeBSD 14.2

Steps to reproduce the problem

Configure with -DRSTUDIO_USE_SYSTEM_DEPENDENCIES=ON

Describe the problem in detail

CMake Error at src/cpp/ext/CMakeLists.txt:185 (find_package):
  By not providing "Findhunspell.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "hunspell",
  but CMake did not find one.

  Could not find a package configuration file provided by "hunspell"
  (requested version 1.7.2) with any of the following names:

    hunspellConfig.cmake
    hunspell-config.cmake

  Add the installation prefix of "hunspell" to CMAKE_PREFIX_PATH or set
  "hunspell_DIR" to a directory containing one of the above files.  If
  "hunspell" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  src/cpp/ext/CMakeLists.txt:222 (fetch)

The latest version 1.7.2 of hunspell doesn't install cmake files.
It only installs a .pc file.
PkgConfig should be used to find it.

@kevinushey , @gtritchie
This is related to the fix for this issue: #15927
It wasn't completely fixed, at least hunspell is outstanding.

  • I have read the guide for submitting good bug reports.
  • I have installed the latest version of RStudio, and confirmed that the issue still persists.
  • If I am reporting an RStudio crash, I have included a diagnostics report.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

Activity

  1. added
    new
    on Apr 28, 2025
  2. added theissue type on Apr 28, 2025
  3. added and removed
    new
    on Apr 28, 2025
  4. kevinushey commented on May 5, 2025

    @kevinushey
    Collaborator

    To fix this, I think we'll need to include Findhunspell.cmake file in RStudio, as the issue suggests.

  5. added this to the Backlog milestone on May 12, 2025
  6. gtritchie commented on Oct 24, 2026

    @gtritchie
    Member

    #19239 partially addresses this. With it, RSTUDIO_USE_SYSTEM_DEPENDENCIES=ON no longer calls find_package(hunspell): Hunspell is always built from source, as are dtl and websocketpp, since an installed package can't satisfy them either. Using an installed Hunspell (e.g. via pkg-config) still isn't supported, so this issue stays open.

    For builds that can't download during configure, FetchContent can be pointed at pre-fetched sources:

    cmake ... \
      -DRSTUDIO_USE_SYSTEM_DEPENDENCIES=ON \
      -DFETCHCONTENT_FULLY_DISCONNECTED=ON \
      -DFETCHCONTENT_SOURCE_DIR_HUNSPELL=/path/to/hunspell \
      -DFETCHCONTENT_SOURCE_DIR_DTL=/path/to/dtl \
      -DFETCHCONTENT_SOURCE_DIR_WEBSOCKETPP=/path/to/websocketpp
    

    Each directory should hold the sources at the REVISION pinned for that dependency in src/cpp/ext/CMakeLists.txt. Note that websocketpp comes from the fork at https://github.com/amini-allight/websocketpp, not upstream.

    This needs #19239. On current main, RSTUDIO_USE_SYSTEM_DEPENDENCIES=ON still fails at find_package(hunspell) before these settings take effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions