cdist may execute the wrong version if executed from a git repository #21
Labels
No Label
bugfix
cleanup
discussion
documentation
doing
done
feature
improvement
packaging
Stale
testing
TODO
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: ungleich-public/cdist#21
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The MR !942 removed the script
bin/cdist
and replaced it withscripts/cdist
. As an effect of this, cdist will import thecdist
module from the system if it exists. It was tried to bypass the system module if it doesn't exist, but it only happens if it doesn't exist in the system path:Where before, the bootstrapping shell script executed the following to guarantee that the checked out worktree will be used:
TL;DR the MR !942 removed the capability to execute cdist in-place of a checked out git repository if cdist is already installed system-wide. I think the old behaviour should be kept to keep cdist portable, even between versions. Because you want to execute the cdist version you checked out in the git repository (where you executed the executeable).
If yes, we need to add/expand the module detection to load from the correct path. I think cdist isn't the only project that have this problem ;-) Else, you need to make it clear for the user that he might executed an other cdist version than he thought.
It's related to the error I'm talked in the chat yesterday (12.11.2020).
ping @ander
mentioned in commit
d30cd5c2b2
mentioned in commit
76aa00b12e
mentioned in merge request !957
mentioned in commit 156d4470130454e86c6a71327056f5d511f6e882
What's about to check if we need to insert this path instead of doing it every time? It's not too big to check if
.git
orMakefile
exists, or pragmatically, check if thecdist/
directory (orcdist/__init__.py
) exists ...cdist may also be installed system-wide. Insert a python path of a system-wide cdist installation like
/usr/bin/..
won't throw an error, but there's no reason to not do a check.@ander What was your real intention with
What if we just do what is in the
expect
body?