webui-dev / v-webui

Use any web browser as GUI, with V in the backend and modern web technologies in the frontend.
https://webui.me
MIT License
112 stars 11 forks source link

Replace WebUI C source files with a setup script #37

Closed ttytm closed 1 year ago

ttytm commented 1 year ago

This PR removes the need to keep the WebUI C source files in the repository.

It adds a cross-platform setup script to build the latest git version of the parent library. We can use it to prepare the V wrapper to the latest changes before the upcoming release. As soon as the next version is released, will be simple to extend the script to use the pre-built release files as main source. Until we have the releases the library is built with GCC for the platform the script is executed on.

When checking out the PR branch, you should be able to run the script - adding exec rights might be necessary:

./setup.vsh

# Windows
v run setup.vsh 

Test if the examples build:

cd examples
v run minimal.v

cd text-editor
v run text-editor.v

# On windows don't use V's default TCC for quick-compilation / development but GCC
v -cc gcc run ...

The process of executing the script will remain the same after adding the handling for pre-built releases. So I think we can merge it on main and develop from there. Users who want to pin a version can pin a commit or a tag. It's not a crime to develop on the main branch.


For next changes:

@malisipi please let me know if that's without problems for you to grant merge-rights for my account for the V repository. With the lots of changes we are making it might be easier to be able to allow for quick fixes. I would do my best to use it carefully as stated here: https://github.com/webui-dev/webui/issues/171#issuecomment-1689062349

malisipi commented 1 year ago

Hi, @ttytm ! For me, there're no problem about it. Also it would be good since i have not much time to maintain this repo by my education. However I don't have permission to do it. @hassandraga can give access for you.

malisipi commented 1 year ago

The build script fails for me.

[malisipi@malisipi-20351 vwebui]$ v run ./setup.vsh 
Cloning...
git clone --depth 1 https://github.com/webui-dev/webui

Building...
Build WebUI library (gcc release static)...
Build WebUI library (gcc release dynamic)...
Done.
cli execution error: cp: failed to write to /home/malisipi/.vmodules/vwebui/webui
ttytm commented 1 year ago

Thanks for the report @malisipi,

can you tell me the platform you run it on? This might be an issue with the webui/ directory that is currently in the repository and that it's still cached locally after removing it if you already had it. If you still have the directory can you try to remove / rename it and try again. If that works I see that this gets fixed.

malisipi commented 1 year ago

@ttytm It's Garuda Linux that based on Arch. I was inspected the error. It seems like a V error. Line 69 is throwing an error. After moving the /tmp/webui/dist folder manually, everything went fine.

malisipi commented 1 year ago

Also I'm glad to you was joinied Webui.

ttytm commented 1 year ago

Thank you for saying so :pray:

I do my best to fix the issue today and update the workflows to cover the change.

hassandraga commented 1 year ago

Permissions added.

ttytm commented 1 year ago

Thanks alot!

With your go, this one is ready for departure 🚂

I'd update the other PRs after this one.

hassandraga commented 1 year ago

After we ensure this workflow is fine, we may copy it to other wrappers.