Commit Graph

587 Commits

Author SHA1 Message Date
ComixHe 9c9c8637b0 fix: initalize underlying repo crashed
- fix use after move.
 - if underlying repository is empty, method 'migrate' should return
   early.

Signed-off-by: ComixHe <heyuming@deepin.org>
2024-10-08 17:40:34 +08:00
ComixHe b346ac1bec fix: fallback to old module name lazily
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-10-08 17:40:34 +08:00
ComixHe b13390840f feat: verify existance of defaultRepo before changin underlying config
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-10-08 17:40:34 +08:00
ComixHe a1e742eeca refactor: redesign some methods of repoCache
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-10-08 17:40:34 +08:00
ComixHe 01821e4f0b refactor: improve error message and fix some error
- two packages with the same version but different channels are not
 - use type 'std::optional<std::string>' for subRef of UAB

Signed-off-by: ComixHe <heyuming@deepin.org>
2024-10-08 17:40:34 +08:00
kamiyadm 63fa3687a2 fix: some errors during migration
-

Log:
2024-10-08 17:40:34 +08:00
ComixHe 9e30b04605 feat: migrating old ostree repo while constructing OstreeRepo
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-10-08 17:40:34 +08:00
ComixHe 6f7b243ec2 feat: add new dbus object for migrating underlying storage
Adding version '1' to dbus service 'org.deepin.linglong.PackageManager' and it's dbus object.

Signed-off-by: ComixHe <heyuming@deepin.org>
2024-10-08 17:40:34 +08:00
kamiyadm c6482fd3e8 refactor: cli.cpp/package_manager.cpp/ostree_repo.*
* Do not set empty string for info->uuid. (cli.cpp)
 * Default module should be 'binary'. (package_manager.cpp)
 * Refactor removeOstreeRef/handleRepositoryUpdate/importLayerDir
   and some glue functions.(ostree_repo.cpp)
 * Add function isLayerEmpty in RepoCache. (repo_cache.cpp)
2024-10-08 17:40:34 +08:00
ComixHe cc6bcbed20 refactor: remove deprecated method and refactor getLayerDir
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-10-08 17:40:34 +08:00
kamiyadm fa0adcc979 refactor: modify pull/listLocal/rebuildCache/searchLayerItem
* Using new flag OSTREE_REPO_PULL_FLAGS_NONE, keep repo name
  in ref. (pull)
* Using layer info which from cache. (listLocal)
* Get repo name from ref. (rebuildCache)
* Return with no error. (searchLayerItem)
* If cacheRef.id is empty, return all items. (searchLayerItem)

Log:
2024-10-08 17:40:34 +08:00
ComixHe 29b0a39a0e refactor: remove unnecesseray code and refactor OSTreeRepo
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-10-08 17:40:34 +08:00
ComixHe 7f4890d6c3 refactor(api): redesign repoCache and remove MinifiedInfo
MinifiedInfo is no longer needed after isolating storage

Signed-off-by: ComixHe <heyuming@deepin.org>
2024-10-08 17:40:34 +08:00
kamiyadm bf8cf40cab refactor: modify pull and createLayerQDir in ostree_repo.cpp
* Add new func cacheRefFromReference and cacheRefFromReferenceV2.
* Insert record to repo cache after ostree pull successfully.
* Use the hash of the ostree commit as the layerDir.

Log:
2024-10-08 17:40:34 +08:00
kamiyadm b61acf227e refactor: improve class RepoCache
* Rename structure cacheRef to CacheRef.
* Call writeToDisk after addLayerItem and deleteLayerItem.
* Clear variable gErr before use it.

Log:
2024-10-08 17:40:34 +08:00
kamiyadm 1b5c741e7d feat: implement rebuildCache in repo_cache.cpp
-

Log:
2024-10-08 17:40:34 +08:00
kamiyadm df449dc704 feat: overload loadJSONFile with other type
Support std::filesystem and GFile.

Log:
2024-10-08 17:40:34 +08:00
ComixHe 287606321f refactor: change repoCache
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-10-08 17:40:34 +08:00
ComixHe 8b7b347b9a feat: add cache to OSTreeRepo
improve RepoCache methods.

Signed-off-by: ComixHe <heyuming@deepin.org>
2024-10-08 17:40:34 +08:00
kamiyadm e0d8ac49dc feat: add class RepoCache
This class will be a member of OSTreeRepo.

Log:
2024-10-08 17:40:34 +08:00
ComixHe 7689c505f7 feat: changing the api 'RepositoryCacheLayersItem'
Booking the commit hash of base and runtime in object which depends by
current item.

Adding these properties for the 'minified' feature of UAB

