Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

Added webinterface option for C++ chat client, small Rust config changes #70

Merged
merged 2 commits into from
Dec 14, 2022

Conversation

kieranjazy
Copy link
Contributor

Added C++ web interface available by default. Can be disabled by removing --webinterface from Enarx.toml. Uses port 8080. Made small changes to Rust files to fix broken file locations

@rjzak
Copy link
Member

rjzak commented Nov 9, 2022

A better way to do things might have been to rebase #69 and update.

  • So you make your changes.
  • git commit -as Commit you new changes
  • git rebase -i HEAD~2 Compare last two commits
  • Replace the pick with f
  • Save, and git will "fix-up" the commit with the next commit, keeping the history clean.
  • git push -f origin <my branch> to force push, and if you have an open PR, it'll be automatically updated.

Also, you should probably work in a new branch instead of main. This is easy:

  • git checkout main
  • git pull origin main to get any changes which might be in your repo
  • git remote add upstream https://github.com/enarx/codex.git add the main repo as the "upstream"
  • git fetch upstream get the upstream history
  • git rebase upstream/main get the latest changes from upstream, add to your main
  • git push origin main freshen up your copy of main
  • Make some changes to your code, don't commit yet!
  • git checkout -b <my_new_branch>
  • git push origin <my_new_branch>
  • Open PR against your branch
  • Updates (shown above) will automatically update your PR, don't need to close and make new ones!

If you have any questions, let me know, or ask in the Enarx chat.

A tutorial: https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase
An example: notice all the force push messages enarx/steward#70

@kieranjazy
Copy link
Contributor Author

kieranjazy commented Nov 9, 2022

Would it be OK to merge this PR as it is now or should I add it all to a new branch? Was trying to squash all the commits into one but didn't get it right

@rjzak
Copy link
Member

rjzak commented Nov 9, 2022

Don't worry about having a new branch this time.

It seems one of the checks is failing because assets.h can't be found, perhaps @rvolosatovs will be able to assist.

@kieranjazy
Copy link
Contributor Author

I've it fixed on local, was using your python script to generate the webpage assets but didn't realise it'd break something so I've included it. I'll upload final commit now and solve merge issues

@rjzak
Copy link
Member

rjzak commented Nov 9, 2022

That's fine for now, but the Nix code should be updated to generate assets.h instead of including it.

@kieranjazy
Copy link
Contributor Author

That's fine for now, but the Nix code should be updated to generate assets.h instead of including it.

Ah ok, I'll look into Nix, haven't used it before

@kieranjazy kieranjazy force-pushed the main branch 2 times, most recently from 1cb75a1 to 9a96e63 Compare November 9, 2022 21:17
@nickvidal
Copy link
Member

Hi @kieranjazy, I tested your PR and it works great. Thanks!

@kieranjazy
Copy link
Contributor Author

Thanks Nick, just struggling to get Nix to run a Python script for me, still working on it

@rvolosatovs
Copy link
Member

That's fine for now, but the Nix code should be updated to generate assets.h instead of including it.

I don't think we need that, at least it should not be a blocker for this PR, this warrants more discussion. Can we file a "goldplating" tech debt issue about it and get this merged?

@kieranjazy kieranjazy force-pushed the main branch 2 times, most recently from d5c539c to e88569b Compare November 11, 2022 16:36
demos/chat-client/Enarx.toml Show resolved Hide resolved
demos/chat-client/Enarx.toml Outdated Show resolved Hide resolved
demos/chat-client/c++/README.md Outdated Show resolved Hide resolved
demos/chat-client/c++/compile_run.sh Outdated Show resolved Hide resolved
demos/chat-client/c++/main.cpp Outdated Show resolved Hide resolved
demos/chat-client/c++/process_assets.py Outdated Show resolved Hide resolved
demos/chat-client/c++/process_assets.py Outdated Show resolved Hide resolved
demos/chat-client/c++/README.md Outdated Show resolved Hide resolved
demos/chat-client/c++/assets.h Outdated Show resolved Hide resolved
flake.nix Outdated Show resolved Hide resolved
@rvolosatovs
Copy link
Member

@kieranjazy I believe the outdated wasi-libc issue is now solved, but the code still fails to compile with:

chat-client-wasm32-unknown-wasi> /nix/store/fxasr4jvncasd20wkisj6wf78gyww84y-c++/main.cpp:17:21: warning: unused variable 'HTTP_NOT_FOUND' [-Wunused-const-variable]
chat-client-wasm32-unknown-wasi> const unsigned char HTTP_NOT_FOUND[14] = "HTTP/1.0 404\n";
chat-client-wasm32-unknown-wasi>                     ^
chat-client-wasm32-unknown-wasi> /nix/store/fxasr4jvncasd20wkisj6wf78gyww84y-c++/main.cpp:19:21: warning: unused variable 'CONTENT_TYPE_PLAIN' [-Wunused-const-variable]
chat-client-wasm32-unknown-wasi> const unsigned char CONTENT_TYPE_PLAIN[27] = "Content-Type: text/plain\n\n";
chat-client-wasm32-unknown-wasi>                     ^
chat-client-wasm32-unknown-wasi> 2 warnings generated.
chat-client-wasm32-unknown-wasi> /build/.attr-0l2nkwhif96f51f4amnlf414lhl4rv9vh8iffyp431v6s28gsr90: line 3: -o: command not found

flake.nix Outdated Show resolved Hide resolved
demos/chat-server/rust/.cargo/config Outdated Show resolved Hide resolved
demos/chat-server/rust/Cargo.lock Outdated Show resolved Hide resolved
@rvolosatovs rvolosatovs enabled auto-merge (rebase) December 14, 2022 17:12
@rvolosatovs rvolosatovs merged commit 367e3fb into enarx:main Dec 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants