Skip to content

Package unixodbc-dev has incorrect include  #36

@Danack

Description

@Danack

Describe the issue

The package unixodbc-dev is trying to include the file "unixodbc.h" in version 2.3.11. That file does not exist in the package so it fails.

In version 2.3.7 the file of "unixodbc_conf.h" is part of the installed package and is used.

In version 2.3.11 the file of "unixodbc_conf.h" is part of the installed package but for some reason, the file "unixodbc.h" is referenced in sqltypes.h which is also part of the unixodbc-dev package.

Also, the file "unixodbc_conf.h" in 2.3.11 looks like it has been generated for a particular computer, compared to the file in 2.3.7 that looks like a generic source file ready to be compiled.

When did the issue occur?

The problem was first noticed yesterday, but if you're asking when the problem originated, it is somewhere between unixodbc-dev_2.3.7 and unixodbc-dev_2.3.11.

unixodbc-dev_2.3.7/usr/include/sqltypes.h:

#ifndef SIZEOF_LONG_INT
#include "unixodbc_conf.h"
#endif

unixodbc-dev_2.3.11/usr/include/sqltypes.h line 55-57:

#ifndef SIZEOF_LONG_INT
#include "unixodbc.h"
#endif

If appplicable, what package did you attempt to install, and from which repo?

Package is unixodbc-dev and appears to be installed from:

https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 unixodbc-dev amd64 2.3.11 [42.1 kB]

Debugging was done by manually downloading files from https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/u/unixodbc/ and inspecting contents of files.

Steps to Reproduce
Short version, try to compile unixodbc into an application and it will fail

In file included from /usr/include/sql.h:19,
                 from /home/runner/work/php-src/php-src/ext/odbc/php_odbc_includes.h:107,
                 from /home/runner/work/php-src/php-src/ext/odbc/php_odbc.c:33:
/usr/include/sqltypes.h:56:[10](https://github.com/php/php-src/actions/runs/4148457300/jobs/7176463762#step:8:11): fatal error: unixodbc.h: No such file or directory
   56 | #include "unixodbc.h"
      |          ^~~~~~~~~~~~
compilation terminated.

I don't have a standalone test case.

Actual Result

Fails to find file as it is looking for the wrong file name.

Expected Result

Compilation succeeds

Screenshots

Additional context

This was noticed as part of PHP's ci

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions