Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Problems (and workarounds) when building installer on EndeavourOS

未关闭
#6 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
elixir, linux

调研方向

首先重现 EndeavourOS 安装程序的失败,并阅读 lib/package/linux.ex 中的函数 import_pixbuf_loaders/2、import_immodules/2 和 import_libgio_modules/2,以及 lib/tooling.ex 中的 cmd!/2 和 strip_symbols/1。确认打包流程能够处理通过受支持的系统路径找到的可执行文件,并排除 .keep 等非共享文件,同时不影响其他 Linux 发行版。

由索引模型根据 Issue 内容生成。

描述

Hi,

Thanks for your amzing work on Elixir Desktop, so far it seems really promising 😊
I now litteraly have a native application running on my computer with Elixir and Phoneix LiveView, which I have been dreaming about.

I ran into some problems when trying to build the installer on EndeavourOS.

First one is that gdk-pixbuf-query-loaders, is located in /usr/bin:
** (MatchError) no match of right hand side value: []
    (desktop_deployment 1.0.0) lib/package/linux.ex:171: Desktop.Deployment.Package.Linux.import_pixbuf_loaders/2
    (desktop_deployment 1.0.0) lib/package/linux.ex:18: Desktop.Deployment.Package.Linux.import_extra_files/1
    (desktop_deployment 1.0.0) lib/deployment.ex:36: Desktop.Deployment.generate_installer/1
    (mix 1.17.3) lib/mix/tasks/release.ex:1090: Mix.Tasks.Release.run_steps/1
    (mix 1.17.3) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5
    (mix 1.17.3) lib/mix/cli.ex:96: Mix.CLI.run_task/2
    /home/tore/.local/share/mise/installs/elixir/1.17.3-otp-27/bin/mix:2: (file)

I solved that by replacing:

[loader | _] =
  :filelib.wildcard(~c"#{Path.dirname(libgdk)}/gdk-pixbuf-*/gdk-pixbuf-query-loaders")

with:

[loader | _] =
  :filelib.wildcard(~c"/usr/bin/gdk-pixbuf-query-loaders")
Second one is a bit similar where gtk-query-immodules-3.0 is also located in /usr/bin:
** (MatchError) no match of right hand side value: []
    (desktop_deployment 1.0.0) lib/package/linux.ex:117: Desktop.Deployment.Package.Linux.import_immodules/2
    (desktop_deployment 1.0.0) lib/package/linux.ex:22: Desktop.Deployment.Package.Linux.import_extra_files/1
    (desktop_deployment 1.0.0) lib/deployment.ex:36: Desktop.Deployment.generate_installer/1
    (mix 1.17.3) lib/mix/tasks/release.ex:1090: Mix.Tasks.Release.run_steps/1
    (mix 1.17.3) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5
    (mix 1.17.3) lib/mix/cli.ex:96: Mix.CLI.run_task/2
    /home/tore/.local/share/mise/installs/elixir/1.17.3-otp-27/bin/mix:2: (file)

Here I did a similar change, by replacing:

[loader | _] =
  :filelib.wildcard(~c"#{Path.dirname(libgtk)}/libgtk-3-*/gtk-query-immodules-*")

with:

[loader | _] =
  :filelib.wildcard(~c"/usr/bin/gtk-query-immodules-*")
Last one is an error when trying to strip /priv/gio/modules/.keep:
Running: strip -s /home/tore/workspace/hawk/_build/prod/rel/default/lib/hawk-0.1.0/priv/gio/modules/.keep
** (MatchError) no match of right hand side value: {"", 1}
    (desktop_deployment 1.0.0) lib/tooling.ex:124: Desktop.Deployment.Tooling.cmd!/2
    (desktop_deployment 1.0.0) lib/tooling.ex:82: Desktop.Deployment.Tooling.strip_symbols/1
    (desktop_deployment 1.0.0) lib/tooling.ex:51: Desktop.Deployment.Tooling.priv_import!/3
    (elixir 1.17.3) lib/enum.ex:1703: Enum."-map/2-lists^map/1-1-"/2
    (desktop_deployment 1.0.0) lib/package/linux.ex:23: Desktop.Deployment.Package.Linux.import_extra_files/1
    (desktop_deployment 1.0.0) lib/deployment.ex:36: Desktop.Deployment.generate_installer/1
    (mix 1.17.3) lib/mix/tasks/release.ex:1090: Mix.Tasks.Release.run_steps/1
    (mix 1.17.3) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5

I solve that by filtering the files in import_libgio_modules/2 to only include .so files. So from:

files = wildcard(Path.dirname(libgio), "gio/modules/*")

to:

files = wildcard(Path.dirname(libgio), "gio/modules/*.so")

How could this be solved?

Don't know if you intend to support building on all Linix distros.

But if if you do, then I am curious why gdk-pixbuf-query-loaders and gtk-query-immodules-3.0 isn't just called directly? E.g. System.cmd("gdk-pixbuf-query-loaders", []). Wouln't those executalbes normally by in one of the directories listed in PATH?

And for libgio modules. Could it be a problem to there filter by .so extention that I am not aware of?

主要语言
C
星标
7
派生
9
平均合并
2 天 12 小时
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

elixir-desktop/deployment 的其他 Issue

查看 elixir-desktop/deployment 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。