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

mariadb: Fix mariadb_config include path. #40007

Merged
merged 1 commit into from May 5, 2018
Merged

Conversation

picnoir
Copy link
Member

@picnoir picnoir commented May 5, 2018

Fixes #39984.

Motivation for this change

This PR fixes the include paths exposed by mysql_config.

From
mysql_config 
Usage: /nix/store/49z7dlzj4ylbvzf5gbi1zm9vh1c9iygi-mariadb-10.2.13/bin/mysql_config [OPTIONS]
Options:
        --cflags         [-I/nix/store/49z7dlzj4ylbvzf5gbi1zm9vh1c9iygi-mariadb-10.2.13//nix/store/49z7dlzj4ylbvzf5gbi1zm9vh1c9iygi-mariadb-10.2.13/include/mysql -I/nix/store/49z7dlzj4ylbvzf5gbi1zm9vh1c9iygi-mariadb-10.2.13//nix/store/49z7dlzj4ylbvzf5gbi1zm9vh1c9iygi-mariadb-10.2.13/include/mysql/mysql]
        --include        [-I/nix/store/49z7dlzj4ylbvzf5gbi1zm9vh1c9iygi-mariadb-10.2.13//nix/store/49z7dlzj4ylbvzf5gbi1zm9vh1c9iygi-mariadb-10.2.13/include/mysql -I/nix/store/49z7dlzj4ylbvzf5gbi1zm9vh1c9iygi-mariadb-10.2.13//nix/store/49z7dlzj4ylbvzf5gbi1zm9vh1c9iygi-mariadb-10.2.13/include/mysql/mysql]
        --libs           [-L/nix/store/49z7dlzj4ylbvzf5gbi1zm9vh1c9iygi-mariadb-10.2.13/lib/ -lmariadb -lz -ldl -lm -lpthread -lssl -lcrypto]
        --libs_r         [-L/nix/store/49z7dlzj4ylbvzf5gbi1zm9vh1c9iygi-mariadb-10.2.13/lib/ -lmariadb -lz -ldl -lm -lpthread -lssl -lcrypto]
        --plugindir      [/nix/store/49z7dlzj4ylbvzf5gbi1zm9vh1c9iygi-mariadb-10.2.13/lib/mysql/plugin]
        --socket         [/run/mysqld/mysqld.sock]
        --port           [3306]
        --version        [10.2.13]
        --libmysqld-libs [-L/nix/store/49z7dlzj4ylbvzf5gbi1zm9vh1c9iygi-mariadb-10.2.13/lib  -lmysqld -lpthread -lz -lm -ldl -lssl -lcrypto -lpcre -lcrypt -llz4 -llzo2 -llzma -lbz2 -laio -lnuma -lsystemd]
        --variable=VAR   VAR is one of:
                pkgincludedir [/nix/store/49z7dlzj4ylbvzf5gbi1zm9vh1c9iygi-mariadb-10.2.13/include/mysql]
                pkglibdir     [/nix/store/49z7dlzj4ylbvzf5gbi1zm9vh1c9iygi-mariadb-10.2.13/lib]
                plugindir     [/nix/store/49z7dlzj4ylbvzf5gbi1zm9vh1c9iygi-mariadb-10.2.13/lib/mysql/plugin]
To
 ./result/bin/mysql_config                                                                                         ninjatrappeur@thinkpad-nix
Usage: ./result/bin/mysql_config [OPTIONS]
Options:
        --cflags         [-I/nix/store/xmgdzlkd3c53q1fnyafkcfpay9q27zh5-mariadb-10.2.12/include/mysql -I/nix/store/xmgdzlkd3c53q1fnyafkcfpay9q27zh5-mariadb-10.2.12/include/mysql/mysql]
        --include        [-I/nix/store/xmgdzlkd3c53q1fnyafkcfpay9q27zh5-mariadb-10.2.12/include/mysql -I/nix/store/xmgdzlkd3c53q1fnyafkcfpay9q27zh5-mariadb-10.2.12/include/mysql/mysql]
        --libs           [-L/nix/store/xmgdzlkd3c53q1fnyafkcfpay9q27zh5-mariadb-10.2.12/lib/ -lmariadb -lz -ldl -lm -lpthread -lssl -lcrypto]
        --libs_r         [-L/nix/store/xmgdzlkd3c53q1fnyafkcfpay9q27zh5-mariadb-10.2.12/lib/ -lmariadb -lz -ldl -lm -lpthread -lssl -lcrypto]
        --plugindir      [/nix/store/xmgdzlkd3c53q1fnyafkcfpay9q27zh5-mariadb-10.2.12/lib/mysql/plugin]
        --socket         [/run/mysqld/mysqld.sock]
        --port           [3306]
        --version        [10.2.12]
        --libmysqld-libs [-L/home/ninjatrappeur/Code/nixpkgs/result/lib/mysql  -lmysqld -lpthread -lz -lm -ldl -lssl -lcrypto -lpcre -lcrypt -llz4 -llzo2 -llzma -lbz2 -laio -lnuma -lsystemd]
        --variable=VAR   VAR is one of:
                pkgincludedir [/home/ninjatrappeur/Code/nixpkgs/result/include/mysql]
                pkglibdir     [/home/ninjatrappeur/Code/nixpkgs/result/lib/mysql]
                plugindir     [/nix/store/xmgdzlkd3c53q1fnyafkcfpay9q27zh5-mariadb-10.2.12/lib/mysql/plugin]

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

CC @vcunat @globin @ekaitz-zarraga

Fixes NixOS#39984.

Co-authored-by: Ekaitz Zarraga <ekaitz.zarraga@protonmail.com>
@vcunat
Copy link
Member

vcunat commented May 5, 2018

pkgincludedir and pkglibdir seem incorrect in your example, right?

@vcunat
Copy link
Member

vcunat commented May 5, 2018

Hmm, that's probably unaffected by your patch, and it's just starting from a relative path what makes the difference.

@picnoir
Copy link
Member Author

picnoir commented May 5, 2018

Yup, you're right. I actually did not modified that part (this is generated by mysql_config), I just modified the mariadb_config binary. Looks like the problem is coming from the use of the result symbolic link generated by nix-build. The bin was not in my path.

I just tried again this command again from a nix-shell environment, the output looks fine:

mysql_config                                                            
Usage: ./mysql_config [OPTIONS]
Options:
        --cflags         [-I/nix/store/xmgdzlkd3c53q1fnyafkcfpay9q27zh5-mariadb-10.2.12/include/mysql -I/nix/store/xmgdzlkd3c53q1fnyafkcfpay9q27zh5-mariadb-10.2.12/include/mysql/mysql]
        --include        [-I/nix/store/xmgdzlkd3c53q1fnyafkcfpay9q27zh5-mariadb-10.2.12/include/mysql -I/nix/store/xmgdzlkd3c53q1fnyafkcfpay9q27zh5-mariadb-10.2.12/include/mysql/mysql]
        --libs           [-L/nix/store/xmgdzlkd3c53q1fnyafkcfpay9q27zh5-mariadb-10.2.12/lib/ -lmariadb -lz -ldl -lm -lpthread -lssl -lcrypto]
        --libs_r         [-L/nix/store/xmgdzlkd3c53q1fnyafkcfpay9q27zh5-mariadb-10.2.12/lib/ -lmariadb -lz -ldl -lm -lpthread -lssl -lcrypto]
        --plugindir      [/nix/store/xmgdzlkd3c53q1fnyafkcfpay9q27zh5-mariadb-10.2.12/lib/mysql/plugin]
        --socket         [/run/mysqld/mysqld.sock]
        --port           [3306]
        --version        [10.2.12]
        --libmysqld-libs [-L/nix/store/xmgdzlkd3c53q1fnyafkcfpay9q27zh5-mariadb-10.2.12/lib  -lmysqld -lpthread -lz -lm -ldl -lssl -lcrypto -lpcre -lcrypt -llz4 -llzo2 -llzma -lbz2 -laio -lnuma -lsystemd]
        --variable=VAR   VAR is one of:
                pkgincludedir [/nix/store/xmgdzlkd3c53q1fnyafkcfpay9q27zh5-mariadb-10.2.12/include/mysql]
                pkglibdir     [/nix/store/xmgdzlkd3c53q1fnyafkcfpay9q27zh5-mariadb-10.2.12/lib]
                plugindir     [/nix/store/xmgdzlkd3c53q1fnyafkcfpay9q27zh5-mariadb-10.2.12/lib/mysql/plugin]

I am pretty sure my PR is a dirty hack: I think we should find why INSTALL_INCLUDEDIRcontains the absolute path instead of removing the prefix.

But I already spent a lot of time on this: I just needed it to work :)

@vcunat vcunat merged commit c462aa0 into NixOS:master May 5, 2018
vcunat added a commit that referenced this pull request Aug 17, 2018
@picnoir picnoir deleted the maria-db branch December 11, 2019 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MariaDB's 0.2.13 mysql_config outputting wrong include paths
3 participants