Setting a relative path causes path resolution problems with dkms and potentially opens up a security issue.
I didn't test if this causes issues with the install, but I tracked this down while debugging why DKMS has been failing to install modules.
Using a leading relative path could potentially lead to unintended consequences if someone were to say send you a tarball with a bin/ls that just rm -fr /.
==> dkms install --no-depmod zenpower3/0.2.0 -k 6.15.9-zen1-1-zen
./bin/dkms: line 194: ./bin/date: No such file or directory
./bin/dkms: line 1462: ./bin/mkdir: No such file or directory
mktemp: failed to create directory via template ‘/var/lib/dkms/zenpower3/0.2.0/6.15.9-zen1-1-zen/.tmp_x86_64_XXXXXX’: No such file or directory
Error! Unable to make temporary directory.
./bin/dkms: line 1464: ./bin/mkdir: No such file or directory
./bin/dkms: line 1465: ./bin/cp: No such file or directory
./bin/dkms: line 1468: ./bin/mkdir: No such file or directory
./bin/dkms: line 1470: ./bin/cp: No such file or directory
./bin/dkms: line 1512: ./bin/cp: No such file or directory
It's by design, though. App development often has a bin/ file inside their tree to run app-specific bins. I think we need to fix the dkms a different way.
Maybe having it as the last entry in PATH would work then? I think it's potentially dangerous to allow arbitrary paths to override system binaries.
We need it to be able to overwrite, say, the system rails or bundle command inside a given app directly. But maybe there's a way to just have the core utils appear first?
Ah yes, I see what we have now is broken. It only uses ./bin if the bin isn't available in mise. Happy to take a PR to correct this via mise. I can't imagine needing this in any non-mise managed projects 👌
If we do it this route, it applies to every directory. The better / safer way to accomplish the same thing is to set this in a mise.toml wherever you keep your projects since Mise inherits all the way up.
For me, I typically have all of my dev projects in ~/Dev so I'd have ~/Dev/mise.toml so it only applies to those project folders.
With that in mind; do we want to apply globally or somehow just provide guidance or tooling to set this for a user based on where they keep their projects? Or third, I suppose is just document it in the manual but that's less fun. 🤣
This will be handled via #1654