Signed-off-by: ComixHe <heyuming@deepin.org>
2024-10-08 17:40:34 +08:00
ComixHe 51065863af refactor!: use command to operate configuration of builder and cli
1. We shouldn't operate repository of ll-build mannually by editing
configuration file.
2. Deprecate command 'll-cli repo modify' due to functional confusion of this command.

ll-cli use below commands to operate repository:
  - ll-cli repo add NAME URL
  - ll-cli repo remove NAME
  - ll-cli repo update NAME URL
  - ll-cli repo set-default NAME

ll-builder use below commands to operate repository:
  - ll-builder repo add --name=NAME --url=URL
  - ll-builder repo remove --name=NAME
  - ll-builder repo update --name=NAME --url=URL
  - ll-builder repo set-default --name=NAME

Signed-off-by: ComixHe <heyuming@deepin.org>
2024-10-08 17:40:34 +08:00
dengbo11 cdf0142e18 refactor(package_manager): change packeage kind type judgment
Move kind type judgment to pullDependency.

Log: packeage kind type judgment is inaccurate
2024-09-27 17:20:29 +08:00
dengbo11 a67fc09633 fix(package_manager): adjust update task context status
Should update task context to installing status before pull runtime or
base.

Log: fix update task context status abnormal
2024-09-27 17:20:29 +08:00
myml b24ab2b6b2 fix: an exception will occur when the LINGLONG_DEBUG does not set
如果环境变量未设置std::getenv会返回空指针, std::string接收空指针会异常

Log:
2024-09-27 16:51:27 +08:00
myml 2fd118814d chore: clean build dependencies
添加libcurl的依赖, 清理不再需要的构建依赖

Log:
2024-09-26 19:09:16 +08:00
myml 5b98130d57 feat: add task queue to package manager
为package manager添加任务队列功能, 避免函数被同时多次调用时
搜索应用的接口改为异步返回结果, 避免dbus超时
2024-09-26 19:09:16 +08:00
myml 773f34d607 refactor: use libcurl to replace QT NetworkManager
为简化程序依赖, 使用openapi generator生成新的http api相关代码
使用libcurl的替换现有的QT NetworkManager
2024-09-26 19:09:16 +08:00
dengbo11 fca5580ecb feat: optimization reference export
Only export specified directorys, prevent files installed by applications from affecting the operation of the host system.
specified directorys reference: 79abc960a6/app/flatpak-builtins-build-finish.c (L233)

Log: linglong export reference optimization
2024-09-26 18:58:22 +08:00
dengbo11 3c3ffc8272 chore: code clean
Project configuration file optimization.

Log:
2024-09-26 15:12:47 +08:00
myml a0427e94f9 feat: Do not base64 encode container id when debugging
在加了LINGLONG_DEBUG环境变量时, 不再使用base64编码容器ID, 避免调试困难

Log:
2024-09-25 17:38:14 +08:00
myml c3e9d2d99b feat: skip the check when kind is runtime
目前的检查脚本未对runtime做适配, 在构建runtime时会报错
kind等于runtime时先跳过检查, 未来可能会为runtime添加对应的检查脚本

Log:
2024-09-19 13:53:21 +08:00
myml 51bd8eb26d fix: remove duplicate task delete operations
任务队列会自动删除运行完毕的任务, 不在需要在每个任务清理自己
修复安装layer和uab报错的问题

Log:
2024-09-18 14:00:30 +08:00
kamiyadm a0d6e7bcb6 feat: add some serialization func to reference
-

Log:
2024-09-11 18:00:06 +08:00
myml 52bdce97dc fix: using queues to control install order
有用户反馈安装应用时会阻塞搜索命令的使用, 对此进行了排查
发现为修复同时执行多个安装任务导致manager异常退出的问题
在下载文件时使用g_main_context_new切换事件循环, 这会导致dbus服务无法处理调用, 同时也会导致下载进度无法通过dbus信号发出
本次改动去掉了g_main_context_new, 并通过队列控制同时只执行一个安装/更新任务
顺便修复因ostree_async_progress重用导致下载runtime不显示进度的问题
2024-09-11 17:59:54 +08:00
dengbo11 50a1b0c55e fix: failed to pull runtime or base
Only need to download if base or runtime does not exist locally.

Log: fixed runtime or base can not pull normally
2024-09-10 09:51:04 +08:00
dengbo11 126c1e5458 fix: failed to install runtime or base layer
Only need to pull dependencies when installing app, but not when installing runtime or base.

Log: fixed runtime or base layer can not install normally
2024-09-06 13:07:49 +08:00
dengbo11 71caecb838 chore: adujust include guards
Use #pragma once to replace #ifndef
reference https://includeguardian.io/article/pragma-once-vs-ifndef.

Log: use #pragma once to guard include
2024-09-05 14:55:38 +08:00
dengbo11 c16988d30f fix: ll-builder failed to extract layer
ll-builder extract do not need constructing an build instance,
it is a static function, calling directly.

