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

Straight Doesn't Add Some of the Dependencies When Building Magit #964

Closed
nikuolive opened this issue Jun 21, 2022 · 18 comments
Closed

Straight Doesn't Add Some of the Dependencies When Building Magit #964

nikuolive opened this issue Jun 21, 2022 · 18 comments
Labels

Comments

@nikuolive
Copy link

What's wrong

Straight doesn't use some of the dependencies when building package such as Magit (in this case it doesn't add the Transient dependency) which leads to one of the macro used by Magit to be undefined when byte-compiled.

Test Case
(straight-bug-report
  :preserve t
  :post-bootstrap 
  (straight-use-package 'magit))
  • Test run at: 2022-06-21 18:04:08
  • system-type: gnu/linux
  • straight-version: prerelease (grafted, HEAD -> develop, replaced) 0e204d4 2022-06-16
  • emacs-version: GNU Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.17.6) of 2022-04-28
Output
Bootstrapping straight.el...
Bootstrapping straight.el...done
Looking for gnu-elpa-mirror recipe → Cloning melpa...
Looking for gnu-elpa-mirror recipe → Cloning melpa...done
Looking for nongnu-elpa recipe → Cloning gnu-elpa-mirror...
Looking for nongnu-elpa recipe → Cloning gnu-elpa-mirror...done
Looking for emacsmirror-mirror recipe → Cloning nongnu-elpa...
Looking for emacsmirror-mirror recipe → Cloning nongnu-elpa...done
Looking for emacsmirror-mirror recipe → Cloning el-get...
Looking for emacsmirror-mirror recipe → Cloning el-get...done
Looking for straight recipe → Cloning emacsmirror-mirror...
Looking for straight recipe → Cloning emacsmirror-mirror...done
Building straight...
Building straight...done

Test run with version: prerelease (HEAD -> develop, origin/develop) 0e204d4 2022-06-16
Cloning magit...
Cloning magit...done
Building magit...
Building magit → Cloning compat...
Building magit → Cloning compat...done
Building magit → Building compat...
Building magit → Building compat...done
Building magit → Cloning dash.el...
Building magit → Cloning dash.el...done
Building magit → Building dash...
Building magit → Building dash...done
Building magit → Building git-commit...
Building magit → Building git-commit → Cloning transient...
Building magit → Building git-commit → Cloning transient...done
Building magit → Building git-commit → Building transient...
Building magit → Building git-commit → Building transient...done
Building magit → Building git-commit → Cloning with-editor...
Building magit → Building git-commit → Cloning with-editor...done
Building magit → Building git-commit → Building with-editor...
Building magit → Building git-commit → Building with-editor...done
Building magit → Building git-commit...
Building magit → Building git-commit...done
Building magit → Building magit-section...
Building magit → Building magit-section...done
Building magit...
Building magit...done

Packages:
"straight"                n/a                  develop 0e204d4 2022-06-16
"org-elpa"                n/a                  n/a
"melpa"                   n/a                  master a119267f 2022-06-19
"gnu-elpa-mirror"         n/a                  master ecb802a 2022-06-10
"nongnu-elpa"             n/a                  main 7c53c3bc83 2022-06-08
"el-get"                  melpa                master bf3dba44 2022-06-02
"emacsmirror-mirror"      n/a                  master ebaa7a9 2022-06-21
"magit"                   melpa                master adf5848e 2022-06-18
"compat"                  gnu-elpa-mirror      master 24bdfa4 2022-06-20
"dash"                    melpa                master 0ac1ecf 2022-06-08
"git-commit"              melpa                master adf5848e 2022-06-18
"transient"               melpa                master a583d2b 2022-06-09
"with-editor"             melpa                master cfcbc27 2022-06-08
"magit-section"           melpa                master adf5848e 2022-06-18

$ md5sum /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-transient.elc
e2f0131ac4717c3902b6064ff59dc65b  /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-transient.elc

The command above produce the same .elc files as shown below.

Output
$ emacs -Q -L "/tmp/straight.el-test-kAS2LG/straight/build/magit" -L "/tmp/straight.el-test-kAS2LG/straight/build/compat" -L "/tmp/straight.el-test-kAS2LG/straight/build/dash" -L "/tmp/straight.el-test-kAS2LG/straight/build/magit-section" -L "/tmp/straight.el-test-kAS2LG/straight/build/with-editor" -L "/tmp/straight.el-test-kAS2LG/straight/build/git-commit" --batch --eval '(byte-recompile-directory "/tmp/straight.el-test-kAS2LG/straight/build/magit/" 0'"'"'force)'
Checking /tmp/straight.el-test-kAS2LG/straight/build/magit/...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/git-rebase.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-apply.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-autoloads.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-autorevert.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-base.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-bisect.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-blame.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-bookmark.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-branch.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-bundle.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-clone.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-commit.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-core.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-diff.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-ediff.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-extras.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-fetch.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-files.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-git.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-gitignore.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-log.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-margin.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-merge.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-mode.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-notes.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-obsolete.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-patch.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-pkg.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-process.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-pull.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-push.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-reflog.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-refs.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-remote.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-repos.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-reset.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-sequence.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-sparse-checkout.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-stash.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-status.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-submodule.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-subtree.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-tag.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-transient.el...

In end of data:
magit-transient.el:85:6: Warning: the function
    ‘transient--with-suspended-override’ is not known to be defined.
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-wip.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-worktree.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit.el...
Done (Total of 46 files compiled, 1 skipped)


$ md5sum /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-transient.elc
e2f0131ac4717c3902b6064ff59dc65b  /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-transient.elc
This should be the correct .elc outputted. Magit works normally when calling ‘transient--with-suspended-override’ from .elc created below
Output
$ emacs -Q -L "/tmp/straight.el-test-kAS2LG/straight/build/magit" -L "/tmp/straight.el-test-kAS2LG/straight/build/compat" -L "/tmp/straight.el-test-kAS2LG/straight/build/dash" -L "/tmp/straight.el-test-kAS2LG/straight/build/magit-section" -L "/tmp/straight.el-test-kAS2LG/straight/build/with-editor" -L "/tmp/straight.el-test-kAS2LG/straight/build/git-commit" -L "/tmp/straight.el-test-kAS2LG/straight/build/transient" --batch --eval '(byte-recompile-directory "/tmp/straight.el-test-kAS2LG/straight/build/magit/" 0'"'"'force)'
Checking /tmp/straight.el-test-kAS2LG/straight/build/magit/...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/git-rebase.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-apply.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-autoloads.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-autorevert.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-base.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-bisect.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-blame.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-bookmark.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-branch.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-bundle.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-clone.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-commit.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-core.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-diff.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-ediff.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-extras.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-fetch.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-files.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-git.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-gitignore.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-log.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-margin.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-merge.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-mode.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-notes.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-obsolete.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-patch.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-pkg.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-process.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-pull.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-push.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-reflog.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-refs.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-remote.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-repos.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-reset.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-sequence.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-sparse-checkout.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-stash.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-status.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-submodule.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-subtree.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-tag.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-transient.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-wip.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-worktree.el...
Compiling /tmp/straight.el-test-kAS2LG/straight/build/magit/magit.el...
Done (Total of 46 files compiled, 1 skipped)

$ md5sum /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-transient.elc3222ff58357bcd9a98512ad1929523ba  /tmp/straight.el-test-kAS2LG/straight/build/magit/magit-transient.elc

Version information

  • Operating system: Arch Linux
@nikuolive nikuolive added the bug label Jun 21, 2022
@fuzzbomb
Copy link

Possibly related: I've experienced straight not getting dependencies of other packages than magit.

  • I installed epkg a couple of months ago, with a (use-package :straight t). It didn't install the closql dependency.
  • This week, I updated epkg using straight-pull-all, followed by straight-rebuild-all. It didn't fetch llama, which is a new dependency of epkg.

@doolio
Copy link

doolio commented Oct 10, 2023

I ran into magit #5011 and in an effort to resolve it I uninstalled magit and all its dependencies and re-installed them. This didn't resolve the issue unfortunately but I noted straight did not install the seq dependency of magit (see below its Package-Requires) at all. Is this because it uses the version built-in instead? The other dependencies were installed as expected.

;; Package-Requires: (
;;     (emacs "25.1")
;;     (compat "29.1.3.4")
;;     (dash "2.19.1")
;;     (git-commit "3.3.0")
;;     (magit-section "3.3.0")
;;     (seq "2.24")
;;     (transient "0.3.6")
;;     (with-editor "3.0.5"))

https://github.com/magit/magit/blob/139f603cb85e57baf0e3c657bc3d4860af3a9544/lisp/magit.el#L21C1-L30C1

I'm using GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0) of 2023-02-23, modified by Debian and straight version prerelease (HEAD -> master, origin/master, origin/HEAD) 9b11112 2023-08-08 as of writing.

@progfolio
Copy link
Contributor

Is this because it uses the version built-in instead?

Correct. The library has been part of Emacs core since version 25 and is also explicitly ignored via straight-recipes-gnu-elpa-ignored-packages.

@raxod502
Copy link
Member

Dangit, I didn't know that Package-Requires was allowed to be multiline. I guess that's a bug in my implementation of reading the dependencies of a package. Let me fix now.

@raxod502
Copy link
Member

Actually, no - I think this is a bug in Magit. The official Emacs documentation explicitly says of Package-Requires:

Its format is a list of lists on a single line

(emphasis mine)

@raxod502
Copy link
Member

Never mind a third time, that is true but still not a problem because Magit also includes magit-pkg.el and this is parsed correctly by straight.el:

ELISP> (progn (straight--compute-dependencies "magit") (straight--get-dependencies "magit"))
("emacs" "compat" "dash" "git-commit" "magit-section" "transient" "with-editor")

I will still report the formatting issue to Magit.

@progfolio
Copy link
Contributor

I believe I've reported the same issue once before, but I don't recall of it was with magit. While the doc does state a single line, package.el handles multiple lines, IIRC.

@progfolio
Copy link
Contributor

@raxod502 #1028

@raxod502
Copy link
Member

Hum, okay, so not only did you already know about the issue, but already fixed it, so everything I said was in fact somewhat irrelevant. That's what I get for being out of the loop so long, sorry!

Although I'd still perhaps argue that since the docs say it should be one line, it should be one line.

@progfolio
Copy link
Contributor

Hum, okay, so not only did you already know about the issue, but already fixed it, so everything I said was in fact somewhat irrelevant. That's what I get for being out of the loop so long, sorry!

Not a problem. If you hadn't mentioned the one-line thing, I wouldn't have remembered.

Although I'd still perhaps argue that since the docs say it should be one line, it should be one line.

Agreed, or the doc should be changed to reflect the package.el implementation.

@doolio
Copy link

doolio commented Oct 13, 2023

not a problem because Magit also includes magit-pkg.el

I take it is not a problem that this file uses different version numbers for some packages wrt to the Package Requires in magit.el.

@progfolio
Copy link
Contributor

not a problem because Magit also includes magit-pkg.el

I take it is not a problem that this file uses different version numbers for some packages wrt to the Package Requires in magit.el.

At this time, straight.el does not consider the version number information. So that should not cause any problems.

@raxod502
Copy link
Member

#1125?

raxod502 added a commit that referenced this issue Oct 21, 2023
…operly

[#964] Allow installing seq from GNU ELPA
@raxod502
Copy link
Member

I think this should be resolved on develop

@doolio
Copy link

doolio commented Nov 8, 2023

OK, trying to confirm this. I've switched to the develop branch and rebuilt straight but I still see seq listed in straight-recipes-gnu-elpa-ignored-packages. What am I missing?

@raxod502
Copy link
Member

Check the definition of straight-recipes-gnu-elpa-ignored-packages from M-x find-library for straight.el? It should show the change from #1125.

@doolio
Copy link

doolio commented Nov 13, 2023

OK, so I must have done something wrong. For whatever reason when I switched to develop and (presumably) pulled I was only on commit e0f3ba8. I guess I didn't in fact pull anything. I can confirm I no longer see seq listed in straight-recipes-gnu-elpa-ignored-packages as expected on the develop branch. However, removing magit and its dependencies and re-cloning magit didn't pull in seq immediately as expected. What I did:

I removed compat, dash, magit, transient and with-editor from my repos directory. I removed compat, dash, git-commit (built from magit repo), magit, magit-section (built from magit repo), transient and with-editor from the build directory. I updated the receipe repositories and then executed the magit use-package form in my init.el to re-clone and build magit. It pulls in all expected dependencies except seq and rebuilds the same packages as above.

The only way I could pull it in was to remove all the same packages as described above and restart Emacs. Perhaps unsurprising. I presume this was necessary as the built-in seq was already loaded.

In any case, from my perspective this issue is resolved.

@radian-tidier-bot
Copy link

This thread is being closed automatically by Tidier because it is labeled with "waiting on response" and has not seen any activity for 90 days. But don't worry—if you have any information that might advance the discussion, leave a comment and I will be happy to reopen the thread :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

6 participants