pallet icon indicating copy to clipboard operation
pallet copied to clipboard

Pallet does not automatically insert packages installed for dependencies

Open sambrightman opened this issue 10 years ago • 4 comments

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.

sambrightman avatar Dec 24 '14 16:12 sambrightman

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.

rdallasgray avatar Dec 27 '14 17:12 rdallasgray

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 avatar Jan 05 '15 11:01 sambrightman

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?

sambrightman avatar Jan 21 '15 08:01 sambrightman

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

rdallasgray avatar Jan 21 '15 09:01 rdallasgray