GithubHelp home page GithubHelp logo

emacscollective / borg Goto Github PK

View Code? Open in Web Editor NEW
256.0 15.0 27.0 727 KB

Assimilate Emacs packages as Git submodules

Home Page: https://emacsmirror.net/manual/borg

License: GNU General Public License v3.0

Makefile 11.17% Emacs Lisp 80.00% Shell 8.83%
emacsmirror emacs-packages emacs

borg's Introduction

Assimilate Emacs packages as Git submodules

Borg is a bare-bones package manager for Emacs packages. It provides only a few essential features and should be combined with other tools such as Magit, epkg, use-package, and auto-compile.

Borg assimilates packages into the ~/.config/emacs repository as Git submodules. An assimilated package is called a drone and a borg-based ~/.config/emacs repository is called a collective.

For more information see the announcement and the manual.



Compile Manual MELPA Stable MELPA

borg's People

Contributors

akermu avatar c6c7 avatar chasecaleb avatar damiencassou avatar darkfeline avatar emacs18 avatar georgek avatar jabranham avatar kevinjfoley avatar montag451 avatar nxtr avatar okamiw avatar rakllie avatar stepnem avatar tarsius avatar thaodan avatar thblt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

borg's Issues

Get version string for all drones that where updated

I have a lot of packages assimilated so when I update every few days I have 10+ Packages that needs updating.
Updating them is not a problem as I want to see what's new in each anyway, but now the borg documentation says I should write a commit message like:

Update 2 drones

Update foo to v1.1.0
Update bar to v1.2.1

Is there an easy way to get all version strings of those updated packages?
Copy and pasting from my magit submodules list seems cumbersome with 10+ updated drones.

Allow using borg alongside package.el

borg could be used to only install the packages that the user actually works on, while other packages continue to be installed using package.el.

  • Teach package.el about packages installed by borg. Because the directories listed in package-directory-list are expected to contain package directories of the form <package>-<version>, we cannot just add ~/.emacs/lib to that list (borg only uses <package>). We might have to setup a secondary directory containing symlinks. So really we have to teach borg about package.el.
  • Support "clone without assimilation" better.
  • ...
  • Add borg to Melpa.

borg should byte-compile lisp directories recursively

Some packages split source files into a directory tree. Shouldn't borg compile
them all automatically, or at least optionally? It's what
byte-recompile-directory does, for instance. Currently borg only compiles files
at the top level of a directory.

Document preferred workflow for local DRONes

Might not belong in issues per se, but I'm not sure what the best way to communicate things related to Borg might be.

I have a bunch of code that I used to store in my site-lisp/ as local features. These don't necessarily warrant their own repos atm, so I tracked them as part of my emacs.d/. Now that I'm porting my config over to Borg I'm wondering what a preferred workflow for such local code might be. These are usually chunks of code that no longer belong in the init.el proper and may eventually grow into their own packages. Or perhaps you just started putting together your own minor mode or something. To accommodate such cases I used to do the add site-lisp/* to the load-path dance. Now if you also perform byte-compilation and generate autoloads you'd be pretty much reinventing parts of borg, there must be a better way.

Here's what I did for now

  1. mkdir lib/DRONE
  2. move relevant code to lib/DRONE
  3. make lib/DRONE (this step is easy to forget)
  4. now that you byte-compiled and generated autoloads as needed, we have to add the following to init.el:
(borg-activate "DRONE")
(use-package DRONE :defer t)

This seems to work. Is there a better way?
Could I keep stuff in site-lisp/ and still manage to benefit from Borg somehow or should I not want that? I can certainly figure out a way to do this, but wonder if anyone thought of a systematic way to do so that leverages Borg.

`make build` doesn't respect submodule variable?

slime already has it's own autoload file and also own Makefile.
When "doing nothing", borg overwrites the slime-autoloads.el file
and leaves the submodule dirty.
So I set the variable submodule.slime.build-step to make like
in the documentation expecting that borg-update-autoloads is not called.

Now if I go to lib/slime and manually type make
or if I type in my config dir make lib/slime it works
and the submodule is not diry.
But calling make build changes/deletes the autoload file.

