Skip to content
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

Build: linux build issues #30

Closed
AbdelrahmanKhaledd opened this issue Sep 26, 2024 · 9 comments
Closed

Build: linux build issues #30

AbdelrahmanKhaledd opened this issue Sep 26, 2024 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@AbdelrahmanKhaledd
Copy link
Contributor

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

  • Compiler doesn't change lower-case, upper-case characters in files names, (it changes these characters automatically to fit the right files' names on mac-os)
ThetaLang/src/compiler/CodeGen.cpp:17:10: fatal error: lexer/Lexemes.hpp: No such file or directory
   17 | #include "lexer/Lexemes.hpp"
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
  • Compiler doesn't add needed headers, if it wasn't included like #include<optional>.
  • I think we just need to pass right arguments for compiling to mimic g++ compiler's default options on mac-os.

This action runs on linux with the same errors.

@alexdovzhanyn
Copy link
Collaborator

@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
Copy link
Contributor Author

AbdelrahmanKhaledd commented Sep 27, 2024

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
Copy link
Collaborator

@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
Copy link
Contributor Author

AbdelrahmanKhaledd commented Sep 27, 2024

@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
Copy link
Collaborator

@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
Copy link
Contributor Author

@alexdovzhanyn
same issues

@alexdovzhanyn
Copy link
Collaborator

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

@alexdovzhanyn alexdovzhanyn self-assigned this Sep 27, 2024
@alexdovzhanyn alexdovzhanyn added the bug Something isn't working label Sep 27, 2024
@AbdelrahmanKhaledd
Copy link
Contributor Author

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
Copy link
Collaborator

Yeah @AbdelrahmanKhaledd I have it almost working on the GitHub actions too in this pr: #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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants