jwiegley / use-package

A use-package declaration for simplifying your .emacs
https://jwiegley.github.io/use-package
GNU General Public License v3.0
4.42k stars 260 forks source link

Some warnings triggered by auto-package-update. #891

Closed hongyi-zhao closed 2 years ago

hongyi-zhao commented 3 years ago

According to the guide given here, I use the following settings in my ~/.emcas.d/init.el:

;;Enable use-package-always-ensure if you wish this behavior to be global for all packages:
(require 'use-package-ensure)
(setq use-package-always-ensure t)

;;NOTE: :ensure will install a package if it is not already installed, but it does not keep it up-to-date. 
;;If you want to keep your packages updated automatically, one option is to use auto-package-update, like
(use-package auto-package-update
  :config
  (setq auto-package-update-delete-old-versions t)
  (setq auto-package-update-hide-results t)
  (auto-package-update-maybe))

But when I start emacs, I meet there are some warning have been triggered by the above settings as shown below:

Leaving directory ‘/home/werner/.emacs.d/elpa/auto-package-update-20200826.2227’

Compiling file /home/werner/.emacs.d/elpa/auto-package-update-20200826.2227/auto-package-update.el at Mon Dec 14 10:23:10 2020
Entering directory ‘/home/werner/.emacs.d/elpa/auto-package-update-20200826.2227/’

Compiling internal form(s) at Mon Dec 14 10:23:24 2020
Warning (bytecomp): reference to free variable ‘apu--package-installation-results’
Warning (bytecomp): assignment to free variable ‘apu--package-installation-results’
Warning (bytecomp): reference to free variable ‘quelpa-cache’
Warning (bytecomp): the function ‘quelpa-read-cache’ is not known to be defined.

Are they harm?

Regards, HY

conao3 commented 3 years ago

reference to free variable ‘quelpa-cache’ warning message is on my mind. please try again clean init.el and please tell use whole repro step?

hongyi-zhao commented 3 years ago

please try again clean init.el and please tell use whole repro step?

Not quite sure what you expect me to do. Sorry for my poor English comprehension ability.

conao3 commented 3 years ago

No, I'm sorry. My English is usually broken, but I think it's better. But this time it's especially terrible.

Anyway, all I want is to please tell us to reproduce steps on your issue more clearly.

Sample, I tried,

  1. save below snippet as ~/.debug.emacs.d/use-package-auto-package-update/init.el
    
    ;;; init.el --- Sample clean init.el  -*- lexical-binding: t; -*-

;; ~/.debug.emacs.d/use-package-auto-package-update/init.el

;; you can run like 'emacs -q -l ~/.debug.emacs.d/use-package-auto-package-update/init.el' (eval-and-compile (setq user-emacs-directory (expand-file-name (file-name-directory (or load-file-name byte-compile-current-file buffer-file-name)))))

;;;; use-package bootstrap code; https://github.com/jwiegley/use-package#package-installation

;; ;; This is only needed once, near the top of the file ;; (eval-when-compile ;; ;; Following line is not needed if use-package.el is in ~/.emacs.d ;; (add-to-list 'load-path "") ;; (require 'use-package))

(eval-and-compile ; install use-pacakge and initialize package.el in compiler time (custom-set-variables '(package-archives '(("org" . "https://orgmode.org/elpa/") ("melpa" . "https://melpa.org/packages/") ("gnu" . "https://elpa.gnu.org/packages/")))) (package-initialize) (unless (package-installed-p 'use-package) (package-refresh-contents) (package-install 'use-package)))

;;;; https://github.com/jwiegley/use-package#package-installation

;; Enable use-package-always-ensure if you wish this behavior to ;; be global for all packages: (require 'use-package-ensure) (setq use-package-always-ensure t)

;; NOTE: :ensure will install a package if it is not already ;; installed, but it does not keep it up-to-date. If you want to ;; keep your packages updated automatically, one option is to use ;; auto-package-update, like (use-package auto-package-update :config (setq auto-package-update-delete-old-versions t) (setq auto-package-update-hide-results t) (auto-package-update-maybe))

(use-package company) (use-package evil) (use-package adaptive-wrap) ;; ...


2. invoke emacs via `emacs -q -l ~/.debug.emacs.d/use-package-auto-package-update/init.el`
3. the Emacs works well.
hongyi-zhao commented 3 years ago

Thanks a lot for your clarification. I'll try and feedback necessary questions.

BTW, why do you still want to create yet another Emacs package manager considering that there are already so much popular wheels in this field?

conao3 commented 3 years ago

Just interest. the another Emacs package manager is my first Emacs-lisp project.

hongyi-zhao commented 3 years ago

I tried exactly according to your instructions with your above code and Emacs works well. But it will be better if we use a list to store the packages list instead of invoking use-package command line-by-line for each package.

skangas commented 2 years ago

It seems like everything was resolved here, so I'm closing this issue. If that understanding is wrong, please report back and we can consider reopening. Thanks.