(Same issue with realgud)

borg-assimilate fails due to epkg version being too old

After setting up emacscollective for the first time, executing

M-x borg-assimilate

resulted in this error message in the mini-buffer:

user-error: Please update the ‘epkg’ package.  The installed version is to old for the current database scheme

Using edebug I learned that epkg-db-version is 2, but the version returned by the following is 3

(caar (emacsql epkg--db-connection "PRAGMA user_version"))

Details follow.

On Ubuntu 16.04, I setup emacscollective via

$ date
Sun Sep 24 11:30:01 PDT 2017

$ git config --global url.https://github.com/.insteadOf [email protected]:
$ git config --global url.https://gitlab.com/.insteadOf [email protected]:

$ git config --global core.excludesfile ~/.gitignore_global
$ echo '*-autoloads.el' >> ~/.gitignore_global
$ echo '*.elc' >> ~/.gitignore_global
$ echo 'dir' >> ~/.gitignore_global

$ cd ~/Private
$ git clone https://github.com/emacscollective/emacs.g emacs.g2
$ cd emacs.g2
$ make bootstrap
$ mkdir var
$ cd var
$ git clone https://github.com/emacsmirror/epkgs.git

$ rm -rf ~/.emacs.d ~/.emacs
$ ln -s ~/Private/emacs.g2 ~/.emacs.d

then launched emacs 25 (I also tried emacs 26 with same result) without
any argument, and tried to execute borg-assimilate.

Moving submodules randomly in .gitmodules

My .gitsubmodules is regularly filled with changes in the ordering of submodules. This is annoying because it makes committing real changes harder. This is an excerpt of my diff now:

diff --git a/.gitmodules b/.gitmodules
index 087a4f6..b8250b2 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -229,21 +229,18 @@
 [submodule "ivy"]
        path = lib/ivy
        url = [email protected]:abo-abo/swiper.git
-[submodule "json-navigator"]
-       path = lib/json-navigator
-       url = [email protected]:DamienCassou/json-navigator.git
 [submodule "less-css-mode"] # Major mode to edit .less files
        path = lib/less-css-mode
        url = [email protected]:purcell/less-css-mode.git
+[submodule "json-navigator"]
+       path = lib/json-navigator
+       url = [email protected]:DamienCassou/json-navigator.git
 [submodule "json-reformat"]
        path = lib/json-reformat
        url = [email protected]:gongo/json-reformat.git
 [submodule "json-snatcher"]
        path = lib/json-snatcher
        url = [email protected]:Sterlingg/json-snatcher.git
-[submodule "klassified"]
-       path = lib/klassified
-       url = https://[email protected]/DamienCassou/klassified.el.git
 [submodule "macrostep"] # Interactively expand macros
        path = lib/macrostep
        url = [email protected]:joddie/macrostep.git
@@ -260,9 +257,9 @@
 [submodule "markdown-mode"] # Major mode for markdown format
        path = lib/markdown-mode
        url = [email protected]:jrblevin/markdown-mode.git
-[submodule "know-your-http-well"]
-       path = lib/know-your-http-well
-       url = [email protected]:for-GET/know-your-http-well.git
+[submodule "klassified"]
+       path = lib/klassified
+       url = https://[email protected]/DamienCassou/klassified.el.git
 [submodule "messages-are-flowing"] # Visual indication of hard newlines
        path = lib/messages-are-flowing
        url = [email protected]:legoscia/messages-are-flowing.git
@@ -272,15 +269,15 @@
 [submodule "nameless"] # hide current package name everywhere in elisp code
        path = lib/nameless
        url = [email protected]:Malabarba/Nameless.git
+[submodule "know-your-http-well"]
+       path = lib/know-your-http-well
+       url = [email protected]:for-GET/know-your-http-well.git
 [submodule "list-utils"]
        path = lib/list-utils
        url = [email protected]:rolandwalker/list-utils.git
 [submodule "loop"]
        path = lib/loop
        url = [email protected]:Wilfred/loop.el.git
-[submodule "m-buffer"]
-       path = lib/m-buffer
-       url = [email protected]:phillord/m-buffer-el.git
 [submodule "org-vcard"] # used by vdirel
        path = lib/org-vcard
        url = [email protected]:flexibeast/org-vcard.git
@@ -290,12 +287,12 @@
 [submodule "ox-twbs"] # use twitter bootstrap to export org files to HTML
        path = lib/ox-twbs
        url = [email protected]:marsmining/ox-twbs.git
+[submodule "m-buffer"]
+       path = lib/m-buffer
+       url = [email protected]:phillord/m-buffer-el.git
 [submodule "memoize"]
        path = lib/memoi

borg-build is (interactive) but only works (if noninteractive)

Following eda44c6, the body of borg-build is wrapped in (if noninteractive ), which basically makes it equivalent to borg-activate, which it calls. I'm not sure I really understand the rationale behind this commit, so I won't offer a PR, but I guess either borg-build should not be (interactive), or it should do something meaningful in interactive Emacs.

Thanks!

borg-assimilate can't find a git repository

Each time I use borg-assimilate, I get the following:

fatal: Not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

The trace is

Debugger entered--Lisp error: (error "Git failed")
  signal(error ("Git failed"))
  error("Git failed")
  borg--call-git("org-jira" "submodule" "absorbgitdirs" "--" "/home/cassou/.emacs.d/lib/org-jira/")
  borg--maybe-absorb-gitdir("org-jira")
  borg-assimilate("org-jira" "[email protected]:ahungry/org-jira.git" nil)
  funcall-interactively(borg-assimilate "org-jira" "[email protected]:ahungry/org-jira.git" nil)

My setup is standard: ~/.emacs.d is a git repository. Moreover, despite the error, it seems that borg happily clones the submodule.

Making flycheck validate emacs lisp files

Hi,

with borg, flycheck complains about all require calls in all emacs lisp files I want to validate. The problem is that flycheck has no clue that package dependencies are in ../. A workaround is to declare, for each file, a file-local variable for flycheck-emacs-lisp-load-path:

... a package depending on ivy...
(require 'ivy)
...
;; Local Variables:
;; flycheck-emacs-lisp-load-path: ("../ivy/" ".")
;; End:

I don't like this solution because:

  1. Emacs complains each time I open the file that setting flycheck-emacs-lisp-load-path is unsafe;
  2. This footer depends on my own configuration: another maintainer might have problems if she uses another package manager

Notification when repos move?

It would be nice if borg and epkg somehow integrated so that we could get notifications (or something) when repos move (e.g. org somewhat recently moved; several others have moved away from github).

Does borg-build-shell-command still do anything?

I'm a bit confused with borg-build, so sorry if this is a stupid question. IIUC, borg-build tests for noninteractive and run the actual build steps only of t, else it runs an emacs --batch -Q in a subprocess. If this is the case, doesn't this mean it's useless to configure borg-build-shell-command, since the child process' emacs won't have it set anyway?

Thanks!

Experimental support for using Borg alongside Package.el

Borg can now be installed as a secondary package manager alongside package.el. This is not documented in the manual yet. Please follow the below instructions instead. Beside adding such installation instructions to the manual, I also have to describe use-cases and restructure the manual. This is quite a bit of work and that is why I am making this feature available now with only limited documentation.

While it is possible (and in fact a major goal of this update) to install Borg in an existing configuration that relies on package.el I demonstrating how to install it Borg in a new configuration using package.el. If you want to use Borg and package.el at the same time, then I recommend you first go through this process to get a feel for how things work and only then do it in your existing configuration.

First create a new temporary repository in e.g. /tmp/.emacs.d/, clone the package database, and edit /tmp/.emacs.d/init.el:

git init /tmp/.emacs.d
git clone [email protected]:emacsmirror/epkgs.git
emacs /tmp/.emacs.d/init.el

Put this into the /tmp/.emacs.d/init.el:

(setq user-init-file (or load-file-name buffer-file-name))
(setq user-emacs-directory (file-name-directory user-init-file))

(require 'package)
(add-to-list 'package-archives (cons "melpa" "https://melpa.org/packages/") t)

(package-initialize)
(package-refresh-contents)

If you are modifying an existing configuration, then make sure you put that at the top of the file and that you remove all existing package.el configuration.

Then start a new Emacs instance using that configuration.

emacs -Q --load /tmp/.emacs.d/init.el

Install borg using package.el.

M-x package-install RET borg RET

You could start using borg to install other packages right now, but lets first finish the configuration. Replace the last two lines, that we added above, with these:

(package-initialize 'no-activate)
(package-activate 'borg)
(require 'borg-elpa)
(borg-elpa-initialize)

Quit Emacs and start a new instance.

emacs -Q --load init.el

Install a package using Borg. (After the first RET you will be told Compiling EmacSQL SQLite binary. Just wait for that to complete.)

M-x borg-assimilate RET hl-todo RET

That causes package.el to write custom-set-variables and custom-save-faces forms into the init file, so you might want to reload the buffer from the modified file at this point.

M-x revert-buffer RET

The hl-todo package has no dependency, but if it did, then you would have to first install those in separate steps because Borg does not handle dependencies for you. (In the future it might.) You can however use epkg-describe-package to get a tree of dependencies. You can install dependencies of package using package.el if you wish -- even if you are going to install the package itself using Borg.

Have a look at the load-path and note that all the lib directories come before all the elpa directories. Packages installed with Borg override those installed with Package.el.

Use list-packages to get a list of Elpa packages and note that that list includes the packages that you installed using Borg -- with correct version strings, summaries and all.

Once you have installed magit and use-package you should also add the following to your init file.

(use-package magit
  :config
  (magit-add-section-hook 'magit-status-sections-hook
                          'magit-insert-modules
                          'magit-insert-stashes
                          'append)

EDIT: Building a package using Borg currently fails if a dependency was installed using Package.el. I am working on a fix.

EDIT: When using Borg as the primary package manager, then something like this should work:

(progn ;    `borg'
  (setq epkg-repository "~/git/emacs/epkgs/")
  ;; (package-initialize)
  (add-to-list 'load-path (expand-file-name "lib/borg" user-emacs-directory))
  (require  'borg-elpa)
  (borg-elpa-initialize))

Question about emacsmirror and elpa

Sorry, I've found no better place where to put this: I'm using borg and a package for Emacs called eglot. The package eglot uses flymake and recently the developer of eglot decided to depend on (flymake "1.0.2") which is only available on elpa. I've read the introduction of emacsmirror, and got it that it only mirrors Melpa (btw. which makes sense to me). To me it is unclear how to handle the situation.

It is the first time that I found a package which I heavily depend on, that changed somehow in an incompatible fashion. It was easy to work around (thanks to borg/git submodules) by checking out a working commit. Thus thank you for this wonderful piece of software.

One way to work around this, is to add the upstream git repo of flymake as a submodule. But is this the right thing to do? Btw. is the maintainers action (eglot) to add the dependency to an elpa package a temporary (and usual) way, until Emacs core (maybe) merges the updates into an Emacs release?

Again, sorry to bother you with this.

Document how to recover from missing object

When running make bootstrap on a new machine I'm getting the following error when nxhtml is initialized:

fatal: Could not parse object '9726590af3937c6dcd844c1b805ef648938a61fd'.

I understand the hash doesn't exist on the master but I can view it here.

I'm not really sure what's going on since I've run make bootstrap in the past with the same hash and didn't have any problems. Also I've had this problem with packages outside of emacsorphanage like spacemacs-theme. I'm guessing it stems from me not having a full understand of how git is structured.

I'm not sure this is really an issue with borg but was hoping someone else here has experienced this and can help me understand what's causing this.

Remove this dirtyness

When borg compiles and generates autoloads of drones, it makes plenty of them dirty (I guess drone authors should adapt their .gitignore file). The magit-status buffer of my .emacs.d is unreadable because of this. Is there any workaround beyond submitting PRs to each drone?

Epkg and Closql have to be updated at the same time

I've made a backward incompatible change to closql. The result is that epkg has to be updated at the same time as closql. If you have already updated one of these packages, then you should still be able to update the other using Magit and make lib/other.

clone epkgs.git to ../var/epkgs

I've got things setup per user manual, now trying my first borg-clone...

I'm being asked if I want to clone epkgs.git (from emacsmirror) into .emacs.d/var/epkgs ...?
Is this expected? Would appreciate an explanation.

Inconsistent .gitmodules submodule format

Hello @tarsius,

I am trying borg in an existing configuration and I am noticing that when I do borg-assimilate I get this:

[submodule "borg"]
	path = lib/borg
	url = [email protected]:emacscollective/borg.git

while if I add a submodule with git submodule add I get this:

[submodule "lib/borg"]     <---- different!
	path = lib/borg
	url = [email protected]:emacscollective/borg.git

I am wondering if this is ok and what if I have problem with borg when trying to add modules manually instead of using borg-assimilate.

Thanks!

Location of the borg directory

I have not used the package yet but it looks very promising.
Is it possible to configure this to work in a folder:
.emacs.d/borg/ instead of .emacs.d

I have at least 50 packages and having them in the .emacs.d directory isn't something I want to manage.

ANNOUNCEMENTS

Announcement #0

Sometimes I have to make backward incompatible changes to borg, epkg and the database schemata, which require that those things are updates at the same time or even in a particular order. In the past I had no way to communicate that that to you before you already got your setup into a broken state, making it harder to complete the update without me having to get involved.

To make that less likely in the future I will announce breaking (and other noteworthy) changes here. If you use borg or even just epkg, then you should subscribe to this issue.

This issue is locked to guarantee that it contains nothing but the actual announcements. I will open separate issues dedicated to particular announcements where you can comment or ask for help. To comment on this announcement of announcements, see #30.

Better support for borg-build-shell-command in batch mode

I've recently started using @thblt's borg-nix-shell. It provides a borg-nix-shell-build-command function for use with borg-build-shell-command.

I have this excerpt in my init file:

...
(require 'borg)
(borg-initialize)

(require 'borg-nix-shell)
(setq borg-build-shell-command 'borg-nix-shell-build-command)
...

And so building packages that use the custom build command works fine in a normal interactive emacs session. The problem arises when trying to run make lib/PACKAGE and generally make on the command line, for building that specific package or batch rebuild all the packages noninteractively.
It seems to be due to the fact that unlike the above excerpt from my init file, naturally borg-build itself doesn't do (require 'borg-nix-shell) (here).

Any thoughts on how to best go about solving this? Perhaps an environment variable that would allow the user insert a string (e.g. the call to require) right after the borg-initialize inside borg-build?

Borg-assimilate breaks .gitmodules (possibly related to bad indentation)

I'm not sure I really understand how, but borg-assimilate often breaks .gitmodules by moving optional fields, like load-path to a different section. I just assimilated biblio and helm-bibtex and Borg updated .gitmodules like this:

 modified   .gitmodules
@@ -29,6 +29,9 @@
 [submodule "beginend"]
 	path = lib/beginend
 	url = https://github.com/DamienCassou/beginend
+[submodule "biblio"]
+	path = lib/biblio
+	url = [email protected]:cpitclaudel/biblio.el.git
 [submodule "borg"]
 	path = lib/borg
 	url = https://github.com/emacscollective/borg
@@ -138,10 +141,10 @@
 [submodule "flyspell-correct"]
 	path = lib/flyspell-correct
 	url = https://github.com/d12frosted/flyspell-correct
+load-path = elisp
 [submodule "geiser"]
 	path = lib/geiser
 	url = https://github.com/jaor/geiser.git
-load-path = elisp
 [submodule "general"]
 	path = lib/general
 	url = https://github.com/noctuid/general.el
@@ -166,6 +169,9 @@ load-path = elisp
 [submodule "helm"]
 	path = lib/helm
 	url = https://github.com/emacs-helm/helm
+[submodule "helm-bibtex"]
+	path = lib/helm-bibtex
+	url = [email protected]:tmalsburg/helm-bibtex.git
 [submodule "helm-dash"]
 	path = lib/helm-dash
 	url = https://github.com/areina/helm-dash
new file   lib/biblio
@@ -0,0 +1 @@
+Subproject commit a5a68fcf677f286f205f32dc7486f6c9f66aa6af
new file   lib/helm-bibtex
@@ -0,0 +1 @@
+Subproject commit c591a860bf921eb3353f2ac393b758ac65189af8

Notice how load-path = elisp moved from geiser to flyspell-correct. I suspect this may be related to indentation, but I'm not sure.

(I'm aware this is not a good bug report, but I've been experiencing this from some time and I always end up forgetting to open an issue. I'll try to find a way to reproduce when I'll have more time)

Warn before assimilating an unsafe package

All packages are somewhat unsafe because no review happens. There's nothing we can do about that, we cannot review all packages.

But some packages are more unsafe than others. Packages from the Emacswiki are completely unsafe because it does not even require that the maintainer of a package decides to launch an attack or gets hacked - anyone can edit any package on the Emacswiki.

Even though it is now possible and encouraged to clone a package before assimilating it to have a change to review it before executing any of its code, some extra protection should be added. So start warning when the user attempts to assimilate a package and optionally also do so before cloning.

The same should optionally be done for packages that are fetched over an unsecure connection.

borg-build error with wrong type argument

Whenever I try to borg-build, I get an error similar to Wrong type argument: stringp, 45, here's the Backtrace:

Debugger entered--Lisp error: (wrong-type-argument stringp 45)
  make-process(:name "emacs ... --eval (borg-build \"helm\")" :buffer #<buffer *Borg Build*> :command ("/usr/bin/emacs" "--batch" 45 113 "-L" "/home/alex/.emacs.d/lib/borg/" "--eval" "(progn\n  (require 'borg)\n  (borg-initialize)\n  (setq borg-build-shell-command (quote nil))\n  (borg-build \"helm\"))"))
  apply(make-process (:name "emacs ... --eval (borg-build \"helm\")" :buffer #<buffer *Borg Build*> :command ("/usr/bin/emacs" "--batch" 45 113 "-L" "/home/alex/.emacs.d/lib/borg/" "--eval" "(progn\n  (require 'borg)\n  (borg-initialize)\n  (setq borg-build-shell-command (quote nil))\n  (borg-build \"helm\"))")))
  start-process("emacs ... --eval (borg-build \"helm\")" #<buffer *Borg Build*> "/usr/bin/emacs" "--batch" 45 113 "-L" "/home/alex/.emacs.d/lib/borg/" "--eval" "(progn\n  (require 'borg)\n  (borg-initialize)\n  (setq borg-build-shell-command (quote nil))\n  (borg-build \"helm\"))")
  apply(start-process "emacs ... --eval (borg-build \"helm\")" #<buffer *Borg Build*> "/usr/bin/emacs" ("--batch" 45 113 "-L" "/home/alex/.emacs.d/lib/borg/" "--eval" "(progn\n  (require 'borg)\n  (borg-initialize)\n  (setq borg-build-shell-command (quote nil))\n  (borg-build \"helm\"))"))
  borg-build("helm" t)
  funcall-interactively(borg-build "helm" t)
  call-interactively(borg-build record nil)
  command-execute(borg-build record)
  execute-extended-command(nil "borg-build" nil)
  funcall-interactively(execute-extended-command nil "borg-build" nil)
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

borg-remove shows an error

  1. clone emacs.g to a new directory
  2. emacs -Q --load emacs.g/init.elc
  3. M-x borg-assimilate RET magithub RET
  4. M-x borg-remove RET magithub RET

You get

test-completion: Invalid function: ("magithub")

org string hardcoded in borg-batch-rebuild

I didn't start with any of the emacs.g "templates" but build my own (as org config).
I assimilated the newest org-mode which is https://code.orgmode.org/bzg/org-mode.git so it makes sense that the drone is also called org-mode but looking at borg-batch-rebuild (and emacs.g org branch) I see that you name it only org.

I think it should detect and work with both names.

Borg has very strong assumptions about directory structure.

In various places, Borg seems to assume that:

  • the .emacs.d directory is the root of a git repository.
  • Drones are located in a lib directory at the root of a git repository.

For example, the borg-drones function identify submodules which are actually drones by the fact that their path start with /lib. This is the case if and only if the two above assumptions are true.

Requiring a very specific layout may be a feature rather than a bug, but if this is the case, this feature is inconsistent with the fact that borg-drone-directory tries to be smart when determining its actual location instead of failing when it isn't in $GIT_ROOT/lib

borg-assimilate fails for symlinked .emacs.d

I have my emacs configuration (using borg) under ~/hackery/emacs.g/, and have symlinked ~/.emacs.d to ~/hackery/emacs.g/. If I invoke emacs with emacs -q --load ~/hackery/emacs.g/init.el and then try to borg-assimilate all works as expected.

If instead I invoke emacs as emacs (letting emacs find ~/.emacs.d/init.el) and try to borg-assimilate, it fails with git saying

fatal: Not a git repository: ../../.git/modules/hexcolour

I have tried (setq vc-follow-symlinks t) to no avail.

Not sure if this is directly related to #3 or just same error, different cause.

Nonsilence about unmet assumptions in borg.sh

Yesterday, I had the recurring problem of being in a drone directory and wanting to (re)compile the drone the Borg way. That usually required to cd ../.., make lib/$drone and then cd lib/$drone, where $drone - well - depends on the drone. Most probably I am still missing something from Magit, Borg and/or Emacs that will make this less clumsy. I have only just begun using Magit, and I will find that out on my own.

However, before I realized this, I had already finished:

https://gist.github.com/whxvd/84f2737db850c3e1451ea951a13bb3da

In the process of writing it, I learned more about POSIX compatible shell scripting. And I would like to know from you whether you would like a thorough ... || $eE-style error catching in borg.sh.

The set -o nounset at the top is POSIX compliant and it makes the shell bail out on parameter expansions ${X} if the parameter X is not set. But it is possible to have a parameter expansion with a default value, written ${X:-default}, and the default may be the empty string. ${X:-} then behaves essentially like ${X} under +o nounset. The only exception that I know of is that an assignment with ${X} under +o unset returns non-zero, if X is not set, whereas under -o unset it exits the shell if is running a script.

Proposed way to not autoload pkg but include include in build

What is the proposed way to not automatically load the autoload file of a package but include the package in the build (make). I would like to avoid the autoload phase, which is done by borg-initialize, by manually setting the path via use-package :load-path "lib/foo/lisp". Any pointers on how to do that or how to implement that. I'm willing to invest some time on it.
To be clear: I see my Emacs spending more and more on autoloads. I already specify via use-package what should trigger a load of the package. But if all the autoload are load beforehand, I see no way to speed this up.

borg-assimilate fails when epkg is not available

When trying to assimilate a package when epkg is not available, it fails with Symbol's function definition is void: epkg. It seems that borg-read-package handles the case where epkg is not available but borg--maybe-confirm-unsafe-action does not, it blindly calls epkg even if the require call fails.

borg not adding to info-directory-list

I have auctex assimilated as follows in my .gitmodules:

[submodule "auctex"]
	path = lib/auctex
	url = https://git.savannah.gnu.org/git/auctex.git
	info-path = doc
	build-step = make extraclean
	build-step = ./autogen.sh
	build-step = ./configure --prefix=$HOME
	build-step = make
	remote = "jabranham [email protected]:jabranham/auctex.git"

but borg-initialize does not add /path/to/auctex/doc to Info-directory-list.

Using borg in existing config

Hi, I'm interested in trying our borg for my config, but it looks like it will be annoying to merge my config with the one in the emacs.g repo.

I'd ideally like to just replace my package.el code with some borg code. Maybe by adding a borg folder in .emacs.d with the right dependencies. Is there an easy way to do this? I see the manual is structured around cloning .emacs.g and working from there.

Thanks

Out of source build?

[ I think #57 must be fixed before this ]

I have a small issue with the Irony server from irony-mode and Borg. I can configure Borg to build the server:

[submodule "irony"]
	path = lib/irony
	url = https://github.com/Sarcasm/irony-mode
	build-nix-shell-packages = cmake llvmPackages.clang.cc
	build-step = cmake ./server
	build-step = make
	build-step = borg-update-autoloads
	build-step = borg-byte-compile
	build-step = borg-makeinfo

But the build is performed directly in the submodule's root, ~/.emacs.d/lib/irony/, and the submodule thus appear dirty. Irony should be built out of source, which is normally performed by running cmake and make from ~/.emacs.d/lib/irony/build/, which is in .gitignore. CMake at least provides no official way to build outside of $PWD, so it has to be cded to first, and I have no idea how to do this with Borg.

If there is no way yet to do this in borg, maybe a new submodules.DRONE.build-path could be introduced to be dynamically bound inside of borg-build, if set? Something like:

    let (( ... )
         (default-directory (--if-let (borg-get drone "build-path")
                                         (expand-file-name it (borg-worktree drone))
                                         it))

(I don't know how that would work with lexical binding)

Thanks!

borg-build asks for cloning epkgs

When running M-x borg-build RET ace-link RET, I get a *Borg Build* buffer with

(09:29:52) Building ace-link

Initializing drones...done (185 drones in 0.162s)
Clone https://github.com/emacsmirror/epkgs.git to /home/cassou/.emacs.d/epkgs/? (yes or no)

I don't want to clone epkgs in ~/.emacs.d/epkgs because it is already in ~/.emacs.d/var/epkgs.

Eager macro-expansion. gist marshal pcache

Tried to install gist package, which unfortunately has quite a few deps. Among those marshal and pcache. I'm starting to get these when building once I assimilate pcache:

Eager macro-expansion failure: (file-error "Cannot open load file" "No such file or directory" "marshal")
Eager macro-expansion failure: (file-error "Cannot open load file" "No such file or directory" "marshal")
Error loading autoloads: (file-error Cannot open load file No such file or directory marshal)

Went through the whole borg-remove all deps and borg-assimilate in order a couple of times. Same result. Also, pcache doesn't really annotate anything as autoload. Don't know if it matters really.

Any ideas here would be great. I seem to recall a bunch of other packages I haven't installed yet depend on pcache. Although, it might not even be pcache.

Verify packages PGP signatures

It would be nice if Borg did verify PGP signatures before building/activating a drone. I've included such a feature in a little UI frontend for Borg I've been working on as an Elisp exercise, but I think it could take place in the core instead. I imagine it working this way:

  1. borg-assimilate would verify if the package is signed after cloning. If it is not, but if the most recent tag on default branch is, it would offer to checkout this tag instead of HEAD.

    If the git object (tag or commit) is signed with a missing signature, Borg may offer to download the public key.

    If a valid signature is found, Borg could offer to add a submodules.DRONE.signingkey field with the identifier of the signing key.

    If no signature can be verified, it would ask the user whether they still want to activate the package, and offer the choice to remove it instead.

  2. borg-clone would do the same, but won't offer to modify .gitmodules.

  3. A new function borg-upgrade or borg-switch-version would be added, which would prompt the user for a commit or a tag, checkout it, and verify signature (using submodules.DRONE.signingkey) before building.

  4. A new variable, borg-always-valid-keys would be introduced, which would store a list of GnuPG key identifiers to consider valid for all packages. This would typically store the ID of the user's own key.

  5. Optional: A new variable borg-verify-signatures-on-initialization could be introduced, defaulted to nil. If non-nil, borg-initialize would only activate packages with a valid signature and a clean working-tree. (This is a kind of "paranoia" mode.)

If you're interested to have such a feature on Borg, I'd like to work on it.

Thanks for reading this!

package is outside repository

I have seen this error message twice already, with 2 different packages:

fatal: /home/cassou/.emacs.d/lib/password-store-otp/: '/home/cassou/.emacs.d/lib/password-store-otp/' is outside repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.