-
Notifications
You must be signed in to change notification settings - Fork 152
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
Add straight--run-build-commands #535
Add straight--run-build-commands #535
Conversation
Have some spare time to look into #72. I've added a function,
For example, I'm able to now build org-plus-contrib with
However, the generated file ( In its current state, there is no way to specify commands without specifying a system name. Do we only want to support shell commands, or should we have a way to support arbitrary Elisp as well? What is the expected behavior in cases where a recipe has no generic build commands and the user's system There's also the question of how we want to express the "generic" build commands in the
straight.el has been a valuable tool for me. Looking forward to contributing something back. Thanks, Nicholas Vollmer. |
e3319e7
to
e44e65b
Compare
6425ff7
to
95e68a9
Compare
Another concern with el-get packages: It looks like el-get supports a |
3e30e60
to
308df93
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, the generated file (./lisp/org-version) is not properly symlinked yet.
Is this just because it needs to be added to :files
? If so, that's a fine solution, as straight.el
already ships hardcoded recipes for Org.
Do we only want to support shell commands, or should we have a way to support arbitrary Elisp as well?
We should support whatever el-get
supports. I do not think we should support anything further than that, though. Package authors should simply not use build commands, in my opinion, and we should not encourage that. The idea of #72 is just to steal work from el-get
, and to do that the recipe syntax must be supported.
What is the expected behavior in cases where a recipe has no generic build commands and the user's system does not match any of the system types?
Probably whatever el-get
does.
There's also the question of how we want to express the "generic" build commands in the :build alist.
Again, can we just do the same thing as el-get
? The more similar the recipes are, the easier it will be to write the adapter that turns el-get
recipes into straight.el
recipes.
Personally, I think it would be simpler to just set the path in one's configuration for mu4e rather than the recipe itself.
You are assuredly correct. Nevertheless, it will be easy to support, so we should support it. We can just cl-letf
emulated implementations of the relevant el-get
functions, somewhat like we bind variables while evaluating package autoloads.
Let me know if I missed anything. Thanks for looking at this!
f0b1af6
to
314e888
Compare
I'm still unclear about how much of el-get's recipe format you intend to support. Here's a list of the keywords el-get recipes support:
Some of these keywords offer functionality that overlaps with straight/use-package. Some do not. Grepping over el-get's recipes, 95 out of 1782 (roughly 0.053%) utilize the Thoughts? |
Absolutely. I don't want to suggest that you need to add el-get compatibility. Just a simple Please don't feel like you need to do any work that is not needed for the feature you want to implement now. |
FWIW, I've been using what we have here with manually specified build recipes successfully for Org and mu4e. I don't personally use any other packages that require build steps at the moment. Some thoughts after using this for a couple weeks: First, straight already has the notion of "buildling" a package (byte-compiling/autoloads/symlinking) so I wonder if it would be useful to come up with terminology to distinguish that "build" from the Secondly, when developing a package, one may not want to run the Thirdly, and most importantly, are security concerns. Do we want to encourage users to trust recipes that may run arbitrary system commands? Perhaps we could store a hash of the Let me know what you think and what we should work on next. |
You are very keen-eyed. Terminology is indeed a problem with Perhaps
What if, instead of running the build commands in the build directory, we run them in the source directory, before symlinking? Then, anything related to Perhaps, in the future when support for el-get is added to
Unfortunately, I think you may be a bit optimistic about our prospects here. It's impossible to make package updates secure without locking down the entire package. This is because almost every step of the build process allows arbitrary command execution. In particular, byte-compilation and autoload evaluation both give an attacker just as much power as the I have not attempted to address these problems, because they exist in every Emacs package manager and I don't see a good way of avoiding them without introducing a dizzying amount of overhead to everyday usage. There has been occasional criticism of
I think it would be prudent to make build commands be run in the source repository, if you agree about that idea, since that will be somewhat more difficult to change later. Otherwise, I would be happy to take another look at the code and then merge this pull request. |
I think sticking with the For the
I've also added the ability to eval elisp in the
Unless I'm misunderstanding, the
Yes. I definitely think we'll have to iron out some cases where straight and the recipe do the same work. Your proposal sounds like a good idea. Regarding security:
sums it up rather well. |
20cef62
to
43e3e31
Compare
Great! Although, why is there a backquote? Why not only the unquote (comma) to indicate that unlike the rest of the recipe, this one part should be evaluated?
Oh, okay -- sorry. Sounds good then.
That's odd, I don't know why that would be. You should be able to run
Please do, indeed! I would love to see improvements in this area! |
The I based the approach off of the pattern I saw in el-get recipes which utilize the
or helm:
When it comes time to add el-get support, we can just check for a leading backquote on any of the
|
Okay! I was skeptical at first, but it has grown on me. One thing that is particularly nice about your solution is that if you want to backquote/unquote other parts of the recipe to generate part of it dynamically, that won't interfere with the backquote/unquote in the |
43e3e31
to
866a987
Compare
Good news re: symlinking. I believe the problem was with my config. Made a couple of small changes to Instead of using the I've also made it so the cdr of the alist may map to a single command or a list of commands. An example demonstrating both Old syntax:
Current syntax:
|
Well, I like that the second argument doesn't have to be a list of commands, but why is it better for the default entry to look different than the others? I can see why it would be good to allow the entire |
c6910ef
to
0d020a1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great to me! (the newly added documentation)
Anything else you think this needs? |
No, I don't think so! :) |
Command takes a recipe and executes its :build and :post-build commands. Obviates the need for (and removes) straight's Org integration hack. See: radian-software#72 Co-authored-by: Radon Rosborough <radon.neon@gmail.com>
9a6de74
to
bace0fe
Compare
And the legendary saga comes to an end! Thanks so much for your extensive work on this. |
Congrats guys, this is awesome! |
Glad to see this! Congratulations
Well, I do believe that a documented example of how to solve the issue with org-mode using the new facilities should be added to the readme. I have something like this:
and, I'm getting this error every time I want to do something in Emacs:
|
@shackra See this comment on #568 - my understanding is that this will be fixed out of the box by stealing from el-get's |
okay, my issue had nothing to do with installing org, it was the
|
@shackra Glad to see that issue is resolved. I have seen a few people with But the recipe straight provides for org-plus-contrib should cover it by setting the |
If Org doesn't work out of the box with either of these forms: (straight-use-package 'org)
(straight-use-package 'org-plus-contrib) then it's a bug, since |
How should this look look like with |
This is documented in https://github.com/raxod502/straight.el#integration-with-use-package-1.
|
@raxod502 why are some using #624 (comment) (use-package org
:straight org-plus-contrib I can't figure out how I could derive that from the docs you cited above. |
relevant part of that section of the docs:
In the example you gave, people are installing the development version of org + contrib files, but the feature provided by that package is still called org: (use-package org
:straight org-plus-contrib) expands to: (progn
(straight-use-package 'org-plus-contrib)
(require 'org nil nil)) |
See also https://github.com/joddie/macrostep, which I find very helpful in answering questions about how macros expand. |
Previously discussed here: radian-software#535 (comment)
Missed this in radian-software#535 Previously discussed here: radian-software#535 (comment)
Missed this in #535 Previously discussed here: #535 (comment)
Straight now always overrides the default Org recipe to include the expected build command. This may soon blow up in my face, as Make, which is required for the build command to work, will possibly not always be globally available on my systems. Also see radian-software/straight.el#535
Command takes a recipe and executes it's :build commands.
See: #72, #389