Comments (6)
I guess falling back to system library makes sense.
Perhaps std::env::current_exe
can be wrapped with something like realpath
in case it was executed from a symbolic link 🤔
e.g.:
~/.local
├─bin
│ └─maa -> ../stow/maa_cli-0.0.0/bin/maa
└─stow
└─maa_cli-0.0.0
└─bin
└─maa
resource should also be in .local/stow/maa_cli-0.1.2
, not somewhere outside.
from maa-cli.
std::env::current_exe
has platform-specific behavior, which make it worse to just find lib and resource in current_exe's parent directory, when users make a symbol link from maa.exe
to their Desktop or Startup Menu or so.
from maa-cli.
std::env::current_exe
has platform-specific behavior, which make it worse to just find lib and resource in current_exe's parent directory, when users make a symbol link frommaa.exe
to their Desktop or Startup Menu or so.
The main reason we are currently searching for the lib
and resource
directories in the parent directory of current_exe
is to accommodate users who may have installed CLI in various locations, such as ~/.local/bin
. While this approach isn't ideal, it was chosen for its flexibility and as a fallback option.
However, when it comes to package managers, locating the lib
and resource
directories becomes much simpler. One potential solution is to introduce a compile time environment variable of lib
and resource
path for the package manager. This could potentially present challenges for prebuilt packages, such as Homebrew on Linux, where users have the flexibility to install packages in non-default locations, including within their home directories.
It's worth noting that the necessity for relocatability may vary among different package managers. If other package managers do not require it, this solution could be viable, since installing in non-default locations is discouraged by Homebrew.
Search
MaaCore.so
inLD_LIBRARY_PATH
will be greater.
I believe it's a good idea and aligns with the default behaviour of dlopen. I'll delve into this further to explore its feasibility.
from maa-cli.
I just add support for search LD_LIBRARY_PATH
.
I'm interested in hearing your opinions about the environment variables. @Cryolitia, what are your thoughts on this? And @horror-proton, I'd also like to hear your perspective.
from maa-cli.
With the resolution of the current_exe
issue and the support for searching system libraries, I believe there is no need for additional environment variables. Consequently, I close this issue as completed. Feel free to reopen it if you think it was not resolved.
from maa-cli.
That's great!
with commit 32c0857 , there's also no need for resource_dir
.
Thanks for your hard work.
from maa-cli.
Related Issues (20)
- Typo found: "Up to data" HOT 1
- 无法在任务中配置当期SS活动关卡名进行作战 HOT 9
- [feature request] 日志输出内容的改进/任务总结报表
- 对于大陆地区用户,可以将默认资源更新上游仓库设置为`git.maa-org.net` HOT 6
- 在运行前打印活动内容 HOT 2
- Arch Linux packaging issue HOT 9
- feat: 在任务执行失败时让maa-cli以非0值退出
- Aur中的maa-cli包未启用core_installer特性 HOT 2
- Check `config::task::condition::tests::active::time` fails at midnight HOT 1
- 在macos下 maa-cli 启动的游戏无法正常代理作战 HOT 3
- 关于编写tasks脚本时condition中Weekday获取时间的问题 HOT 2
- Linux系统下的默认connection config有误 HOT 1
- 热更新资源镜像维护 HOT 1
- 生息演算功能错误 HOT 7
- 运行时出现神秘日志 HOT 3
- 可以添加musl的静态编译版本吗? HOT 3
- Error when running "maa hot-update": No such file or directory (os error 2) HOT 2
- bug: list with two elements are parsed as `Input`
- Roadmap
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from maa-cli.