-
Notifications
You must be signed in to change notification settings - Fork 11
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 build scripts and optimized GitHub Actions #1860
Conversation
eb9a452
to
bcab3f5
Compare
Building the wasm version fails for old (20.04) ubuntu installations. Not an issue, but should probably be mentioned somewhere. I didn't capture a log, but it was to do with aqt needing a newer version of python than what you get with that old ubuntu. Building the wasm version works fine on a fresh ubuntu 24.04 vm.
I can see that the file was downloaded to /tmp, and if I run the command manually: |
If I manually install the toolchain:
... then source the environment setup stuff: ... then start the gx build, I get an error:
|
I only have a linux box, I can't test this for mac or windows. Would you expect it to work on these platforms? |
I understand these scripts make it easier to build, in terms of combining the package installation + configure + build steps, but should these scripts really be in the repo? It looks like they have various specific requirements/assumptions (e.g. Linux builds, doing clean builds, putting build dir inside the repo) so that it may often be easier to build without the scripts. Or, in other cases it is simple enough that you don't need a separate build script (e.g. build-gx.sh). I'm not sure how much benefit we get from adding these scripts, as opposed to having some improved build documentation, and this also creates additional tools that need to be maintained going forward. |
@DanielMcInnes if you install manually the Victron SDK you need to create a symlink for
This sould already be fixed. It was because the command executed was I tested it on a fresh Ubuntu VM, on Windows with a WSL Ubuntu container and GitHub Actions. All mentioned use Ubuntu 24.04. The scripts won't work natively on Windows. For macOS I'm not sure, but don't think that it will work, since @blammit the idea was to make it easy for community members to build the GUI and therefore also to make it attractive for developing and testing custom modifications. It's easy to build the GUI if you have QtCreator installed, but if you have not (like me and nearly all of the community), then this is quite a pain. It's also very complex to setup QtCreator correctly, see #492 and #1389. This scripts also reduce maintenance for build scripts used in GitHub Actions, since all needed data is now fetched from the prepare script and those scripts are run to build the wasm file in the GitHub Actions. From my point of view, this is a huge benefit, since:
|
bcab3f5
to
618140b
Compare
I like the added convenience this brings to linux users, especially building and installing mqtt. I imagine similar scripts would be required for windows & mac users, resulting in 3 sets of build scripts that need to be maintained, which is not ideal. I think this would be better done via cmake, which would give you the same build behavior on all 3 platforms. See For mqtt, you can do something like:
|
@mr-manuel That's true it would be
|
@blammit you wrote:
Sorry but I don’t agree. Its the opposite. For people to try this out they need to be able to try this very simply without installing and setting up many things. Ie. change a qml file and run the build. As long as the script works for our github actions + linux + linux on windows then I’m happy. And mac os is an extra nice to have. By the way: all the rest of Venus OS is also oriented towards linux only; probably builds on Windows using its linux extensions, and might/or might not run on Mac OS; which is fine. |
Wrt cmake: doesn’t that make it all a lot less readable? Lets keep it simple. |
5dcad48
to
240ad56
Compare
My mistake, I meant to say, "it would be nicer than building with Qt Creator...". I agree it's certainly easier for people to try it out if they don't need to download the tools and Qt Creator, etc. I'm just not sure adding build scripts to the repo is the way to go here. These would need to be regularly verified/maintained/supported, and if they don't work for different users' configurations then they will need to do their own hacking anyway. In that sense they seem more like templates for building. But maybe that will be obvious to community members and not really a problem there.
Yes it's definitely more work to use cmake, and not as simple as adding build scripts. If we really need build scripts inside the repo then I'm happy to go ahead with it. @mr-manuel there are already scripts under |
2d388c1
to
c275618
Compare
I moved the scripts, added some notes and prepared them for supporting installation of the requirements on ARM64 architecture (like Mac's with M chip). @dirkjanfaber as we wrote, I moved the POEditor scripts from |
@blammit to make sure all scripts work correctly I can also add a GitHub Action that tests the scripts once they change or the |
Yes that seems like a good idea, to make sure they are verified regularly.
Initially I was thinking this would be better as it would tidy up the root directory, but it does mean the scripts are harder to find, if we want to encourage community members to use them for building. I'm not entirely sure either way. Note, the build instructions in the README should also be updated. |
Thanks! Looks great, for the most part. I think we still need the "manual" instructions in the wiki, to ensure that we support folks who don't use Ubuntu 24.04 or higher, and also because I think there is still value in desktop (Windows / Mac OS X) builds for fast-iteration testing. |
After this PR I would also add a short description on how to launch the build scripts on Windows and macOS. In your case you mean on how to build natively to start the GUI on Windows or macOS? |
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.
lgtm
- Use build scripts of the repository - Load environment variables from `scripts/.env`
c275618
to
023a960
Compare
This is not needed anymore since #1801
Rebase was done to include the changes to the |
Some script were added to make it much easier for everyone to locally build GUIv2 for a GX device and as WebAssembly. Currently it works only on X86 processors, due to currently used Emscripten (not for all versions ARM64 binaries are available) and Qt versions (only since 6.7.0 it appears that binaries are available to the community, else a license is required).
GitHub Actions were also modified to execute the new scripts, which makes maintenance less time consuming. For example the emscripten and QT version are now always fetched from an environment file and do not need to be updated in multiple scripts, GitHub Actions and wiki:
gui-v2/scripts/.env
Lines 1 to 3 in a4b7bc1
I tested the scripts on:
After this PR is merged, also the wiki has to be modified and simplified.
I added also a
.gitattributes
file to fix automatically the line endings of.env
and*.sh
files, else they were always converted toCRLF
instead ofLF
.