Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Emacs infrastructure tracking issue #66303
I'm making an effort to clean up our Emacs packaging and use autogenerated packages whenever possible.
Here's a weird one for you: I added
Unfortunately, at runtime,
So, to work around this, I override
My questions, then, are:
1. Should these packages be declaring `org` in their `Package-Requires`? It is built-in, after all, but I suspect the Emacs packaging infrastructure assumes byte-compilation at runtime, and not the per-package byte-compilation stage performed by Nix.
Ideally, yes. (E.g. note that Haskell's Cabal packages do explicitly list versions of GHC builtin libraries they use.) In practice, making all of them obey this would be a lot of effort.
2. Do we need to manually add builtin libraries to `packageRequires` in case they are also published to an ELPA repo, in order to avoid errors as a result of byte-compilation?
I would rather not, too much effort.
3. Could we implicitly add certain builtin libraries from the resolved package set to all packages, in case they are loaded during byte-compilation?
Yes, ideally, there should be a `emacsBuiltin` attrset in `emacsPackages` (of a lowest priority for fixpointing) all pointing to current `emacs`, all of which can then be added as requisites to most packages by default. In such a setup we will, at most, need to manually override `org` and the rest of builtin packages present in other package sets so that they won't depend on themselves when fixpointing.
4. Is what we are doing correct at all? Should we defer byte-compilation to the `emacsWithPackages` builder itself, so it has a full `site-lisp` to resolve references during compilation?
That's an option that will solve your issue, but it will not solve the underlying issue. IMHO, broken byte-compilation is just a tip of an iceberg here. E.g., say one package hardcodes a path to binary/script from its dependency while being `make`ed.