progfolio / elpaca

An elisp package manager
GNU General Public License v3.0
637 stars 31 forks source link

[Support]: Using elpaca on Emacs instance that's offline #345

Closed dakra closed 2 months ago

dakra commented 2 months ago

Confirmation

Elpaca Version

Elpaca edc0dc2 HEAD -> master, origin/master, origin/HEAD installer: 0.7 emacs-version: GNU Emacs 29.4 (build 2, x86_64-w64-mingw32) of 2024-06-23 git --version: git version 2.45.2.windows.1

Operating System

Linux and Windows

Description

I want to use Emacs on a very restricted corporate network on Windows. For sake of simplicity let's say there's no internet connection at all. (In reality there are a few services available, one is GitHub which is very helpful, so I can download/git clone from there but not e.g. savanna or codeberg etc)

I made a "minimal" config for Windows where I simply checked in the complete elpa directory and I could copy that over, manually byte-compile the elpa dir and everything was working.

Now, I want to switch to elpaca, but I'm not sure how/what files I can commit in my repo that when I start Emacs in this restricted environment, it will simply load what's already there on the filesystem. I tried copying the full elpaca directory (minus the .elc files) but it still seems to try to download "stuff" the first time it starts. (Link to my "minimal/windows" emacs config: https://github.com/dakra/dot-emacs-windows )

Any suggestioins/hints appreciated. Thanks.

progfolio commented 2 months ago

I tried copying the full elpaca directory (minus the .elc files) but it still seems to try to download "stuff" the first time it starts.

What stuff did it try to download?

dakra commented 2 months ago

What stuff did it try to download?

OK, that phrasing was maybe not the best :D

Let me re-phrase what I did, and what happened: I copied the full elpaca/ folder from my working environment/Emacs over to the restricted corporate machine but without the elc files. But since in elpaca/builds are only .elc files it's basically empty.

When I then start Emacs in the restricted environment with the elpaca folder copied to, it first downloads (or updates only?) elpaca again because it can't find it in the build directory. This actually works in my case because I can clone things from github. But then it simply "hangs" on (elpaca(,@elpaca-order))` with no output. I assume it tries to update the repos in the repos directory before it builds them again or even updates the menus? That's what I meant with "stuff", because I don't really now. The hanging indicates to me that it tries to fetch something from e.g. savannah, codeberg etc which is not allowed.

Hope that makes it a bit clearer.

Thanks :)

progfolio commented 2 months ago

Thanks for the clarification.

But since in elpaca/builds are only .elc files it's basically empty.

There should be more in the build directory for each package. Namely symbolic links to the repo source files as well as autoloads and byte-compiled files.

When I then start Emacs in the restricted environment with the elpaca folder copied to, it first downloads (or updates only?) elpaca again because it can't find it in the build directory.

The installer script checks for the presensce of repos/elpaca/ and downloads a copy of Elpaca to bootstrap the install if the folder does not exist.

Similarly, Elpaca checks for the presence of a directory under the repos and builds dirs to determine if a package needs to be re-installed at start-up.

But then it simply "hangs" on (elpaca (,@elpaca-order))` with no output.

You should be able to break out of that hang with C-g. You may have to press it more than once to get it to work. You could add (setq debug-on-quit t) before the point where you think it's hanging and try that. Once you press C-g you should get a backtrace showing what was running when you invoked keyboard-quit. I also recommend launching Emacs with the --debug-on-error command line options when debugging.

The hanging indicates to me that it tries to fetch something from e.g. savannah, codeberg etc which is not allowed.

Most of the menu functions attempt to download recipes from various sources. You can prevent that by copying over the elpaca/cache/*.eld files, too. Or, in this environment, you could (setq elpaca-menu-functions '(list-of-menu-functions-you-want).

I would start with trying to get a backtrace to see what's causing the hang, though. Let me know what you find.

dakra commented 2 months ago

`There should be more in the build directory for each package. Namely symbolic links to the repo source files as well as autoloads and byte-compiled files

Hmm, it looks like my working version was also broken somehow. I have (elpaca-no-symlink-mode) set, so there are no symlinks in the builds directory. But somehow there also where no normal .el files or autoloads there. I just wiped it and made a clean install an now those files are there as well next to the byte-compiled ones.

Now I seems to work on all my machines like I wanted. I'll close this issue now and will make a new ticket in case it's not 100% working in my special setup (windows and restricted environment).

Sorry for the noise and thanks for the help :)

progfolio commented 2 months ago

Glad you got it working.

I'll close this issue now and will make a new ticket in case it's not 100% working in my special setup (windows and restricted environment).

I don't use Windows myself, but please do let me know if you run into any issues. Thanks again.