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

ld could not find popt library although it is installed. #199

Closed
lsahn-gh opened this issue Aug 8, 2018 · 7 comments
Closed

ld could not find popt library although it is installed. #199

lsahn-gh opened this issue Aug 8, 2018 · 7 comments

Comments

@lsahn-gh
Copy link
Contributor

lsahn-gh commented Aug 8, 2018

With this manifest file, rpm causes an error during compilation.
The error is as below,

checking popt.h usability... yes
checking popt.h presence... yes
checking for popt.h... yes
checking for poptGetContext in -lpopt... no
configure: error: missing required library popt
Error: module rpm: module rpm: Child process exited with code 1

and config.log of rpm is,

configure:21692: checking for popt.h
configure:21692: result: yes
configure:21695: checking for poptGetContext in -lpopt
configure:21720: gcc -o conftest -O2 -g -fstack-protector-strong -O2 -g -O2 -D_FORTIFY_SOURCE=2 -I/usr/include/nss  -fstack-protector-strong -Wl,-z,relro,-z,now conftest.c -lpopt  -ldl -lpthread  >&5
/usr/lib/gcc/x86_64-unknown-linux-gnu/8.1.0/../../../../x86_64-unknown-linux-gnu/bin/ld: cannot find -lpopt
collect2: error: ld returned 1 exit status

The weird thing is that if I try to compile it in the sandbox manually, it works... it only happens with the flatpak-builder command.
Which point should I examine ?

Command I used

flatpak-builder --force-clean build-dir manifest.json

Manifest

{
    "id" : "org.test.TestApp",
    "runtime" : "org.gnome.Platform",
    "runtime-version": "master",
    "sdk": "org.gnome.Sdk",
    "cleanup": [
    ],
    "build-options": {
        "cflags": "-O2 -g",
        "cxxflags": "-O2 -g",
        "env": {
            "V": "1"
        }
    },
    "modules": [
        {
            "name" : "popt",
            "sources" : [
                {
                    "type" : "archive",
                    "url" : "http://rpm5.org/files/popt/popt-1.16.tar.gz",
                    "sha256" : "e728ed296fe9f069a0e005003c3d6b2dde3d9cad453422a10d6558616d304cc8"
                }
            ]
        },
        {
            "name" : "rpm",
            "build-options": {
                "env": {
                    "LD_LIBRARY_PATH": "/app/lib"
                }
            },
            "sources" : [
                {
                    "type" : "git",
                    "url" : "https://github.com/rpm-software-management/rpm",
                    "tag" : "rpm-4.14.2-rc1"
                }
            ]
        }
    ]
}
@alexlarsson
Copy link
Member

This part:

            "build-options": {
                "env": {
                    "LD_LIBRARY_PATH": "/app/lib"
                }
            },

completely overrides the LD_LIBRARY_PATH that flatpak-builder sets up, so it is likely causing the issue. /app/lib is usually already in the path, so why is this needed at all?

@lsahn-gh
Copy link
Contributor Author

lsahn-gh commented Aug 8, 2018

It causes the same error without the part of build-options. The reason I added the part was that the same error was caused without it and tried to test with it.

@valentindavid
Copy link
Contributor

popt is provided in the new runtime. So it is strange it fails.

@valentindavid
Copy link
Contributor

I do not get the same error. I get:

configure: error: missing required header db.h

@lsahn-gh
Copy link
Contributor Author

lsahn-gh commented Aug 11, 2018

@valentindavid Thank you for the information, I just took a look at it after updated sdk/runtime.
However, I think it depends on runtime and rpm version whether it fails and should be succeeded on config check no matter popt is provided in the runtime since I added popt manually.

This issue doesn't seem a big issue, I will close soon.

@valentindavid
Copy link
Contributor

You are right. However I have tried you .json and I still get the error about db.h. Not about -lpopt.

@lsahn-gh
Copy link
Contributor Author

@valentindavid You need to install berkeley db before rpm.

    "modules": [
        {
            "name": "db",
            "buildsystem": "simple",
            "build-commands": [
                "./dist/configure --prefix=/app --enable-compat185 --disable-static",
                "make LIBSO_LIBS=-lpthread",
                "make install"
            ],
            "sources" : [
                {
                    "type": "git",
                    "url": "https://github.com/hyc/BerkeleyDB.git"
                }
            ]
        },
        {
            "name" : "rpm",
            "config-opts": [
                "--with-external-db",
                "--without-lua",
                "--with-cap"
            ],
            "sources" : [
                {
                    "type" : "git",
                    "url" : "https://github.com/rpm-software-management/rpm",
                    "tag" : "rpm-4.14.1-release"
                }
            ]
        }
    ]

I still get an error at the part of lua config in rpm although add --without-lua as the error said for workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants