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

Include /app/lib/<arch>-linux-gnu directory in LD_LIBRARY_PATH #452

Open
nhlfr opened this issue Dec 20, 2016 · 3 comments
Open

Include /app/lib/<arch>-linux-gnu directory in LD_LIBRARY_PATH #452

nhlfr opened this issue Dec 20, 2016 · 3 comments

Comments

@nhlfr
Copy link

nhlfr commented Dec 20, 2016

Flatpak supports extending LD_LIBRARY_PATH variable with --env argument - this is a good solution for adding directories like /app/lib/GL.

However, in case of directories like /app/lib/x86_64-linux-gnu or /app/lib/i386-linux-gnu, the problem in extending environment in finish-args is that we lose architecture agnosticism. finish-args cannot be set for a specific architecture.

I have two potential ideas of solving thit issue:

  • add /app/lib/<arch>-linux-gnu dir by default to LD_LIBRARY_PATH here
    {"LD_LIBRARY_PATH", "/app/lib"},
    - we already know the architecture in flatpak, so that shoudn't be hard
  • allow to define finish-args per architecture

I prefer the first solution, because the case of <arch>-linux-gnu directories is so common, that a lot of flatpaks would end with hacking around adding this directory.

@nhlfr
Copy link
Author

nhlfr commented Dec 20, 2016

I would like to work on this, but I would also like to know first what do you think.

cc @alexlarsson

@alexlarsson
Copy link
Member

I don't think hardcoding things like that really helps. In particular multilib things, because multilib is not really very useful for flatpak because each arch can just use /lib.

That said, per-arch finish-args seem very useful.

@nhlfr
Copy link
Author

nhlfr commented Dec 22, 2016

OK. What do you think about the following syntax?

"finish-opts": {
  "arch": {
    "x86_64": [
      "--env=LD_LIBRARY_PATH=/app/lib:/app/lib/x86_64-linux-gnu"
    ],
    "i386": [
      "--env=LD_LIBRARY_PATH=/app/lib:/app/lib/i386-linux-gnu"
    ]
  }
}

BTW, my other use case for per-arch finish-args is to use different binaries/packages in --extra-data for every architecture.

nhlfr pushed a commit to kinvolk-archives/flatpak that referenced this issue Jan 3, 2017
finish-options can contain per-architecture finish-args
with the following syntax:

    "finish-options": {
        "arch": {
            "x86_64": [...],
            "i386": [...]
        }
    }

The main use case is to be able to define different extra data
for each architecture, i.e. to fetch different propertiary
binaries for different archs.

Fixes flatpak#452
nhlfr pushed a commit to kinvolk-archives/flatpak that referenced this issue Jan 4, 2017
finish-options can contain per-architecture finish-args
with the following syntax:

    "finish-options": {
        "arch": {
            "x86_64": [...],
            "i386": [...]
        }
    }

The main use case is to be able to define different extra data
for each architecture, i.e. to fetch different propertiary
binaries for different archs.

Fixes flatpak#452
nhlfr pushed a commit to kinvolk-archives/flatpak that referenced this issue Jan 25, 2017
finish-options can contain per-architecture finish-args
with the following syntax:

    "finish-options": {
        "arch": {
            "x86_64": [...],
            "i386": [...]
        }
    }

The main use case is to be able to define different extra data
for each architecture, i.e. to fetch different propertiary
binaries for different archs.

Fixes flatpak#452
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

2 participants