-
Notifications
You must be signed in to change notification settings - Fork 194
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
Unable to build from source #562
Comments
I just referenced this in another issue; I'm pretty concerned that laserweb could easily become abandonware unless we can find a way to maintain it against the relatively fast moving npm dependency chains, browser requirements, evolving web standards, etc. The first need is to get to the step 2) in your scheme and use this as an opportunity to bring dependencies up to date as far as possible. I hope that could solve the scrollbar issue, for instance. I'd be useless at that but I could help with step 3) since I am a CM/Build/Devops engineer by trade. Critically, if we can get there then we can think of how to extend Laserweb for new controllers and maybe work on a more responsive interface. |
The situation is, that all frontend devs have left the project. I'm the only dev left, but my part is the backend (lw.comm-server). I'm not realy familar with react/redux/webpack of the frontend. I would be very happy if someone could help to upgrade all dependencies and bring the whole project to a state where also unexperienced devs could compile it. What's important:
|
@cprezzi ; Thankyou for the reply, taking the time to explain things is really appreciated :-) I didn't realise electron was involved (new to me..) but I pretty easily got the demo running. I hope this is not a naive question; its electron only used for building the windows executable?
|
@awhitty ; is there any chance you could look at getting a sensible/valid package.lock together; either for the Not: I consider laserweb feature complete for my use. There will always be a big list of improvements it could have, but it currently fits my workflow perfectly. |
@easytarget You don't need the electron branch for development. It's only needed for building the Windows and OSX executables/installers. The frontend (LaserWeb4) and backend (lw.comm-server) are theoretically independent applications that just communicate via websockets. For convenience, the backend nodejs webserver also serves the frontend webpack files. This means it's enough to clone lw.comm-server and run "node server.js", then access the frontend with a chrome or chromium browser on IP port 8000 (like documented in the Raspberry Pi wiki). For frontend development, you just need LaserWeb4/dev-es6. If you also want to test the server communication, manually start lw.comm-server before testing. |
I brought the LaserWeb4 dev-es6 branch and lw.comm-server master to a state where I could compile both under nodejs 10.16.3. To get that working, you have to:
After updating something on the frontend:
I hope this gives you at least a start point which can be compiled! |
Thanks for the replies @cprezzi and @easytarget! The additional context is very helpful. I’ll take a look at the changes you made to both repos to understand a bit more about what was going on, and I'll follow those instructions! I’m happy to PR changes to introduce a A few other things on my mind, though these topics are mostly unrelated to this specific issue:
|
|
@cprezzi Thanks for answering my questions! I'll assign PRs to you then. Regarding roadmap, I think we should comb through the GH issues a bit and look for some common themes. Once we get a consistent build working (I think #573 gets us there), it'll be time to prioritize feature work, and that prioritization can inform which other sorts of tech debt are worth addressing sooner vs. later. Regarding controller support, that makes sense. I'm not yet familiar with how marlin differs from grbl or what else is out there, but I trust that judgement 😛 |
@awhitty I've invited you to the admins of the LaserWeb oragnisation, so you can do what's needed in all our repos ;) |
@cprezzi By the way, this hasn't fallen off my radar! Just got back from a long vacation, so I'm picking things back up slowly. |
I am not able to build the application using ubuntu, 19.10, node v13.13.0, SyntaxError: Unexpected token '<' I tried another way by executing npm install when executing `> [email protected] install /home/mfadel/Projects/LaserWeb4-dev-es6/node_modules/lw.comm-server/node_modules/serialport
prebuild-install WARN install No prebuilt binaries found (target=13.13.0 runtime=node arch=x64 platform=linux) ../src/serialport.cpp: In function ‘void EIO_AfterOpen(uv_work_t*)’: ../src/serialport.cpp: In function ‘void EIO_AfterUpdate(uv_work_t*)’: ../src/serialport.cpp: In function ‘void EIO_AfterClose(uv_work_t*)’: ../src/serialport.cpp: In function ‘void EIO_AfterFlush(uv_work_t*)’: ../src/serialport.cpp: In function ‘void EIO_AfterSet(uv_work_t*)’: ../src/serialport.cpp: In function ‘void EIO_AfterGet(uv_work_t*)’: In file included from /home/mfadel/.cache/node-gyp/13.13.0/include/node/node.h:67, In file included from /home/mfadel/.cache/node-gyp/13.13.0/include/node/node.h:67, In file included from /home/mfadel/.cache/node-gyp/13.13.0/include/node/node.h:67, ../src/serialport.cpp: In function ‘void EIO_AfterGetBaudRate(uv_work_t*)’: In file included from /home/mfadel/.cache/node-gyp/13.13.0/include/node/node.h:67, ../src/serialport.cpp: In function ‘void EIO_AfterDrain(uv_work_t*)’: npm ERR! code ELIFECYCLE npm ERR! A complete log of this run can be found in: What should I do? Where do I start from to build this application? |
I tried this I get `> [email protected] installdev /home/mfadel/Projects/LaserWeb4-dev-es6
fatal: not a git repository (or any of the parent directories): .git npm ERR! A complete log of this run can be found in: |
I tried the same using Laserweb4 4.0.994 version, got the same results, |
I was able to build the software by changing node version to node 10, but now when I run the application I face another problem: `Module not found: Error: Can't resolve '../data/lw.materials/materials' in '/home/mfadel/Projects/LaserWeb4-dev-es6/src/components' ERROR in ./src/components/about.js ERROR in ./src/reducers/machine-profiles.js ERROR in ./src/reducers/material-database.js ERROR in ./src/reducers/material-database.js How can I solve this? |
I copied the files from the https://github.com/LaserWeb/lw.machines and https://github.com/LaserWeb/lw.materials and it worked |
I suggest adding this to the wiki like how to build from source, I couldn't found it there |
@mfadel85 Thankyou for posting that, I was able to get a from scratch install from source working now. I did this on a 'vanilla' freshly installed Pi3B+ with Buster, and captured a log of it all. Appears to work well and the sidebar issues are resolved. (although I see another bug, I'll report that separately since I'd like to reproduce in chrome/windows first.) I think this can be closed now ;-) |
@easytarget Thank you alot for writing all this down and making it public! This will help new users to get it working. |
Hi LaserWeb folks 👋
I've been using LaserWeb for a few days through a binary on the releases page and have been generally pleased with how well the software works! I'm still familiarizing with the project, so I hope you'll bear with me.
The Issue
I would like to contribute to the project, so I cloned the repo and ran
npm install
andnpm run installdev
. At this point,npm start
fails with an error related to a dependency:This is due to a version mismatch between what's expected in the
lw.comm-server
library and what's being installed. That module'spackage.json
specifies"dotenv": "*"
, and there appear to be breaking changes indotenv
(folks userequire('dotenv').configure(...)
these days).Digging in a little further, I noticed that npm 5's
package-lock.json
was intentionally ignored in this repo's.gitignore
file. Apackage-lock.json
in this repo would have prevented that breaking change in the short run, but the issue would still have shown itself if folks worked on thelw.comm-server
package independently.I also noticed while running
npm run start-app
that the webpack build fails due to a missingobject.omit
dependency. Sure enough,src/reducers/index.js
imports fromobject.omit
, but the dependency is not listed in thepackage.json
. I assume this was working for folks due to its presence as a transitive dependency?Recommendations
This is as far as I have gotten so far. I have a few recommendations that I think would open this project up for more third party contributions in the future. I've ordered them from smallest scope to largest:
Remove
package-lock.json
from this repo's.gitignore
file and commit a workingpackage-lock.json
to the repoThis change at the least should enable other developers to work on this project without spending too much time fiddling with dependencies.
Use exact package versions for all
package.json
s for this repo as well as the otherlw.*
packagesIt's very rare that something like
"dotenv": "*"
is actually a useful declaration in apackage.json
. Instead I recommend installing packages with the--save-exact
flag to pin to the exact version. This policy, in addition to thepackage-lock.json
change, should eliminate a class of issues related to breaking changes in dependencies and transitive dependencies.The tradeoff here is that folks won't always get the latest features from a new version of a package "for free". The truth is is that they never really did get them for free. Developer A might make a change to use a method introduced in version 2.6 of a package while Developer B is still using version 2.5. Developer B might pull Developer A's changes and notice that the code has broken. Developer B has no way of knowing whether Developer A wrote buggy code or if Developer B's packages are out of date compared to Developer A's local setup. Requiring developers to save the exact version of a package in the repo eliminates this ambiguity.
Tools like Greenkeeper can reduce the friction of keeping packages up to date. In my experience, this hasn't actually been as necessary as folks would expect.
Introduce a CI tool to ensure this repo can always be built from source
I noticed y'all listed "Automate Electron Builds for all platforms" on the wishlist inside the readme. Introducing a CI workflow that ensures the project can at least be built from source in a development context is a good first step in this direction. A lot of the groundwork here could be repurposed into an automated testing rig as well as an automatic build system, and both would open this project up to more contributions.
Consolidate all
lw.*
packages into a monorepoThis suggestion might be a bit controversial, but given that this project has many associated packages that need to change in tandem, it may be easier to keep track of the history of the project and coordinate cross-cutting changes if every package were checked into the same repo. This approach works well for projects like React and Babel, and I imagine it would work well here too.
I'm not sure if y'all are familiar with Lerna, but it's a tool that reduces the friction around managing a monorepo of multiple packages.
tl;dr
I couldn't build from source, there's a few issues precipitating that, I have some suggestions for how to eliminate those issues, and I'm happy to incorporate those suggestions if y'all are open to them. Thanks for making useful software!!
The text was updated successfully, but these errors were encountered: