-
-
Notifications
You must be signed in to change notification settings - Fork 14
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 ability for PPM to run electron-rebuild
automatically
#126
Comments
Hmm, to clarify, On the other hand For example see here. |
Yeah, you described it quite well in Discord and I made a hash of the paraphrase. I still don't understand when/why some packages need In the case of The thing that Complicating things is the fact that |
The next time I update something in the The I'll try to dig into which dependencies are causing problems for |
One possible issue - I think that I was having some trouble with
Running |
oh nice! tested |
They sort of do the same, and the difference is a potential pitfall that is indeed confusing.
|
I think this should just work as Having to bring |
I'm curious if we can find a way for you to experience the effects of this issue without buying you an Apple Silicon laptop. Maybe, with a bunch of logging within |
If I had to guess when this might have broken, perhaps it was #95?? Our CI tests might not be comprehensive enough to have undertaken such an ambitious rewrite without a ton of manual testing of every command... Hmm. EDIT: And for the record, some manual testing was done, just not comprehensively for every sub-command, as it was looking like it'd block the PR indefinitely at the rate manual testing was going. |
Speaking for myself, I remember having problems rebuilding native packages since the Atom era - so I'm unsure if it's something we did, actually. |
I've been looking into this one, and I wanted to start off at the beginning as well, since you also said Keep in mind the data I'll layout below is not complete, and is missing many details, I've trunicated data to only focus on what we care about.
So a little confusing I know, but I tried to fit a lot of data about the hierarchy of how things are running once you hit install. The jist of it is, the beyond behavior being wildly different based on where the package comes from, we take minor steps to get native module info into Pulsar as soon as we install. But beyond anything But from looking at the CoffeeScript on This doesn't touch at all though on why EDIT This may help explain why So we do the exact same thing in EDIT EDIT And if what you are referring to as the rebuild part of Pulsar, I think I found it.
A final EDIT: I've looked into package activation on Pulsar, and deeper at the But saving this data seems to be it's full purpose. So a summary of my long winded ranting.
But that's it, seemingly that's all that happens during the rebuild process, with my being unable to find the link to an actual rebuild process. But what's also interesting I've taken a look at where we use
The package manager determining incompatibility of a package is what triggers the native module warning, so at the very least we know everything above is functional. This is actually perfectly summarized by a comment left on the original nearly unchanged (in the
Seems |
One way to test this would be to run I have a theory that direct native module dependencies of packages get built just fine, but transitive dependencies don't. That would explain why
The symptoms in the latter two cases weren't exactly the same. In When I buy an Apple Silicon machine (later this year, perhaps) I'm going to make sure to solve all these mysteries if they haven't yet been solved. |
I am mildly skeptical around Hydrogen and So, if I could be wrong, and removing the need for end-users to be able to compile native modules on the fly would be an amazing goal to work toward, but it's possible we're running into something EDIT: I suppose we could work around package authors defeating the "one true blessed way" to make native dependency building work, but I'd rather bonk those package authors into submission until they relent from breaking the mechanism that causes packages to reliably install on many diverse systems. Hypothetically, until the above might be confirmed, as it's speculation. Though if memory serves, I tried but failed to dissuade one certain past collaborator from doing exactly this, for exactly this reason. And was not able to persuade them at the time. |
I might implore to not get distracted by Indeed, the main way this is being handled is in Indeed, EDIT to add (a mild ramble/rant, speculating about why these packages in particular are broken -- the above info is the important background context, IMO): I might speculate these particular packages have an explicit |
Have you checked for existing feature requests?
Summary
Atom occasionally needed to rebuild the dependencies of community packages. For one thing, some NPM packages don't have prebuilds for some platforms. And when Atom upgraded its own version of Electron, that would require a rebuild of the native modules of previously installed community packages so that they could work with the new Electron version.
It seems that this used to be possible simply by running
ppm rebuild [package]
. That command delegates tonpm rebuild
(usingppm
's internal copy ofnpm
, of course). And Pulsar's builtinincompatible-packages
package offers a GUI for performing this task — which internally just shells out toppm rebuild
.Nowadays, however, this doesn't seem to be enough; these tasks claim to work, but don't produce modules capable of working in Pulsar. One possible fix for this problem would be to rewrite PPM's
rebuild
task to delegate toelectron-rebuild
.This will require two things:
pulsar
the way that thetest
tasks seems to do, taking care to ensure we're finding the version of the command that pairs with the version ofppm
that's currently running. (In other words, don't just runpulsar
and rely onPATH
to find it.)electron-rebuild
to be a dependency ofppm
. Currently it's only a dev dependency of Pulsar itself, while PPR doesn't require or use it at all.I'm inclined to assume control of the existing
rebuild
task here because I don't think that it does anything thatelectron-rebuild
won't be able to do, but I'm happy to discuss that if anyone is concerned about it.The short-term goal isn't to do anything magical or fancy with this — just to make it so that
ppm rebuild [package]
actually does what it says on the tin, instead of being seemingly useless. If this works, we can have a discussion about whether this should be a mandatory post-install task for a given package. Ifelectron-rebuild
understands when it does not need to rebuild a module, then I don't see a downside to doing this, but we don't need to decide it now.(Reminder to myself or someone else: before working on this, I know I need to understand the installation process better, and exactly what happens when
ppm
installs a package that uses native modules. For instance, I've never need to runelectron-rebuild
on any package that uses@savetheclocktower/atom-languageclient
, even though it has a dependency with a native module. Why is my experience different from that of @mjrodgers (as reported in Discord)? He's on ARM64 and I'm on Intel, but surely a native module would need a rebuild anyway for an Electron environment, right? I should try to run (e.g.)ppm install --verbose pulsar-ide-typescript-alpha
in a clean environment and pore over the output to see if I can answer these questions.)What benefits does this feature provide?
Easier package installations.
Any alternatives?
@mauricioszabo wants a fix that doesn't depend on PPM, but that can be pursued in parallel.
Other examples:
No response
The text was updated successfully, but these errors were encountered: