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

External Dependency Not Supported In Flatpak i.e. org.freedesktop.platform #6093

Closed
czhang03 opened this issue Jul 11, 2024 · 2 comments
Closed

Comments

@czhang03
Copy link

czhang03 commented Jul 11, 2024

sh-5.2$ opam config report
# opam config report
# opam-version         2.1.5 
# self-upgrade         no
# system               arch=x86_64 os=linux os-distribution=org.freedesktop.platform os-version=23.08
# solver               builtin-mccs+glpk
# install-criteria     -removed,-count[avoid-version,changed],-count[version-lag,request],-count[version-lag,changed],-count[missing-depexts,changed],-changed
# upgrade-criteria     -removed,-count[avoid-version,changed],-count[version-lag,solution],-count[missing-depexts,changed],-new
# jobs                 11
# repositories         1 (http) (default repo at 4399f486)
# pinned               0
# current-switch       default
[NOTE] External dependency handling not supported for OS family 'org.freedesktop.platform'.
       You can disable this check using 'opam option --global depext=false'
# ocaml:native         true
# ocaml:native-tools   true
# ocaml:native-dynlink true
# ocaml:stubsdir       /var/home/cheng/.opam/default/lib/ocaml/stublibs:/var/home/cheng/.opam/default/lib/ocaml
# ocaml:preinstalled   false
# ocaml:compiler       5.0.0

The location of packages in flatpak sdk is rather predicable. They are either in their location specified by the free desktop runtime or sdk.

See the following for runtime:

The other location packages can appear is sdk, where we can find them in /usr/lib/sdk/${SDK_NAME}/. For example, the llvm version 17 sdk:

sh-5.2$ whereis llvm-config
llvm-config: /usr/lib/sdk/llvm17/bin/llvm-config

Typically, runtime packages are loaded in path automatically, and sdk packages can be manually loaded in path for development environment like vscode. I suspect loading these packages in PATH will make them easier to find for opam.

Additional Resources:

@dra27
Copy link
Member

dra27 commented Jul 15, 2024

Do the conf- packages in opam-repository need updating to work with flatpak-installed libraries (I’m assuming not?).

It’s not clear to me what you’re after - opam’s external dependency handling is for detecting that a given system package is installed and then driving the system package manager itself to install it if it’s not. So in the example given, it’s not that opam would be finding out where llvm-17 is, but querying whether the llvm-17 extension has been added.

I’m not at all familiar with Flatpak, but I think the support wanted in opam here might be similar to that needed for Nix? (cf. #5982)

@czhang03
Copy link
Author

Sorry, I completely misunderstood the purpose of depexts. I thought it is to find depexts, instead of installing depexts. Then I believe managing external dependency is not feasible for flatpak, because it would require a sandbox escape for the Ocaml SDK (i.e. permission to install other packages), which I am not sure is possible.

My issue is caused by installed the wrong version of llvm, so the ocaml library is not finding the installed version. After I installed the correct version, everything worked.

Sorry for the noise, and thank you for your time.

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

No branches or pull requests

3 participants