doomemacs / doomemacs

An Emacs framework for the stubborn martian hacker
MIT License
19.29k stars 3.04k forks source link

How to use different package-archives address? #73

Closed ashfinal closed 7 years ago

ashfinal commented 7 years ago

I'm using spacemacs now, but I decide to give this repo a try. The default package-archives address is gnu and melpa.

      '(("gnu"   . "https://elpa.gnu.org/packages/")
        ("melpa" . "https://melpa.org/packages/"))

But unfortunately I have problem to visit the two websites. What should I do to use a different address?

hlissner commented 7 years ago

I'm not sure I understand. package-archives is set in core/core-packages.el, you can change that or add something like this in your config:

(setq packages-archives 
      '(("melpa" . "https://melpa.org/packages/")))

Are you getting an error of some sort?

ashfinal commented 7 years ago

I used http instead of https, after several times of make install, finally installed all packages that is needed (and successfully lauched emacs).

It feels really fast! takes only 1-2 sec to boot (while spacemacs takes 10+ sec). But I still need time to figure out how to activate some functionality that I want. I guess a detailed manual will really help. Anyway, thanks for your great repo! :)

hlissner commented 7 years ago

Thanks! I'm glad you like it. If you need any help, feel free to ask. Either here or via email (in my github profile).

Also, could you try running make doctor? If the https urls weren't working then something might be missing on your machine. That will tell you what (hopefully). It's in a recent update, so you may need to git pull

ashfinal commented 7 years ago
.emacs.d [master●] % make doctor 
DOOM doctor
Running Emacs 25.2.1 on darwin
----

+ Couldn’t find GNU tar (you have a different version)
  (MacOS users can install it using homebrew: ‘brew install gnu-tar’)

----
There were issues!

Hopefully these can help you find the problem. If not, run this doctor again with DEBUG=1:

  DEBUG=1 make doctor

And file a bug report with its output at https://github.com/hlissner/.emacs.d/issues

Seems good to me.

hlissner commented 7 years ago

I just updated make doctor with TLS checks for elpa.gnu.org and melpa. Could you run it again and see if you get any errors? (You might need DEBUG=1 for more information)

ashfinal commented 7 years ago

Today I use the default address and successfully install all packages (after long long waiting).
Here is the debug info:

.emacs.d [master●] % make doctor DEBUG=1
DOOM Doctor
Running Emacs v25.2.1
Compiled with:
  RSVG DBUS NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS MODULES
uname -a:
  Darwin iMBP 16.6.0 Darwin Kernel Version 16.6.0: Fri Apr 14 16:21:16
  PDT 2017; root:xnu-3789.60.24~6/RELEASE_X86_64 x86_64

----

