Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pallet does not automatically insert packages installed for dependencies #38

Open
sambrightman opened this issue Dec 24, 2014 · 4 comments

Comments

@sambrightman
Copy link
Contributor

If a package is installed with dependencies, it is automatically inserted into Cask but the dependencies are not until some point later on (normally after pallet-init but perhaps not after the first one). I can't tell if this is intentional or not or what eventually causes them to be added.

@rdallasgray
Copy link
Owner

pallet-init will always list all installed packages, including dependencies, because it creates the dependency list from package-alist (i.e. via package.el). pallet-init is intended as a means to create a useful Cask file from an existing Emacs install, so you shouldn't really be running it more than once (if at all).

The hook Pallet runs on package-install manually adds a dependency to the Cask bundle, then rewrites the Cask file based on Cask's list of dependencies. I'm not altogether sure how Cask deals with 'sub' dependencies, so it may be that these are initially ignored but added to the list of dependencies later.

The desired behaviour, I guess, is to add only the top-level dependency to the Cask file on a package being installed via package.el.

@sambrightman
Copy link
Contributor Author

I'm using pallet-init as "sync" to try to see if it helps. Normally I would only run it once (if at all).

My current situation, having installed flx-ido (first-level dependency on flx):

sam@wildthing:~$ ls -d .emacs.d/.cask/24.3.1/elpa/flx*
.emacs.d/.cask/24.3.1/elpa/flx-20140921.739  .emacs.d/.cask/24.3.1/elpa/flx-ido-20140821.2033
sam@wildthing:~$ grep flx ~/.emacs.d/Cask
(depends-on "flx-ido")
sam@wildthing:~$

I believe that just after filing this issue I re-ran pallet-init and this did not solve the problem. I've now installed an unrelated package (flx still missing, new package present) and then re-run pallet-init again. Now flx is listed.

I'm not really sure what the current expected behaviour is but it seems inconsistent/buggy. Am I wrong to expect flx to be there? I agree that top-level-only could be desirable in future (to stop stale dependencies persisting to new installs).

@sambrightman
Copy link
Contributor Author

I agree that the normal way of running things would be to run pallet-init once and then never add lower-level dependencies after that. However, this does still mean that the initial setup can be overly broad (well, more like overly deep).

I'm currently testing a change which will only pallet-init packages that are not dependencies of other packages. Additionally, there is a second, heuristic part that can still include packages which appear to be manually installed. This gives me quite a clean pallet-init with only a couple of packages which I'd want to be listed/unlisted differently instead of a dozen. Ignored packages are always installed via dependencies anyway, even if they are not listed in the Cask file by pallet-init - so completeness should not be sacrificed.

Would you be open to such functionality, for example via pallet-init with prefix command?

@rdallasgray
Copy link
Owner

Yes -- in fact, it may be that this should be the default functionality. But starting with pallet-init via prefix command might be best.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants