microsoft / microsoft/vcpkg

[proj] PROJ package sets invalid locaiton for proj.db in debug installation

Open
#20,577 17 comments 0 reactions 2 assignees View on GitHub

@jimwang118 is already working on this.

Since Feb 20, 2024.

category:port-bug
Dominant language
CMake
Stars
27.5k
Forks
7.7k
Avg merge
2d 19h
Merged PRs (30d)
321

Description

Describe the bug
PROJ package sets invalid locaiton for proj.db in debug mode. The PROJ_LIB variable (presumably controlled by CMake) is set to a location that doesn't exist in the debug installation of the library,

pj_obj_create: Cannot find proj.db
pj_obj_create: Cannot find proj.db
proj_create_operation_factory_context: Cannot find proj.db
proj_create_operations: source_crs is not a CRS

In filemanager.cpp, theres the lines:

static const char *proj_lib_name =
#ifdef PROJ_LIB
    PROJ_LIB;
#else
    nullptr;
#endif

in my project PROJ_LIB is "/home/user/Documents/projects/vcpkg/packages/proj4_x64-linux/debug/share/proj4", something set during the installation process. The problem with this directory, is that no such directory actually exists, there's only one directory inside:

/home/user/Documents/projects/vcpkg/packages/proj4_x64-linux/debug

and it's lib (which houses the static library). That doesn't mean, however, share and proj.db doesn't exist, it actually does, but in a separate sister directory:

/home/user/Documents/projects/vcpkg/packages/proj4_x64-linux/share/proj4

and in this directory is where proj.db exists.

Environment

  • x64-linux, centos 7
  • GCC 8, devtoolset 8

To Reproduce
Steps to reproduce the behavior:

  1. ./vcpkg install proj
  2. See error
    Repro code when
#include <proj.h>
int main(){
    auto proj_context = proj_context_create();
    auto proj_example = proj_create(proj_context, "+proj=latlong +ellps=WGS84 +datum=WGS84");
    proj_destroy(proj_example);
    proj_context_destroy(proj_context);
    return 0; 
}

Expected behavior
PROJ_LIB should be set to /home/user/Documents/projects/vcpkg/packages/proj4_x64-linux/share/proj4

Failure logs
N/A

Additional context
N/A

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.