-
Notifications
You must be signed in to change notification settings - Fork 1k
Conversation
I do this exact thing in nexe. |
Any update on this? |
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.
@geekuillaume The build is currently failing due to eslint errors.
@n1ru4l I fixed the linting errors but the Travis CI process seems to be broken (same error on master). |
I tried this out and was able to bundle Theia pretty smoothly on Linux. This is really awesome, hopefully it can get merged soon. Thanks for the great work! |
However, on windows:
|
@nklayman is it occurring only on Windows and working without pkg? This error can also be caused if the |
The error is only on windows and the code works fine when just running with node, the issue is only present when running the |
Any update on this? It seems like a high priority PR based on the opened issues. |
@noraibrahimi It seems the tests are broken on master. There is no activity on this repo, seems like the project has been abandoned by Vercel. @igorklopov do you have more information about the state of this project? |
@geekuillaume I think some changes have been pushed yesterday to master branch (which might be a fix for why the build is failing), maybe you could try rebuilding it again? |
Hello everyone, I'm trying to get pkg working with
I've tried EDIT: Here is my
|
It seems like the patch in this pull request doesn’t with sharp. The same issue is happening for me on macOS. I got it to work by using the official
I copied Of course, this is annoying, and it suggests that the code in this pull request isn’t fixing the issue 100%. So far the code in @leafac/pkg is just the code I found here and packaged for distribution. I’ll investigate alternatives to Meanwhile, you can help me in the investigation by trying the tools I mentioned in the comment above on your project. |
Any updates on this whole situation I've tried nexe + nexe-natives with no luck I am experience the same issue as Winexcel where the patch moves my .node file to the temp folder but doesn't seem to be able to do anything with it @leafac |
Very-Early Announcement of a New Approach to Packaging: caxaI did my investigation and learned that there isn’t a satisfactory solution to my problem, so I’m cooking something up which I’m calling caxa. It isn’t ready for consumption yet, but I wanted to check in and let y’all in the loop. Here’s a few details (more to come in the near future): My Requirements
Prior ArtUnfortunately, all packaging solutions I could find either require you to compile Node.js from scratch, which is slow (hours!) and consumes ~10GB of disk(!) (boxednode, Node Packer, and so forth), or they don’t support native extensions transparently (pkg, nexe, and so forth). I decided not to invest in pkg anymore, and when I release caxa in the next few days I’ll deprecate @leafac/pkg. (Note that I’m far from being the maintainer of pkg, I’m just a random dude who passed by…) How caxa WorksThe root of the problem seems to be that Node.js insists on loading The workaround for native extensions in this PR and in other packaging solutions is to put those caxa takes this approach to the next level and achieves blissful simplicity and robustness. It puts your project alongside the Node.js in a self-extracting archive. Limitations
What We Have so Far
What’s Coming in the Next Few Days
What’s in the Namecaxa is a misspelling of caixa, which is Portuguese for box. I find it amusing to say that I’m putting my application in the caxa. |
@leafac Nice. I hope it's a nice replacement for this repo. Also, please maintain it actively, because I just hate repositories and their owners like these ones where it's used a lot by many projects/people/companies, but no one is fixing issues or implementing new features. Second, don't worry too much about cross-compiling on a single system. If it works, it'd be nice, but this is up to the user and I currently solve this problem myself using Github Actions. I use |
This is cool if you need someone to test builds on windows I'm willing too |
@leafac Please notify us here when it's ready to be used in production including docs and windows support. |
@leafac Sounds great! Watching with keen interest. I have finished my first take on automated cross-platform support. It should work with any native node module that supports prebuild-install (which seems to be most of the major ones). You can see the code here: https://github.com/david-mohr/pkg/tree/feat/addon2 This also supports "manually" adding prebuilt files if required, but keen for everyone's feedback if this meets the basic needs. I can put a PR onto @leafac/pkg if that helps |
@david-mohr: Thanks for work 😃 Please don’t send the pull request to @leafac/pkg. I’m about to deprecate it in favor of caxa (see comment above). I’m not pursuing the idea of cross-compilation for the moment. I learned that’s really hard to get right in some cases and I think that packaging should be as unsurprising as possible. I dislike the idea that you’d add a dependency to your project and all of the sudden your packaging no longer works. |
@leafac fair enough. If there's interest, I can publish my branch for those that still require cross-compilation. I'll keep caxa in mind for the next project. |
Hey everyone! Sorry for the slow responses here from the maintainers. I'm Lee from Vercel and I'll be helping review / merge PRs. There's a lot of context and discussion in this PR, so I'm hoping to lean on the community and contributed here for recommendations going forward.
Any and all context would be helpful! |
@leerob I've been using the code from the PR as-is with my project, and it works fine. From the conversation, there's edge-cases where it's not working because the .node addons require DLLs that can't be bundled. And thank you for taking up maintainer duties! |
@leerob Hi Lee, it's been quite a while since I've worked on this PR. I'm not using it anymore for my usage so I've stop participating here but feel free to use what I already did as it seems to work for most use. |
@leerob You can check my fork, because I've fixed another issue there in the master branch (based on this PR) in order to built for Windows properly, which works for me inside Github Actions, but some people also say that they run into issues, even with my fork. |
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.
It sounds like this solution has been working for those who have forked. I'm okay with going ahead and merging this, and feel free to contribute back edge cases that have been found from other forks.
Sorry again for the long wait here and thank you for everyone who has contributed to this discussion 🙏
Hello everyone, caxa 1.0.0 is out 🙌 📦It’s ready for y’all to try out and I’d love to hear your feedback. Highlights
@leerob: Thanks for taking up the mantle! pkg is awesome and I’m happy to see it receive some attention. Though I know how these things go: open-source is hard. In any case, I recommend you go to my now-deprecated fork at https://github.com/leafac/pkg and grab the implementation of Also, would be so kind as to mention caxa in pkg’s README? It’s a different approach that solves some of the issues with pkg, for example, support for all Node.js versions and ease of use without having to declare assets (while not solving some things that pkg can do, for example, hiding the JavaScript source). (More detailed comparison) |
@leafac Please do not excessively advertise here 🙏 But thank you for contributing and |
This adds the supports for Nodejs native addons.
How it works:
.node
file, it will package it like an asset and not output any warning.require
ing a.node
file, it will use the same code as classic files to detect if the file is in the snapshot or not. If it is, it will write it to a file in theos.tmpdir()
directory.Potential future optimizations:
bindings
module to detect the correct modules.Related #329 #619 #749 #663