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

Convince eldev to not bootstrap? #81

Open
sellout opened this issue Jan 6, 2023 · 3 comments
Open

Convince eldev to not bootstrap? #81

sellout opened this issue Jan 6, 2023 · 3 comments
Labels
bug Something isn't working need info

Comments

@sellout
Copy link

sellout commented Jan 6, 2023

I’m handing eldev an Emacs with pinned versions of all the packages (eldev, relint, etc.) already there on the load-path. However, eldev still wants to bootstrap and pull everything down itself. How can I convince it to use what’s already provided?

Options like --external only seem to apply to dependencies of my project (which makes sense), but I’m hoping there’s something similar for eldev’s dependencies.

@sellout
Copy link
Author

sellout commented Jan 6, 2023

To clarify a bit, I suppose this isn’t quite a bootstrapping issue, as I’m using ELDEV_LOCAL to point to the local eldev, which works. And what I thought wasn’t working, but is is using (eldev-use-local-dependency "path/to/dash") etc. to specify the other dependencies.

However, it still wants to download package archives, even though it doesn’t need to load anything from them, and that’s where I’m currently stuck. I tried (setq package-archives nil) in my Eldev, but that didn’t have any effect.

I finally got it. Four things I needed to do:

  1. ELDEV_LOCAL to avoid downloading Eldev,
  2. eldev-use-local-dependency for each linter & dependency needed,
  3. eldev --external to avoid downloading any archives, and
  4. export HOME="$PWD/fake-home so Eldev could write its pseudo-package temp file somewhere.

This is still a bit awkward in a couple was (e.g., step 2 requires explicitly listing transitive dependencies), but I have a successful build now that doesn’t try to do any networking.

@doublep doublep added the bug Something isn't working label Jan 6, 2023
@doublep
Copy link
Collaborator

doublep commented Jan 6, 2023

Yeah, this sounds like a bug. I guess Eldev should use provided tools in --external mode if they are enough. I'm not sure if it should try fetching if something is e.g. not installed (does that even work?).

Maybe as a workaround you could try modifying eldev-known-tool-packages for now, by stripping :archive/`:archives'. But I will look into fixing this eventually.

@doublep
Copy link
Collaborator

doublep commented Jan 21, 2023

I now tried to reproduce it, but couldn't. I don't have package-lint installed normally, so what I did is trying to run the linter in external mode from some directory:

~/iter2$ eldev clean all; eldev clean global-cache; eldev -X -dt lint package
Deleted 1 directory
Nothing to delete
Started up on Sat Jan 21 13:58:43 2023
Running on GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.33, cairo version 1.16.0)
 of 2022-12-03
Project directory: ‘/home/paul/iter2/’
Loading file ‘/home/paul/.eldev/config’...
Loading file ‘Eldev’...
Loading file ‘Eldev-local’...
Executing command ‘lint’...
Going to run the following linter: ‘package’
Running linter ‘package’...
Need the following extra dependencies for set ‘runtime’: package-lint 0.14

Dependency ‘package-lint’ version 0.14 is required, but only 0.12 is installed in ‘~/.emacs.d/elpa’; skipping linter ‘package’
Linter has no complaints
Deleting package archive contents to avoid polluting the external directory: ‘--eldev--’
Finished successfully on Sat Jan 21 13:58:44 2023

It never accesses the network. I even double-verified this by termporarily disabling network connection on my machine. The message it gives is not exactly correct, but that's it. I already have a fix and improvement locally, after which it says instead:

Dependency ‘package-lint’ is not installed in ‘~/.emacs.d/elpa’; skipping linter ‘package’
Either install it there, or use global option ‘--isolated’ (‘-I’)
Required as a development tool, not as a dependecy of the project

However, the only network access I could reproduce is bootstrapping Eldev itself if not available locally (i.e. after setting ELDEV_LOCAL to an empty string and making sure it is not installed yet). However, that is understandable, as if Eldev package is missing, Eldev obviously cannot run. Also note that -X (--external) doesn't apply here, since the package is needed before even parsing the command line, so it needs to be present in the standard location regardless of -X.

I need a full description of the setup where it misbehaves for you.

doublep added a commit that referenced this issue Jan 21, 2023
…d; improve warnings issued for missing linters. (issue #81)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need info
Projects
None yet
Development

No branches or pull requests

2 participants