Verified elpa.gnu.org
Rejected https://melpa.org/packages/archive-contents
  (gnutls-error #<process melpa.org> -110)

Rejected https://self-signed.badssl.com (a good thing!)
  (error "Certificate validation failed self-signed.badssl.com,
  verification code 142")

Rejected https://wrong.host.badssl.com/ (a good thing!)
  (error "The x509 certificate does not match
  \"wrong.host.badssl.com\"")

====
Have some debug information:

  + Attempt to load DOOM: success! Loaded v2.0.2
    Revision af286043a48b22903ac7471c8a040881b343694f

  + enabled modules:
    +evil                  +jump                  +snippets
    +file-templates        +spellcheck            +syntax-checker
    +version-control       +workspaces            +eval
    +debug                 +company               +ivy
    +doom                  +doom-dashboard        +doom-modeline
    +doom-quit             +hl-todo               +dired
    +electric-indent       +eshell                +gist
    +macos                 +rotate-text           +term
    +tmux                  +upload                +assembly
    +cc                    +crystal               +csharp
    +data                  +emacs-lisp            +go
    +haskell               +java                  +javascript
    +julia                 +latex                 +lua
    +markdown              +org                   +php
    +python                +rest                  +ruby
    +rust                  +scala                 +sh
    +swift                 +typescript            +web
    +email                 +present               +rss
    +twitter               +write                 +hlissner

  + enabled packages:
    ace-link-20170319.553              ace-window-20170421.428
    all-the-icons-20170516.158         all-the-icons-20170516.158
    anaconda-mode-20170405.301         android-mode-20170323.115
    async-20170502.2343                auctex-11.90.2
    auto-compile-20170130.1017         auto-yasnippet-20160925.225
    avy-20170411.608                   centered-window-mode-20170522.2358
    cmake-mode-20160928.505            coffee-mode-20170324.240
    command-log-mode-20160412.2147     company-20170517.1436
    company-anaconda-20160809.705      company-auctex-20161025.24
    company-dict-20160528.53           company-go-20170420.515
    company-inf-ruby-20140805.1354     company-irony-20170515.1608
    company-irony-c-headers-20151018.209 company-lua-20161227.1139
    company-php-20170314.2141          company-quickhelp-20170429.1052
    company-racer-20160722.1658        company-restclient-20151202.401
    company-shell-20170517.2241        company-sourcekit-20170126.353
    company-statistics-20170210.1133   company-tern-20161004.1147
    company-web-20160502.658           counsel-20170518.1425
    counsel-css-20170305.947           counsel-projectile-20170216.1426
    crystal-mode-20170505.324          csharp-mode-20170502.158
    cuda-mode-20151213.1921            dante-20170508.2347
    demangle-mode-20170311.1148        dired-k-20170313.803
    disaster-20170507.1626             dockerfile-mode-20170418.1024
    doom-themes-20170519.759           dumb-jump-20170520.112
    editorconfig-20170518.817          eldoc-eval-20150512.506
    elfeed-20170518.1835               elfeed-org-20170423.128
    emmet-mode-20161113.2158           ensime-20170522.2359
    evil-20170521.1211                 evil-anzu-20170123.2318
    evil-args-20140329.1429            evil-commentary-20170413.751
    evil-easymotion-20170110.2004      evil-embrace-20160519.1129
    evil-escape-20170115.1343          evil-exchange-20170510.1959
    evil-indent-plus-20151109.1106     evil-magit-20161130.847
    evil-matchit-20170119.125          evil-mc-20170523.1902
    evil-multiedit-20170515.337        evil-numbers-20140606.551
    evil-snipe-20170405.1644           evil-surround-20170124.1110
    evil-textobj-anyblock-20161020.1112 evil-vimish-fold-20161103.333
    evil-visualstar-20160222.1648      exec-path-from-shell-20170508.4
    expand-region-20170514.1309        f-20170404.1039
    flycheck-20170521.2021             flycheck-irony-20160317.1536
    flycheck-pos-tip-20170504.1504     flycheck-rust-20170404.842
    flyspell-correct-20170213.700      flyspell-correct-ivy-20161031.1134
    gist-20161127.855                  git-gutter-fringe-20170112.2133
    git-link-20170504.1834             git-timemachine-20170325.220
    gitconfig-mode-20160710.1913       gitignore-mode-20160319.302
    glsl-mode-20160209.833             go-eldoc-20170305.627
    go-guru-20170501.1058              go-mode-20170308.1512
    gorepl-mode-20151121.422           goto-last-change-20150109.1023
    groovy-mode-20170522.2244          gxref-20170411.1053
    haml-mode-20170208.28              haskell-mode-20170519.1555
    haxor-mode-20160618.429            help-fns+-20170223.733
    highlight-indentation-20170502.43  highlight-numbers-20160717.1228
    highlight-quoted-20140916.1122     hl-todo-20161102.1337
    hlinum-20170507.2227               htmlize-20161211.1019
    imenu-anywhere-20160831.356        imenu-list-20170215.125
    impatient-mode-20170505.1921       inf-ruby-20170515.1648
    irony-20170523.618                 irony-eldoc-20170502.1208
    ivy-20170523.53                    ivy-bibtex-20170321.1306
    js2-mode-20170516.1643             js2-refactor-20170522.455
    json-mode-20170418.1900            julia-mode-20170426.1806
    less-css-mode-20160930.2153        lua-mode-20170130.435
    magit-20170522.1835                markdown-mode-20170522.858
    markdown-toc-20170224.2350         meghanada-20170521.2053
    mips-mode-20170310.2149            modern-cpp-font-lock-20170224.114
    moonscript-20160503.631            mu4e-maildirs-extension-20170217.40
    multi-term-20160619.233            nasm-mode-20161216.736
    nav-flash-20140508.1341            neotree-20170522.758
    nodejs-repl-20170110.940           nose-20140520.948
    ob-go-20170324.932                 ob-mongo-20161130.152
    ob-redis-20160411.2013             ob-restclient-20160323.2305
    ob-rust-20150612.2023              ob-sql-mode-20170213.1056
    ob-translate-20160411.124          omnisharp-20170509.104
    opencl-mode-20160220.909           org-bullets-20140918.1137
    org-download-20170213.1151         org-plus-contrib-20170515.2005
    org-tree-slide-20160513.2325       osx-clipboard-20141012.17
    ox-reveal-20161027.226             pcre2el-20161120.1303
    persp-mode-20170509.829            php-boris-20130527.121
    php-extras-20160518.2316           php-mode-20170428.1853
    php-refactor-mode-20160417.1446    phpunit-20161219.320
    pip-requirements-20160930.2032     projectile-20170416.148
    pug-mode-20170127.1949             quickrun-20170222.1715
    racer-20170218.516                 rainbow-delimiters-20160430.2358
    rainbow-mode-0.12                  realgud-20170522.325
    restclient-20170516.137            rjsx-mode-20170422.832
    rotate-text-20111204.939           rspec-mode-20170312.56
    ruby-refactor-20160214.850         rust-mode-20170514.2022
    s-20170428.1026                    sass-mode-20161006.2326
    sbt-mode-20170517.631              scala-mode-20170323.502
    shackle-20170213.1534              shader-mode-20170130.623
    skewer-mode-20170122.938           slime-20170511.1221
    smart-forward-20140430.13          smartparens-20170511.743
    smex-20151212.1409                 ssh-deploy-20170520.26
    stripe-buffer-20141208.708         stylus-mode-20150313.812
    swift-mode-20170224.1825           swiper-20170515.1409
    tern-20161222.850                  tide-20170516.543
    toml-mode-20161107.1000            twittering-mode-20170312.735
    typescript-mode-20170424.2231      vi-tilde-fringe-20141027.1942
    vimrc-mode-20150607.913            visual-fill-column-20170502.1300
    web-beautify-20161115.1447         web-mode-20170510.1127
    wgrep-20141016.1656                which-key-20170521.549
    xref-js2-20160803.116              yaml-mode-20170406.241
    yard-mode-20160310.850             yasnippet-20170518.1753

  + byte-compiled files:
    n/a                                    

  + exec-path:
    /usr/local/bin/
    /usr/bin/
    /bin/
    /usr/sbin/
    /sbin/
    /Library/TeX/texbin/
    /Applications/Wireshark.app/Contents/MacOS/
    /usr/local/sbin/
    /usr/local/opt/fzf/bin/
    /usr/local/Cellar/emacs-mac/emacs-25.2-z-mac-6.4/libexec/emacs/25.2/x86_64-apple-darwin16.6.0/

  + PATH:
    /usr/local/bin
    /usr/bin
    /bin
    /usr/sbin
    /sbin
    /Library/TeX/texbin
    /Applications/Wireshark.app/Contents/MacOS
    /usr/local/sbin
    /usr/local/opt/fzf/bin

----
There were issues!

What I really want to say is: what if I want to use a mirror website to install/upgrade all packages (because of bad internet connect or censorship)? In spacemacs I can use this:

  (setq configuration-layer--elpa-archives
        '(("melpa-cn" . "http://elpa.emacs-china.org/melpa/")
          ("org-cn"   . "http://elpa.emacs-china.org/org/")
          ("gnu-cn"   . "http://elpa.emacs-china.org/gnu/")))
  )
hlissner commented 7 years ago

Huh, I hadn't considered that scenario. I understand.

I think changing packages-archives (as you have) is best in your case, but if it could help you: I've made a few changes to my config's TLS settings and updated make doctor with some (hopefully) more informative TLS tests.

I've also added a check for an INSECURE envvar, which will tell Emacs to ignore invalid certificates, e.g. INSECURE=1 make install.

In any case, I'll consider this resolved.