ThetaLang / Theta

θ A statically typed, functional programming language that compiles to WebAssembly
https://theta-lang.org
MIT License
38 stars 10 forks source link

Build: linux build issues #30

Closed AbdelrahmanKhaledd closed 2 months ago

AbdelrahmanKhaledd commented 2 months ago

I tried to build the project on Linux, but there were many problems:

This action runs on linux with the same errors.

alexdovzhanyn commented 2 months ago

@AbdelrahmanKhaledd Yeah so that lower-case thing has been going on and off for a few weeks. Something in the toolchain is randomly changing the file names and I keep changing them back. Renaming the files to the correct case locally should fix the issue.

It looks like that action you link compiled successfully, but then failed when trying to run the tests. I did a bit of digging into that error you were seeing and it looks like it was caused by some weird bug in Githubs runners, but should be fixed now. I suspect if you run your action again it will work.

Which headers were missing that weren't added by the compiler? Everything should be getting linked by cmake, so if something is missing on Linux that'd be great to know!

AbdelrahmanKhaledd commented 2 months ago

that lower-case thing has been going on and off for a few weeks. Something in the toolchain is randomly changing the file names and I keep changing them back. Renaming the files to the correct case locally should fix the issue.

@alexdovzhanyn It fixes including files, but there will also be compiling errors:

ThetaLang/src/compiler/CodeGen.cpp:216:22: error: cannot convert ‘std::pair<std::__cxx11::basic_string<char>, int>’ to ‘int’
  216 |             make_pair(assignmentIdentifier, idxOfAssignment)
      |             ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                      |
      |                      std::pair<std::__cxx11::basic_string<char>, int>

ThetaLang/src/compiler/CodeGen.cpp:245:13: error: ‘assignmentIdentifierPair’ was not declared in this scope
  245 |         if (assignmentIdentifierPair) {
      |             ^~~~~~~~~~~~~~~~~~~~~~~~

ThetaLang/src/compiler/CodeGen.cpp:319:52: error: ‘class Theta::SymbolTableStack<std::shared_ptr<Theta::ASTNode> >’ has no member named ‘lookup’
  319 |             shared_ptr<ASTNode> paramValue = scope.lookup(paramName).value();
      |                                                    ^~~~~~
ThetaLang/src/compiler/CodeGen.cpp:94:52: error: expected unqualified-id before ‘(’ token
   94 |         } else if (node->getNodeType() == ASTNode::RETURN) {
      |                                            

It looks like that action you link compiled successfully, but then failed when trying to run the tests.

it didn't compile successfully, the build has failed, but github actions didn't stop the event and checked it as (a passed event) Screenshot_20240927_173849

, this's because of the build script file, if any of its commands have failed, it still will return 0 as successful commands, we could fix this.

Which headers were missing that weren't added by the compiler?

/ThetaLang/src/compiler/CodeGen.cpp:946:9: error: ‘optional’ was not declared in this scope
  946 |         optional<string> scopeRef = scopeReferences.lookup(identName);
      |         ^~~~~~~~
/ThetaLang/src/compiler/CodeGen.cpp:28:1: note: ‘std::optional’ is defined in header ‘<optional>’; did you forget to ‘#include <optional>’?
   27 | #include "cli/cli.cpp"
  +++ |+#include <optional>
   28 | 
alexdovzhanyn commented 2 months ago

@AbdelrahmanKhaledd which version of c++ are you using? This project requires c++17 -- it looks like all of the errors you are encountering have to do with std::optional, which was introduced in c++17 and is not available in c++11.

I've added a small patch to the master branch which should fix that first error you posted, but for the remaining 3 errors you'll have to make sure you compile with c++17.

AbdelrahmanKhaledd commented 2 months ago

@AbdelrahmanKhaledd which version of c++ are you using? This project requires c++17 -- it looks like all of the errors you are encountering have to do with std::optional, which was introduced in c++17 and is not available in c++11.

@alexdovzhanyn I think, I'm using the correct c++ version, the standard version is defined in cmake file as 17, and I have updated build-tools, this Event with files names changing with same errors and with the correct c++ version

alexdovzhanyn commented 2 months ago

@alexdovzhanyn I think, I'm using the correct c++ version, the standard version is defined in cmake file as 17, and I have updated build-tools, this Event with files names changing with same errors and with the correct c++ version

It looks like that build is still failing with the file name casing issue. I updated master to rename the files manually. Can you give master a pull and try again?

AbdelrahmanKhaledd commented 2 months ago

@alexdovzhanyn same issues

alexdovzhanyn commented 2 months ago

@AbdelrahmanKhaledd I'll play around with it and see if I can get it building with that workflow.

AbdelrahmanKhaledd commented 2 months ago

I tried to fix these compiler errors, and it works locally with me with these changes Pr but I think it still has a problem with GitHub actions workflow and build fails.

Is there any channel for the project or a group to communicate and discuss things, instead of issue threads?

alexdovzhanyn commented 2 months ago

Yeah @AbdelrahmanKhaledd I have it almost working on the GitHub actions too in this pr: https://github.com/alexdovzhanyn/ThetaLang/pull/32

If you want, you can hop in this discord channel to discuss: https://discord.gg/mzWgbhGQ6C

I'm driving for the next few hours so I won't be able to respond but we can discuss at some point