Log: fix ll-builder extract can not use normally
2024-09-03 18:01:56 +08:00
ComixHe b34bf88cbb fix(uab): build failed below GCC 12
The std::hash specialization for std::filesystem::path has only been
added as resolution of LWG issue 3657 into the standard draft.

This issue has been fixed in GCC 12:
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=e3c5e8360b4e4799e1e2daf74282629248690f23.

So use std::unordered_set<std::string> instead of
std::unordered_set<std::filesystem::path> for compatibility with lower version of GCC.

Signed-off-by: ComixHe <heyuming@deepin.org>
2024-08-30 15:09:30 +08:00
dengbo11 bf27abe33b chore: delete appimage convert feature from ll-builder
delete appimage convert feature from ll-builder
and move it to linglong-pica

Log:
2024-08-28 13:54:32 +08:00
ComixHe ef7dfb9467 feat: add storage API
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-08-27 14:51:40 +08:00
kamiyadm 893f2ba96b fix(ll-builder): failed to generate desktop file
* Return error when execute app-conf-generator failed.
* Do not parse full line of Exec, just insert string after Exec=.

issue: https://github.com/linuxdeepin/developer-center/issues/10419

Log:
2024-08-23 16:06:39 +08:00
bluesky 9c3192b2b6 feat: copy linglong.yaml to output
ll-builder 构建出来的玲珑应用没有拷贝出 linglong.yaml,不方便后续应用维护以及复现打包过程。

Log: copy linglong.yaml
2024-08-22 15:01:56 +08:00
kamiyadm cb35f6d5f3 fix(ll-cli): nothing changed if repo modify without '--name'
If '--name' is not set, use the default name.
issue: https://github.com/linuxdeepin/developer-center/issues/10235

Log:
2024-08-22 13:25:27 +08:00
ComixHe b04e73bdc6 fix: improve `ll-cli ps` output
Issue: https://github.com/linuxdeepin/developer-center/issues/10430

Signed-off-by: ComixHe <heyuming@deepin.org>
2024-08-20 17:53:49 +08:00
ComixHe 29318500c1 refactor: uab filtering rules
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-08-19 16:30:01 +08:00
myml efc122c4f7 feat: support loong64 arch
支持龙芯新世界架构

Log:
2024-08-19 15:42:43 +08:00
ComixHe 0ab4666766 refactor: create hard link instead of copying files during exporting
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-08-16 14:28:05 +08:00
kamiyadm 8bcbee5e65 fix: SIGBRT when installing two apps
ostree_repo_pull() will iterate the thread default main context,
We new a new context before call ostree_repo_pull().

Log:
2024-08-09 22:25:15 +08:00
ComixHe e2a3811e0f fix: add validation method for layerDir
if there has a minified.json in layer directory, this layer directory wouldn't be
removed after uninstalling it.

add a validation method to verify a layer is already installed or not.

Signed-off-by: ComixHe <heyuming@deepin.org>
2024-08-09 18:28:08 +08:00
ComixHe c4794d89df fix(ll-box): use /proc/<pid>/stat to find the target pid
add a fallback for compatible with linux kernel which compiled with CONFIG_PROC_CHILDREN=false

Signed-off-by: ComixHe <heyuming@deepin.org>
2024-08-09 17:49:44 +08:00
myml c341161e12 fix: regex matching issue in the install list file
修复因字符串替换导致正则匹配错误

Log:
2024-08-08 17:27:52 +08:00
ComixHe 8746e3a890 fix: package manager crashed
std::vector is a `Sequence containers`, references obtained from
emplace_back will be dangling reference after incresing the capacity
of this container.

Signed-off-by: ComixHe <heyuming@deepin.org>
2024-08-08 17:18:36 +08:00
ComixHe 5a4eb3cc12 feat: support for trimming unneeded dynamic libraries
Adjustments to subref-related implementations

Signed-off-by: ComixHe <heyuming@deepin.org>
2024-08-08 15:00:28 +08:00
kamiyadm 22e0790a1d fix: automatic updates will break the base env
* Updates to base and runtime need to be separated
  from applications. Temporarily handle this in the
  automatic update script.
* installedAppFuzzyRef should parse from paras->package.
Log:
2024-08-06 06:27:36 -05:00
kamiyadm 766eebef4a fix: app exists after the installation job canceled
We should recheck the task status after pullDependency() in package manager.

Log:
2024-08-06 06:16:50 -05:00
謝致邦 (XIE Zhibang) 6266b00f65 printer.cpp: Optimize the code 2024-08-05 13:17:05 +08:00
謝致邦 (XIE Zhibang) 5b9a3c267d cli_test.cpp: Add unit tests for subwstr function 2024-08-05 13:17:05 +08:00
謝致邦 (XIE Zhibang) d8f6f58206 Fix the Chinese display problem of ll-cli search 2024-08-05 13:17:05 +08:00
myml eaa0eb69fd feat: Check if the app ID conforms to the rules
通过正则检查app id是否符合倒置域名规范

Log:
2024-08-02 13:07:00 +08:00
ComixHe eb21723f5c refactor: inject checkers into the end of build script
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-08-01 17:46:34 +08:00
myml 263b86b3f7 fix: Correct application's systemd service functionality
由于systemd/user是软链接, 安装应用时未在全局entries目录创建软链接
导致应用的systemd服务无法正常工作

Log:
2024-07-29 10:19:40 +08:00
myml 4c4ffc6eb7 feat: Maintain consistent block size for erofs
loongarch64默认使用(16384)2^14, 在x86和arm64不受支持, 会导致无法推包

Log:
2024-07-26 17:44:41 +08:00
ComixHe 976a511980 fix: use object after move it
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-07-24 17:22:32 +08:00
dengbo 1e7e69beb0 fix: app will run error when install other app with same runtime and
base

if runtime or base already exists in local, we don't need to pull again

Log:
2024-07-24 17:01:54 +08:00
ComixHe b6be9306ed fix: always report the maximum progress
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-07-23 17:33:36 +08:00
myml f86bf0ad96 feat: Use symbolic links to mount variable system files
使用软链接挂载可变的系统文件,可避免容器不更新重建的系统文件

Log:
2024-07-22 17:10:29 +08:00
dengbo d1d2286729 fix: ll-cli run will error when layer installed
1. runtime and base should be installed when install layer
2. if app(layer) already installed, should prompt error

Log:
2024-07-22 13:04:10 +08:00
myml 9ef46f8ce7 fix: Error when running ldconfig
ldconfig会在生成缓存内容后,移动临时文件到缓存文件,所以不应该将临时文件做成挂载点
现在将缓存文件做成软链接, 软链接指向可读写的位置,可避免 /etc 只读的情况

Log:
2024-07-22 11:31:13 +08:00
kamiyadm b1bef2138b fix: failed to execute 'll-cli enter'
Remove '&' from exec() in ll-box. We add it in ll-cli.
issue: https://github.com/linuxdeepin/developer-center/issues/9445

Log:
2024-07-19 13:42:24 +08:00
bluesky a2937ea359 feat: add ll-session-helper monitor listening service
通过 ll-session-helper 服务,来监听宿主机上 /etc/resolv.conf ,/etc/localtime等文件的变化。
设置开机自启

Issue: https://github.com/linuxdeepin/developer-center/issues/8989
Log: add ll-session-helper service
2024-07-11 15:54:02 +08:00
kamiyadm 5ecf1636b1 fix: ll-builder push failed because of timeout
Set interval to 10*60*1000 (10 min), default is 5 sec.

Log:
2024-07-11 15:49:36 +08:00
kamiyadm 7fef56116e fix: gErr should be initialized in the lambda func
-

Log:
2024-07-11 14:14:58 +08:00
kamiyadm eaaea5172e fix: install wrong app after ll-cli install
We should check the id which from FuzzySeach_200_response.
fix https://github.com/linuxdeepin/developer-center/issues/9645.

Log:
2024-07-11 14:14:58 +08:00
dengbo 7f722a87f8 fix: ll-cli upgrade error when assign version
we should parse installed ref according to the package.id rather than
package

Log:
2024-07-10 17:52:55 +08:00
ComixHe 5869207178 refactor: improve downloading progress
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-07-10 15:36:28 +08:00
black-desk ff8360cfde build(builder): change uab elfs install dest
Signed-off-by: black-desk <me@black-desk.cn>
2024-07-09 16:20:47 +08:00
black-desk 696b2f7ffc feat(builder): add modules in linglong.yaml
Signed-off-by: black-desk <me@black-desk.cn>
2024-07-09 16:20:47 +08:00
black-desk 3c2e9b1bdc refact(builder): clean warnings
Signed-off-by: black-desk <me@black-desk.cn>
2024-07-09 16:20:47 +08:00
black-desk 0edd8c1f84 refact(runtime): clean warnings
Signed-off-by: black-desk <me@black-desk.cn>
2024-07-09 16:20:47 +08:00
black-desk 26ad42cd43 refact(cli): clean warnings
Signed-off-by: black-desk <me@black-desk.cn>
2024-07-09 16:20:47 +08:00
black-desk c6986c0e7b feat(repo): support module
Signed-off-by: black-desk <me@black-desk.cn>
2024-07-09 16:20:47 +08:00
black-desk deaff79d75 refact(repo): use getLayerDir
Signed-off-by: black-desk <me@black-desk.cn>
2024-07-09 16:20:47 +08:00
black-desk fc8bd1afa9 refact(repo): clean (un)exportReference
Signed-off-by: black-desk <me@black-desk.cn>
2024-07-09 16:20:47 +08:00
myml 1444fad8a0 feat: Optimize build progress display
优化构建应用的进度展示效果

Log:
2024-07-09 10:56:29 +08:00
ComixHe 55568c368f fix: abort transaction during importing directory to ostree unexpectedly
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-07-08 09:36:29 +08:00
ComixHe 0e77738d59 fix: check if the ref exists in the local repo before deleting it
currently, ostree_repo_set_ref_immediate will ignore error 'ENOENT'
when unlinking ref using unlinkat and doesn't report any errors.

so we should resolve ref locally before deleting it.

Signed-off-by: ComixHe <heyuming@deepin.org>
2024-07-05 14:39:28 +08:00
ComixHe 73c1beea83 feat: recheck minified layer after uninstalling or installing layer
support for looking up minified depends in `run` process

Signed-off-by: ComixHe <heyuming@deepin.org>
2024-07-02 11:54:04 +08:00
ComixHe fd30959180 fix(uab-header): correct the args passed to ll-cli
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-07-02 11:53:29 +08:00
ComixHe c7899de671 fix: check validation before using fuzzyRef
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-07-01 17:55:38 +08:00
ComixHe 68e54a17a4 fix: extend the lifetime by copying the captured QDbusUnixFileDescriptor to the lambda
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-07-01 15:46:29 +08:00
kamiyadm c6e0a6d365 fix: failed to run app after ll-cli reviced SIGINT
* If the errno which returns from ::wait in ll-cli
  is EINTR, wait child more times. And if interrupt
  by SIGINT one more time, kill child immediately.
* If the pid which in container json  is not exists,
  remove the json.

Log:
2024-07-01 14:32:49 +08:00
myml f8cf372825 feat: Add static suffix to statically linked binaries
lintian检查要求静态链接的二进制, 文件名需要添加-static

Log:
2024-07-01 11:47:32 +08:00
myml c7e1f8a1a6 feat: Do not prune when deleting refs
prune本身执行比较耗时, 会影响各种操作的速度
在后续挑选合适的时机进行prune

Log:
2024-06-28 13:48:09 +08:00
myml 32b4ff67e9 fix: Canceling a task causes the package manager to crash.
在安装应用时按ctrl+c结束进程, package-manage 会异常退出

Log:
2024-06-27 18:12:48 +08:00
ComixHe 39fa33500c fix: remove task after installation
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-06-27 16:38:24 +08:00
ComixHe 91b10482cf fix: compilation errors under Qt 5.11
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-06-27 16:38:24 +08:00
dengbo f1c924a48b fix: ll-cli install return error errcode
ll-cli install(upgrade) should return errcode according to lastStatus

Log:
2024-06-27 15:35:45 +08:00
ComixHe 252bc523fb fix: correct mkfs.erofs args
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-06-27 14:31:22 +08:00
ComixHe b4e3b2f826 refactor: install layer file asynchronously
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-06-27 13:56:31 +08:00
ComixHe efbe93fefe feat: support for installing from uab
linglong doesn't have a completed mechanism of minifying dependencies yet,
it will be implemented later

Signed-off-by: ComixHe <heyuming@deepin.org>
2024-06-27 13:56:31 +08:00
kamiyadm 3d026001bf fix: ll-cli abort after construct OSTreeRepo
-

Log:
2024-06-27 13:12:02 +08:00
dengbo 87076c5ac7 fix: container env error when environment variables have multiple values
quote the values environment variables to avoid loading errors when some
environment variables have multiple values, such as A=a;b

Log:
2024-06-27 10:25:02 +08:00
kamiyadm 9efeb5b0cd fix: always use config.yaml to init ostree repo
fix https://github.com/linuxdeepin/developer-center/issues/9416.

Log:
2024-06-27 10:00:53 +08:00
ComixHe 95ac7e9525 refactor: InstallTask
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-06-26 13:51:22 +08:00
ComixHe 3d1d04ada6 feat: beginning support for installing from uab file
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-06-24 11:01:29 +08:00
ComixHe 5f8fccdef2 feat: ignore minified files when exporting layer and uab
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-06-24 11:01:29 +08:00
ComixHe e4acf15319 feat: add 'MinifiedInfo' to api
extending the concept of LayerDir

Signed-off-by: ComixHe <heyuming@deepin.org>
2024-06-21 17:53:28 +08:00
dengbo 6a0e8b039f fix: failed to package linglong in uos1071
std::filesystem can not been declared in uos, so we need to add filesystem header

Log:
2024-06-21 17:06:14 +08:00
ComixHe a42c4dc9f1 refactor: cli command 'install'
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-06-21 13:40:00 +08:00
dengbo 1fe1c100a7 fix: layer size error when export layer repeatedly
if layer file exist, we must remove it before export it, or layer will overlay

Log:
2024-06-20 16:17:36 +08:00
kamiyadm 9eabcb2105 fix: missed some env during ll-builer build
We should append the process.env which from Container::run to
the origin container config.

Log:
2024-06-20 16:04:49 +08:00
kamiyadm 2d2a54cf49 fix: missed some env variables when reusing container
* Save env variables to /run/user/1000/linglong/containerId/00env.sh
  and mount it to /etc/profile.d/00env.sh in container.
* Remove 'bash --login -c' from exec() of ll-box, we
  add it before .

Log:
2024-06-20 14:26:11 +08:00
ComixHe 88a047660f fix: include unistd.h directly in uab_packager.cpp
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-06-20 11:29:19 +08:00
kamiyadm ddea8b0667 refactor: add 25-host-env to generate env variables
Add new generator 25-host-env and use it.

Log:
2024-06-20 10:52:46 +08:00
myml 0865484023 fix: builder did not exit when the build script failed
构建出错时, 玲珑没有返回错误

Log:
2024-06-19 16:50:16 +08:00
ComixHe 1326fb0c0e feat: support export uab file
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-06-19 16:08:11 +08:00
myml c2d00d62e6 feat: Use scripts to download sources instead
file和archive类型的source也改用脚本处理

Log:
2024-06-17 21:18:41 +08:00
ComixHe 8d099eeda3 refactor: split target linglong::linglong into four parts
- linglong::linglong
 - linglong::utils
 - linglong::api
 - linglong::dbus-api

Signed-off-by: ComixHe <heyuming@deepin.org>
2024-06-17 11:04:45 +08:00
kamiyadm 7e1aa4a534 refactor: using 'binary' as one of the module
* Add ostreeSpecFromReferenceV2() which return
   a string with the 'binary' module.
* Add getLayerQDirV2() which use ostreeSpecFromReferenceV2()
* Always use 'binary' first and fallback to 'runtime'

Log:
2024-06-17 10:12:02 +08:00
myml bf9d84deb3 fix: dangling pointer issue by retaining shared_ptr
修复因未保活智能指针导致指针悬空的问题

Log:
2024-06-14 15:05:07 +08:00
myml bf8489cfc9 feat: Create dedicated client for HTTP requests
使用单独的client发送http请求, 避免请求结果混淆

Log:
2024-06-14 09:42:52 +08:00
kamiyadm 76c9989012 chore: add const to ref in Update() and print ref value
-

Log:
2024-06-13 17:23:38 +08:00
myml 80d3b53e0a feat: does not use temporary repository when pulling
ostree拉取数据时不再使用临时仓库, 这样在网络中断后可以续传

Log:
2024-06-13 10:37:43 +08:00
kamiyadm 6bb16ef955 fix: should not modify automatically generated code
Change schema_version to schemaVersion back.

Log:
2024-06-12 17:14:15 +08:00
kamiyadm 72c0a4e525 refactor: add PackageInfoV2 and use it
* The difference between PackageInfo and PackageInfoV2:
   PackageInfo    PackageInfoV2
   appid          -
   -              id
   -              infoVersion
* We use PackageInfoV2 now and PackageInfo will
  be converted to PackageInfoV2.

Log:
2024-06-07 13:09:25 +08:00
myml dd8f95fb0c fix: builder log redirection losing error message
日志重定向会导致应用检测到非tty环境, 关闭stderr日志输出
builder强制开启非tty环境的终端日志输出

Log:
2024-06-07 11:24:37 +08:00
ComixHe edfbb6626c feat: add uab-header
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-06-07 11:09:15 +08:00
ComixHe 15fe4dd236 feat: add UABMetaInfo to api
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-06-07 09:41:12 +08:00
myml a2c66394e9 fix: builder did not exit when the build script failed
修复构建出错时, 玲珑没有正常的退出

Log:
2024-06-06 16:03:24 +08:00
kamiyadm 555d0b595f fix: no package exist after update failed
close: https://github.com/linuxdeepin/linglong/issues/470

Log:
2024-06-05 10:41:14 +08:00
kamiyadm 6bc6d3eff6 fix: remove extra dir after uninstall
close: https://github.com/linuxdeepin/linglong/issues/462

Log:
2024-06-05 10:41:14 +08:00
myml eb40e28ccd feat: add offline parameter to ll-builder run
ll-builder run添加offline参数,便于测试本地的Runtime

Log:
2024-05-31 11:25:06 +08:00
kamiyadm f89ad0adaf fix: the exported file has no executable permission
close: https://github.com/linuxdeepin/linglong/issues/458

Log:
2024-05-27 16:48:48 +08:00
dengbo 2aa0e267df fix: ll-build failed to convert appimage
linglong.yaml must have command and base option when convert

Log:
2024-05-27 16:38:19 +08:00
kamiyadm b4d2273973 fix: print develop module when pulling runtime
-

Log:
2024-05-22 17:57:55 +08:00
ComixHe 83d98b5820 feat: reuse container when application is runnnig
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-05-21 14:24:57 +08:00
kamiyadm f356697726 fix: some app won't exit after recieved SIGTERM
Temprary add '; exit' to the end of bashArgs.

Log:
2024-05-16 16:20:04 +08:00
dengbo 372321bd44 fix: linglong app can not access network
/etc/resolv.conf must be mount to container

Log:
2024-05-16 15:52:46 +08:00
kamiyadm 6fe9b93ac1 refactor: make cacheDir to be the member of SourceFetcher
-

Log:
2024-05-15 13:26:39 +08:00
kamiyadm d0332be2f8 fix: always need to download source
The QFile should be open when caculate the file hash.

Log:
2024-05-15 11:13:14 +08:00
kamiyadm 76be5f9091 fix: lost the catch file
Create a new directory to save cache file intead of use QTemporaryDir.

Log:
2024-05-15 11:13:14 +08:00
kamiyadm 8ad800567d fix: lost source files after fetching
The parent directory should be create first.

Log:
2024-05-15 11:13:14 +08:00
ComixHe 2f9ae75620 fix: add uid and gid to extra exec option and correct commands
Issue: https://github.com/linuxdeepin/developer-center/issues/8580

Signed-off-by: ComixHe <heyuming@deepin.org>
2024-05-14 23:22:19 +08:00
kamiyadm 181b00841d fix: the version of runtime is not fuzzy in info.json
If the version of base or runtime is not set tweak, we should not write the
version with tweak to info.json.

Log:
2024-05-10 14:54:29 +08:00
kamiyadm c895c4d0c2 refactor: update pullDependency and overload it
-

Log:
2024-05-10 14:54:29 +08:00
ComixHe 54dd0f4f0c feat: support copy-symlink
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-05-10 10:45:51 +08:00
kamiyadm 9b8f4e50b8 fix: update the warning message in exportReference()
-

Log:
2024-05-09 17:41:34 +08:00
kamiyadm 1186628649 refactor: move shouldExport() to exportRefrence()
-

Log:
2024-05-09 17:41:34 +08:00
kamiyadm 967378e5d7 fix: some shared info is not update
Desktop database, mime info, glib-2.0/schemas.

Log:
2024-05-09 17:41:34 +08:00
kamiyadm a54b9a8718 fix: some config is not exported when installing layer
-

Log:
2024-05-09 17:41:34 +08:00
black-desk af82dd0424
Revert "fix: add finalizeMounts to delay remount"
This reverts commit 43a6068163.

Signed-off-by: black-desk <me@black-desk.cn>
2024-05-08 10:12:32 +08:00
ComixHe 43a6068163 fix: add finalizeMounts to delay remount
and fix some typo

Issue: https://github.com/linuxdeepin/linglong/issues/398

Signed-off-by: ComixHe <heyuming@deepin.org>
2024-05-07 15:15:59 +08:00
kamiyadm b973e9b646 fix: extract layer failed
If the directory is a mount point, it will be moved failed.
Use cp instead of mv.

Log:
2024-05-07 14:17:00 +08:00
kamiyadm fc9833c685 fix: format the output of ll-builder
-

Log:
2024-05-07 14:17:00 +08:00
kamiyadm 83d10afe36 fix: update fetch-git-repo.sh to fetch-git-repo
Use the correct file name which will be installed.

Log:
2024-05-07 14:17:00 +08:00
ComixHe 7f513e0d21 refact(generators): mount to default location
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-05-06 16:40:16 +08:00
kamiyadm bcfba62c29 fix: ll-cli install foundation or runtime failed
-

Log:
2024-05-06 09:38:54 +08:00
dengbo 6b633f6f8c docs: optimization api doc
add description of api doc

Log:
2024-04-29 17:09:24 +08:00
myml a2a3c90e5c feat: ll-builder support skip run container
builder支持跳过容器运行(构建), 用于只下载源码和依赖的时候使用

Log:
2024-04-29 07:02:48 +00:00
myml 9dff4a96c4 feat: clean up unseless environment variables
清理无用的环境变量

Log:
2024-04-29 11:45:09 +08:00
dengbo 9d488f0368 fix: ll-cli list(search) --type not valid
support ll-cli list(search) --type option

Log:
2024-04-29 10:58:29 +08:00
kamiyadm 63c721b614 feat: support ll-cli content
New subcommand to display the exported files.

Log:
2024-04-28 11:43:33 +08:00
dengbo 7284fd33df chore: file prefix is error
file prefix must be file://

Log:
2024-04-26 17:50:04 +08:00
black-desk d273a45cab fix: check app is valid
check app is valid

Log:
2024-04-26 17:50:04 +08:00
dengbo 778f1226b5 refactor: refactor ll-cli list --app to ll-cli info
refactor ll-cli list --app to ll-cli info

Log:
2024-04-26 17:50:04 +08:00
myml 7821ba2266 fix: build failure on UOS 20
修复在UOS 20系统构建错误

Log:
2024-04-26 13:56:20 +08:00
dengbo 29ee27bb36 feat: ll-cli list support show tier of speciafy app
ll-cli list support show tier of speciafy app

Log:
2024-04-26 12:01:16 +08:00
ComixHe ea3e3ff80c feat: add new envFilter `XDG_DATA_HOME`
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-04-26 10:35:31 +08:00
black-desk 6328cc8e9d fix(ll-box): exit with -1 when init don't return 0
Signed-off-by: black-desk <me@black-desk.cn>
2024-04-25 13:18:31 +08:00
dengbo ba7ed87ad7 fix: fix v20 package
1. linglong-bin must be first in debian control, it will influence
   debian sysctl.d/linglong.conf install
2. Quuid must include in head

Log:
2024-04-25 13:08:43 +08:00
kamiyadm 2728b0f3bb fix: ll-builder run failed
The default module of org.deepin.foundation should be runtime.

Log:
2024-04-23 16:43:57 +08:00
black-desk 14a06b2626
refact: archieve linglong runtime dir instead of leave it alone
Signed-off-by: black-desk <me@black-desk.cn>
2024-04-23 15:43:55 +08:00
ComixHe 5ec46ecc63 fix: ignore broken symlink while iterating files
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-04-23 15:39:24 +08:00
kamiyadm 74c0480a7a fix: install layer or export layer failed
Use /tmp/linglong-layer-$uuid instead of /tmp/linglong-layer/$uuid.
Because ll-package-manager and ll-builder owned by diffrent user,
if one of them creates the parent dir 'linglong-layer', another one
has no permisson to open it.

Log:
2024-04-23 14:35:40 +08:00
kamiyadm 1c5ec42068 fix: rename 'll-cli repo list' to 'll-cli repo show'
-

Log:
2024-04-23 14:35:40 +08:00
black-desk 570a0d562a chore: enable info logging and deprecate builder -v
Signed-off-by: black-desk <me@black-desk.cn>
2024-04-22 13:44:07 +08:00
ComixHe f262b8d2ae fix: add LINGLONG_APPID env before running container
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-04-19 14:02:34 +08:00
black-desk 44426d5e37 chore: refine log level
Signed-off-by: black-desk <me@black-desk.cn>
2024-04-19 10:42:30 +08:00
black-desk 0b95337343
chore(ocppi): return full command if failed
Signed-off-by: black-desk <me@black-desk.cn>
2024-04-18 20:48:01 +08:00
dengbo 9521c0a207 fix: ll-cli info show error
pack should use LayerInfo instead of PackageInfo

Log:
2024-04-18 17:57:30 +08:00
dengbo 53702a996b fix: failed to install linglong layer file use ll-cli
1. if is linglong layer file, install it directly.
2. LayerFile has offset a magicNumber size(40) in Constructor, so we do not need to skip magicNumber before read meta info length.

Log:
2024-04-18 15:25:28 +08:00
dengbo 76afa0e3e0 fix: umount error dir in LayerPackager destruct
umount error dir in LayerPackager destruct

Log:
2024-04-18 13:17:43 +08:00
black-desk bbda931b9b feat: allow set the oci runtime via env variable
1. Introduce LINGLONG_DEFAULT_OCI_RUNTIME cmake option to set the
   default oci runtime cli used by linglong;
2. Allow override oci runtime by set env variable LINGLONG_OCI_RUNTIME.

Signed-off-by: black-desk <me@black-desk.cn>
2024-04-18 11:11:56 +08:00
ComixHe 7cca859463 fix: add `copy-symlink` option for symlink source
crun use `copy-symlink` instead of `nosymfollow`

Signed-off-by: ComixHe <heyuming@deepin.org>
2024-04-18 10:33:54 +08:00
black-desk 36c9d35800 build: backport to UOS v20
1. vendor more dependencies
   - docopt.cpp
   - tl-expected
2. make ocppi subproject
3. upgrade PFL.cmake

Signed-off-by: black-desk <me@black-desk.cn>
2024-04-17 20:55:14 +08:00