TypeRunner icon indicating copy to clipboard operation
TypeRunner copied to clipboard

Recurse submodules, fix tests/CMakeLists.txt name

Open Vendicated opened this issue 2 years ago • 2 comments

Fixes the tests CMakeLists filename and makes sure the git clone also downloads the submodules

Vendicated avatar Oct 18 '22 16:10 Vendicated

Anyway even with these changes the build still fails for me on Linux (error and full log attached below), so it would be very nice if you could provide full build instructions / builds

/tmp/TypeRunner/src/checker/././../core.h:240:33: error: ‘fmt’ is not a constant expression
  240 |         std::cout << fmt::format(fmt, std::forward<Args>(args)...) << "\n";
      |                      ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Full log

build.log

$ cmake ..

-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- TRACY_ENABLE: ON
-- TRACY_ON_DEMAND: OFF
-- TRACY_CALLSTACK: OFF
-- TRACY_NO_CALLSTACK: OFF
-- TRACY_NO_CALLSTACK_INLINES: OFF
-- TRACY_ONLY_LOCALHOST: OFF
-- TRACY_NO_BROADCAST: OFF
-- TRACY_ONLY_IPV4: OFF
-- TRACY_NO_CODE_TRANSFER: OFF
-- TRACY_NO_CONTEXT_SWITCH: OFF
-- TRACY_NO_EXIT: OFF
-- TRACY_NO_SAMPLING: OFF
-- TRACY_NO_VERIFY: OFF
-- TRACY_NO_VSYNC_CAPTURE: OFF
-- TRACY_NO_FRAME_IMAGE: OFF
-- TRACY_NO_SYSTEM_TRACING: OFF
-- TRACY_DELAYED_INIT: OFF
-- TRACY_MANUAL_LIFETIME: OFF
-- TRACY_FIBERS: OFF
-- TRACY_NO_CRASH_HANDLER: OFF
-- TRACY_TIMER_FALLBACK: OFF
-- Module support is disabled.
-- Version: 8.1.2
-- Build type: 
-- CXX_STANDARD: 23
-- Required features: cxx_variadic_templates
-- Performing Test __CxxFlag__fno_threadsafe_statics
-- Performing Test __CxxFlag__fno_threadsafe_statics - Success
-- Performing Test __CxxFlag__fno_semantic_interposition
-- Performing Test __CxxFlag__fno_semantic_interposition - Success
-- Performing Test __CxxFlag__fmerge_all_constants
-- Performing Test __CxxFlag__fmerge_all_constants - Success
-- Performing Test __CxxFlag__fno_enforce_eh_specs
-- Performing Test __CxxFlag__fno_enforce_eh_specs - Success
** AsmJit Summary **
   ASMJIT_DIR=/tmp/TypeRunner/libs/asmjit
   ASMJIT_TEST=FALSE
   ASMJIT_TARGET_TYPE=STATIC
   ASMJIT_DEPS=pthread;rt
   ASMJIT_LIBS=asmjit;pthread;rt
   ASMJIT_CFLAGS=-DASMJIT_STATIC
   ASMJIT_PRIVATE_CFLAGS=-Wall;-Wextra;-Wconversion;-fno-math-errno;-fno-threadsafe-statics;-fno-semantic-interposition;-DASMJIT_STATIC
   ASMJIT_PRIVATE_CFLAGS_DBG=
   ASMJIT_PRIVATE_CFLAGS_REL=-O2;-fmerge-all-constants;-fno-enforce-eh-specs
Test found typescript_test_bench.
Test found typescript_test_checker.
Test found typescript_test_core.
Test found typescript_test_hash.
Test found typescript_test_mem.
Test found typescript_test_newtypes.
Test found typescript_test_parser.
Test found typescript_test_pool_array.
Test found typescript_test_pool_single.
Test found typescript_test_scanner.
Test found typescript_test_vm2.
Test found typescript_test_vm2_closure.
Test found typescript_test_vm2_union.
-- Found OpenGL: /usr/lib/libOpenGL.so   
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/TypeRunner/build







$ make

[  1%] Building CXX object libs/fmt/CMakeFiles/fmt.dir/src/format.cc.o
[  2%] Building CXX object libs/fmt/CMakeFiles/fmt.dir/src/os.cc.o
[  3%] Linking CXX static library libfmt.a
[  3%] Built target fmt
[  3%] Building CXX object src/CMakeFiles/typescript.dir/utf.cpp.o
[  4%] Building CXX object src/CMakeFiles/typescript.dir/core.cpp.o
[  5%] Building CXX object src/CMakeFiles/typescript.dir/utilities.cpp.o
/tmp/TypeRunner/src/utilities.cpp:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
In file included from /tmp/TypeRunner/src/utilities.h:11,
                 from /tmp/TypeRunner/src/utilities.cpp:5:
/tmp/TypeRunner/src/scanner.h:175:19: warning: trigraph ??= ignored, use -trigraphs to enable [-Wtrigraphs]
  175 |                 {"??=",  SyntaxKind::QuestionQuestionEqualsToken},
      |                    
/tmp/TypeRunner/src/scanner.h:625:123: warning: trigraph ??' ignored, use -trigraphs to enable [-Wtrigraphs]
  625 |             Debug::asserts(token == SyntaxKind::QuestionQuestionToken, "'reScanQuestionToken' should only be called on a '??'");
      |                                                                                                                            
/tmp/TypeRunner/src/utilities.cpp: In function ‘tr::types::ScriptKind tr::ensureScriptKind(std::string, std::optional<types::ScriptKind>)’:
/tmp/TypeRunner/src/utilities.cpp:325:5: warning: control reaches end of non-void function [-Wreturn-type]
  325 |     }
      |     ^
[  6%] Building CXX object src/CMakeFiles/typescript.dir/node_test.cpp.o
[  7%] Building CXX object src/CMakeFiles/typescript.dir/parser2.cpp.o
In file included from /tmp/TypeRunner/src/parser2.h:13,
                 from /tmp/TypeRunner/src/parser2.cpp:2:
/tmp/TypeRunner/src/scanner.h:175:19: warning: trigraph ??= ignored, use -trigraphs to enable [-Wtrigraphs]
  175 |                 {"??=",  SyntaxKind::QuestionQuestionEqualsToken},
      |                    
/tmp/TypeRunner/src/scanner.h:625:123: warning: trigraph ??' ignored, use -trigraphs to enable [-Wtrigraphs]
  625 |             Debug::asserts(token == SyntaxKind::QuestionQuestionToken, "'reScanQuestionToken' should only be called on a '??'");
      |                                                                                                                            
[  8%] Building CXX object src/CMakeFiles/typescript.dir/types.cpp.o
[  9%] Building CXX object src/CMakeFiles/typescript.dir/path.cpp.o
/tmp/TypeRunner/src/path.cpp:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
[  9%] Building CXX object src/CMakeFiles/typescript.dir/factory.cpp.o
In file included from /tmp/TypeRunner/src/utilities.h:11,
                 from /tmp/TypeRunner/src/factory.h:7,
                 from /tmp/TypeRunner/src/factory.cpp:1:
/tmp/TypeRunner/src/scanner.h:175:19: warning: trigraph ??= ignored, use -trigraphs to enable [-Wtrigraphs]
  175 |                 {"??=",  SyntaxKind::QuestionQuestionEqualsToken},
      |                    
/tmp/TypeRunner/src/scanner.h:625:123: warning: trigraph ??' ignored, use -trigraphs to enable [-Wtrigraphs]
  625 |             Debug::asserts(token == SyntaxKind::QuestionQuestionToken, "'reScanQuestionToken' should only be called on a '??'");
      |                                                                                                                            
/tmp/TypeRunner/src/factory.cpp: In member function ‘tr::shared<tr::LiteralLike> tr::Factory::createLiteralLikeNode(tr::types::SyntaxKind, std::string)’:
/tmp/TypeRunner/src/factory.cpp:215:5: warning: control reaches end of non-void function [-Wreturn-type]
  215 |     }
      |     ^
[ 10%] Building CXX object src/CMakeFiles/typescript.dir/parenthesizer.cpp.o
In file included from /tmp/TypeRunner/src/utilities.h:11,
                 from /tmp/TypeRunner/src/parenthesizer.h:5,
                 from /tmp/TypeRunner/src/parenthesizer.cpp:5:
/tmp/TypeRunner/src/scanner.h:175:19: warning: trigraph ??= ignored, use -trigraphs to enable [-Wtrigraphs]
  175 |                 {"??=",  SyntaxKind::QuestionQuestionEqualsToken},
      |                    
/tmp/TypeRunner/src/scanner.h:625:123: warning: trigraph ??' ignored, use -trigraphs to enable [-Wtrigraphs]
  625 |             Debug::asserts(token == SyntaxKind::QuestionQuestionToken, "'reScanQuestionToken' should only be called on a '??'");
      |                                                                                                                            
/tmp/TypeRunner/src/parenthesizer.h: In member function ‘bool tr::Parenthesizer::binaryOperandNeedsParentheses(tr::types::SyntaxKind, tr::shared<tr::Expression>, bool, tr::sharedOpt<tr::Expression>)’:
/tmp/TypeRunner/src/parenthesizer.h:138:9: warning: control reaches end of non-void function [-Wreturn-type]
  138 |         }
      |         ^
[ 11%] Building CXX object src/CMakeFiles/typescript.dir/scanner.cpp.o
In file included from /tmp/TypeRunner/src/scanner.cpp:3:
/tmp/TypeRunner/src/scanner.h:175:19: warning: trigraph ??= ignored, use -trigraphs to enable [-Wtrigraphs]
  175 |                 {"??=",  SyntaxKind::QuestionQuestionEqualsToken},
      |                    
/tmp/TypeRunner/src/scanner.h:625:123: warning: trigraph ??' ignored, use -trigraphs to enable [-Wtrigraphs]
  625 |             Debug::asserts(token == SyntaxKind::QuestionQuestionToken, "'reScanQuestionToken' should only be called on a '??'");
      |                                                                                                                            
/tmp/TypeRunner/src/scanner.cpp: In member function ‘int tr::Scanner::error(tr::shared<tr::types::DiagnosticMessage>&, int, int)’:
/tmp/TypeRunner/src/scanner.cpp:435:5: warning: no return statement in function returning non-void [-Wreturn-type]
  435 |     }
      |     ^
/tmp/TypeRunner/src/scanner.cpp: In function ‘std::optional<tr::types::CommentDirectiveType> tr::getDirectiveFromComment(const std::string&, const std::__cxx11::regex&)’:
/tmp/TypeRunner/src/scanner.cpp:755:5: warning: control reaches end of non-void function [-Wreturn-type]
  755 |     }
      |     ^
[ 12%] Building CXX object src/CMakeFiles/typescript.dir/checker/vm2.cpp.o
In file included from /tmp/TypeRunner/libs/asmjit/src/asmjit/./arm.h:60,
                 from /tmp/TypeRunner/libs/asmjit/src/asmjit/a64.h:51,
                 from /tmp/TypeRunner/src/checker/./vm2.h:3,
                 from /tmp/TypeRunner/src/checker/vm2.cpp:1:
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h: In member function ‘constexpr bool asmjit::_abi_1_9::arm::Vec::isVecB8() const’:
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h:244:96: warning: bitwise operation between different enumeration types ‘asmjit::_abi_1_9::BaseReg::<unnamed enum>’ and ‘asmjit::_abi_1_9::arm::Vec::AdditionalBits’ is deprecated [-Wdeprecated-enum-enum-conversion]
  244 |   inline constexpr bool isVecB8() const noexcept { return _signature.subset(kBaseSignatureMask | kSignatureRegElementTypeMask) == (RegTraits<RegType::kARM_VecD>::kSignature | kSignatureElementB); }
      |                                                                             ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h:244:174: warning: bitwise operation between different enumeration types ‘asmjit::_abi_1_9::arm::RegTraits<asmjit::_abi_1_9::RegType::kVec64>::<unnamed enum>’ and ‘asmjit::_abi_1_9::arm::Vec::SignatureReg’ is deprecated [-Wdeprecated-enum-enum-conversion]
  244 |   inline constexpr bool isVecB8() const noexcept { return _signature.subset(kBaseSignatureMask | kSignatureRegElementTypeMask) == (RegTraits<RegType::kARM_VecD>::kSignature | kSignatureElementB); }
      |                                                                                                                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h: In member function ‘constexpr bool asmjit::_abi_1_9::arm::Vec::isVecH4() const’:
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h:245:96: warning: bitwise operation between different enumeration types ‘asmjit::_abi_1_9::BaseReg::<unnamed enum>’ and ‘asmjit::_abi_1_9::arm::Vec::AdditionalBits’ is deprecated [-Wdeprecated-enum-enum-conversion]
  245 |   inline constexpr bool isVecH4() const noexcept { return _signature.subset(kBaseSignatureMask | kSignatureRegElementTypeMask) == (RegTraits<RegType::kARM_VecD>::kSignature | kSignatureElementH); }
      |                                                                             ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h:245:174: warning: bitwise operation between different enumeration types ‘asmjit::_abi_1_9::arm::RegTraits<asmjit::_abi_1_9::RegType::kVec64>::<unnamed enum>’ and ‘asmjit::_abi_1_9::arm::Vec::SignatureReg’ is deprecated [-Wdeprecated-enum-enum-conversion]
  245 |   inline constexpr bool isVecH4() const noexcept { return _signature.subset(kBaseSignatureMask | kSignatureRegElementTypeMask) == (RegTraits<RegType::kARM_VecD>::kSignature | kSignatureElementH); }
      |                                                                                                                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h: In member function ‘constexpr bool asmjit::_abi_1_9::arm::Vec::isVecS2() const’:
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h:246:96: warning: bitwise operation between different enumeration types ‘asmjit::_abi_1_9::BaseReg::<unnamed enum>’ and ‘asmjit::_abi_1_9::arm::Vec::AdditionalBits’ is deprecated [-Wdeprecated-enum-enum-conversion]
  246 |   inline constexpr bool isVecS2() const noexcept { return _signature.subset(kBaseSignatureMask | kSignatureRegElementTypeMask) == (RegTraits<RegType::kARM_VecD>::kSignature | kSignatureElementS); }
      |                                                                             ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h:246:174: warning: bitwise operation between different enumeration types ‘asmjit::_abi_1_9::arm::RegTraits<asmjit::_abi_1_9::RegType::kVec64>::<unnamed enum>’ and ‘asmjit::_abi_1_9::arm::Vec::SignatureReg’ is deprecated [-Wdeprecated-enum-enum-conversion]
  246 |   inline constexpr bool isVecS2() const noexcept { return _signature.subset(kBaseSignatureMask | kSignatureRegElementTypeMask) == (RegTraits<RegType::kARM_VecD>::kSignature | kSignatureElementS); }
      |                                                                                                                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h: In member function ‘constexpr bool asmjit::_abi_1_9::arm::Vec::isVecD1() const’:
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h:247:96: warning: bitwise operation between different enumeration types ‘asmjit::_abi_1_9::BaseReg::<unnamed enum>’ and ‘asmjit::_abi_1_9::arm::Vec::AdditionalBits’ is deprecated [-Wdeprecated-enum-enum-conversion]
  247 |   inline constexpr bool isVecD1() const noexcept { return _signature.subset(kBaseSignatureMask | kSignatureRegElementTypeMask) == (RegTraits<RegType::kARM_VecD>::kSignature); }
      |                                                                             ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h: In member function ‘constexpr bool asmjit::_abi_1_9::arm::Vec::isVecB16() const’:
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h:249:97: warning: bitwise operation between different enumeration types ‘asmjit::_abi_1_9::BaseReg::<unnamed enum>’ and ‘asmjit::_abi_1_9::arm::Vec::AdditionalBits’ is deprecated [-Wdeprecated-enum-enum-conversion]
  249 |   inline constexpr bool isVecB16() const noexcept { return _signature.subset(kBaseSignatureMask | kSignatureRegElementTypeMask) == (RegTraits<RegType::kARM_VecV>::kSignature | kSignatureElementB); }
      |                                                                              ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h:249:175: warning: bitwise operation between different enumeration types ‘asmjit::_abi_1_9::arm::RegTraits<asmjit::_abi_1_9::RegType::kVec128>::<unnamed enum>’ and ‘asmjit::_abi_1_9::arm::Vec::SignatureReg’ is deprecated [-Wdeprecated-enum-enum-conversion]
  249 |   inline constexpr bool isVecB16() const noexcept { return _signature.subset(kBaseSignatureMask | kSignatureRegElementTypeMask) == (RegTraits<RegType::kARM_VecV>::kSignature | kSignatureElementB); }
      |                                                                                                                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h: In member function ‘constexpr bool asmjit::_abi_1_9::arm::Vec::isVecH8() const’:
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h:250:96: warning: bitwise operation between different enumeration types ‘asmjit::_abi_1_9::BaseReg::<unnamed enum>’ and ‘asmjit::_abi_1_9::arm::Vec::AdditionalBits’ is deprecated [-Wdeprecated-enum-enum-conversion]
  250 |   inline constexpr bool isVecH8() const noexcept { return _signature.subset(kBaseSignatureMask | kSignatureRegElementTypeMask) == (RegTraits<RegType::kARM_VecV>::kSignature | kSignatureElementH); }
      |                                                                             ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h:250:174: warning: bitwise operation between different enumeration types ‘asmjit::_abi_1_9::arm::RegTraits<asmjit::_abi_1_9::RegType::kVec128>::<unnamed enum>’ and ‘asmjit::_abi_1_9::arm::Vec::SignatureReg’ is deprecated [-Wdeprecated-enum-enum-conversion]
  250 |   inline constexpr bool isVecH8() const noexcept { return _signature.subset(kBaseSignatureMask | kSignatureRegElementTypeMask) == (RegTraits<RegType::kARM_VecV>::kSignature | kSignatureElementH); }
      |                                                                                                                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h: In member function ‘constexpr bool asmjit::_abi_1_9::arm::Vec::isVecS4() const’:
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h:251:96: warning: bitwise operation between different enumeration types ‘asmjit::_abi_1_9::BaseReg::<unnamed enum>’ and ‘asmjit::_abi_1_9::arm::Vec::AdditionalBits’ is deprecated [-Wdeprecated-enum-enum-conversion]
  251 |   inline constexpr bool isVecS4() const noexcept { return _signature.subset(kBaseSignatureMask | kSignatureRegElementTypeMask) == (RegTraits<RegType::kARM_VecV>::kSignature | kSignatureElementS); }
      |                                                                             ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h:251:174: warning: bitwise operation between different enumeration types ‘asmjit::_abi_1_9::arm::RegTraits<asmjit::_abi_1_9::RegType::kVec128>::<unnamed enum>’ and ‘asmjit::_abi_1_9::arm::Vec::SignatureReg’ is deprecated [-Wdeprecated-enum-enum-conversion]
  251 |   inline constexpr bool isVecS4() const noexcept { return _signature.subset(kBaseSignatureMask | kSignatureRegElementTypeMask) == (RegTraits<RegType::kARM_VecV>::kSignature | kSignatureElementS); }
      |                                                                                                                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h: In member function ‘constexpr bool asmjit::_abi_1_9::arm::Vec::isVecD2() const’:
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h:252:96: warning: bitwise operation between different enumeration types ‘asmjit::_abi_1_9::BaseReg::<unnamed enum>’ and ‘asmjit::_abi_1_9::arm::Vec::AdditionalBits’ is deprecated [-Wdeprecated-enum-enum-conversion]
  252 |   inline constexpr bool isVecD2() const noexcept { return _signature.subset(kBaseSignatureMask | kSignatureRegElementTypeMask) == (RegTraits<RegType::kARM_VecV>::kSignature | kSignatureElementD); }
      |                                                                             ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h:252:174: warning: bitwise operation between different enumeration types ‘asmjit::_abi_1_9::arm::RegTraits<asmjit::_abi_1_9::RegType::kVec128>::<unnamed enum>’ and ‘asmjit::_abi_1_9::arm::Vec::SignatureReg’ is deprecated [-Wdeprecated-enum-enum-conversion]
  252 |   inline constexpr bool isVecD2() const noexcept { return _signature.subset(kBaseSignatureMask | kSignatureRegElementTypeMask) == (RegTraits<RegType::kARM_VecV>::kSignature | kSignatureElementD); }
      |                                                                                                                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h: In member function ‘constexpr bool asmjit::_abi_1_9::arm::Vec::isVecB4x4() const’:
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h:253:98: warning: bitwise operation between different enumeration types ‘asmjit::_abi_1_9::BaseReg::<unnamed enum>’ and ‘asmjit::_abi_1_9::arm::Vec::AdditionalBits’ is deprecated [-Wdeprecated-enum-enum-conversion]
  253 |   inline constexpr bool isVecB4x4() const noexcept { return _signature.subset(kBaseSignatureMask | kSignatureRegElementTypeMask) == (RegTraits<RegType::kARM_VecV>::kSignature | kSignatureElementB4); }
      |                                                                               ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h:253:176: warning: bitwise operation between different enumeration types ‘asmjit::_abi_1_9::arm::RegTraits<asmjit::_abi_1_9::RegType::kVec128>::<unnamed enum>’ and ‘asmjit::_abi_1_9::arm::Vec::SignatureReg’ is deprecated [-Wdeprecated-enum-enum-conversion]
  253 |   inline constexpr bool isVecB4x4() const noexcept { return _signature.subset(kBaseSignatureMask | kSignatureRegElementTypeMask) == (RegTraits<RegType::kARM_VecV>::kSignature | kSignatureElementB4); }
      |                                                                                                                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h: In member function ‘constexpr bool asmjit::_abi_1_9::arm::Vec::isVecH2x4() const’:
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h:254:98: warning: bitwise operation between different enumeration types ‘asmjit::_abi_1_9::BaseReg::<unnamed enum>’ and ‘asmjit::_abi_1_9::arm::Vec::AdditionalBits’ is deprecated [-Wdeprecated-enum-enum-conversion]
  254 |   inline constexpr bool isVecH2x4() const noexcept { return _signature.subset(kBaseSignatureMask | kSignatureRegElementTypeMask) == (RegTraits<RegType::kARM_VecV>::kSignature | kSignatureElementH2); }
      |                                                                               ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h:254:176: warning: bitwise operation between different enumeration types ‘asmjit::_abi_1_9::arm::RegTraits<asmjit::_abi_1_9::RegType::kVec128>::<unnamed enum>’ and ‘asmjit::_abi_1_9::arm::Vec::SignatureReg’ is deprecated [-Wdeprecated-enum-enum-conversion]
  254 |   inline constexpr bool isVecH2x4() const noexcept { return _signature.subset(kBaseSignatureMask | kSignatureRegElementTypeMask) == (RegTraits<RegType::kARM_VecV>::kSignature | kSignatureElementH2); }
      |                                                                                                                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h: In member function ‘asmjit::_abi_1_9::arm::VecD asmjit::_abi_1_9::arm::Vec::b8() const’:
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h:346:86: warning: bitwise operation between different enumeration types ‘asmjit::_abi_1_9::arm::VecD::<unnamed enum>’ and ‘asmjit::_abi_1_9::arm::Vec::SignatureReg’ is deprecated [-Wdeprecated-enum-enum-conversion]
  346 | inline VecD Vec::b8() const noexcept { return VecD(OperandSignature{VecD::kSignature | kSignatureElementB}, id()); }
      |                                                                     ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h: In member function ‘asmjit::_abi_1_9::arm::VecS asmjit::_abi_1_9::arm::Vec::h2() const’:
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h:347:86: warning: bitwise operation between different enumeration types ‘asmjit::_abi_1_9::arm::VecS::<unnamed enum>’ and ‘asmjit::_abi_1_9::arm::Vec::SignatureReg’ is deprecated [-Wdeprecated-enum-enum-conversion]
  347 | inline VecS Vec::h2() const noexcept { return VecS(OperandSignature{VecS::kSignature | kSignatureElementH}, id()); }
      |                                                                     ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h: In member function ‘asmjit::_abi_1_9::arm::VecD asmjit::_abi_1_9::arm::Vec::h4() const’:
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h:348:86: warning: bitwise operation between different enumeration types ‘asmjit::_abi_1_9::arm::VecD::<unnamed enum>’ and ‘asmjit::_abi_1_9::arm::Vec::SignatureReg’ is deprecated [-Wdeprecated-enum-enum-conversion]
  348 | inline VecD Vec::h4() const noexcept { return VecD(OperandSignature{VecD::kSignature | kSignatureElementH}, id()); }
      |                                                                     ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h: In member function ‘asmjit::_abi_1_9::arm::VecD asmjit::_abi_1_9::arm::Vec::s2() const’:
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h:349:86: warning: bitwise operation between different enumeration types ‘asmjit::_abi_1_9::arm::VecD::<unnamed enum>’ and ‘asmjit::_abi_1_9::arm::Vec::SignatureReg’ is deprecated [-Wdeprecated-enum-enum-conversion]
  349 | inline VecD Vec::s2() const noexcept { return VecD(OperandSignature{VecD::kSignature | kSignatureElementS}, id()); }
      |                                                                     ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h: In member function ‘asmjit::_abi_1_9::arm::VecV asmjit::_abi_1_9::arm::Vec::b16() const’:
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h:350:87: warning: bitwise operation between different enumeration types ‘asmjit::_abi_1_9::arm::VecV::<unnamed enum>’ and ‘asmjit::_abi_1_9::arm::Vec::SignatureReg’ is deprecated [-Wdeprecated-enum-enum-conversion]
  350 | inline VecV Vec::b16() const noexcept { return VecV(OperandSignature{VecV::kSignature | kSignatureElementB}, id()); }
      |                                                                      ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h: In member function ‘asmjit::_abi_1_9::arm::VecV asmjit::_abi_1_9::arm::Vec::h8() const’:
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h:351:86: warning: bitwise operation between different enumeration types ‘asmjit::_abi_1_9::arm::VecV::<unnamed enum>’ and ‘asmjit::_abi_1_9::arm::Vec::SignatureReg’ is deprecated [-Wdeprecated-enum-enum-conversion]
  351 | inline VecV Vec::h8() const noexcept { return VecV(OperandSignature{VecV::kSignature | kSignatureElementH}, id()); }
      |                                                                     ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h: In member function ‘asmjit::_abi_1_9::arm::VecV asmjit::_abi_1_9::arm::Vec::s4() const’:
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h:352:86: warning: bitwise operation between different enumeration types ‘asmjit::_abi_1_9::arm::VecV::<unnamed enum>’ and ‘asmjit::_abi_1_9::arm::Vec::SignatureReg’ is deprecated [-Wdeprecated-enum-enum-conversion]
  352 | inline VecV Vec::s4() const noexcept { return VecV(OperandSignature{VecV::kSignature | kSignatureElementS}, id()); }
      |                                                                     ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h: In member function ‘asmjit::_abi_1_9::arm::VecV asmjit::_abi_1_9::arm::Vec::d2() const’:
/tmp/TypeRunner/libs/asmjit/src/asmjit/././arm/armoperand.h:353:86: warning: bitwise operation between different enumeration types ‘asmjit::_abi_1_9::arm::VecV::<unnamed enum>’ and ‘asmjit::_abi_1_9::arm::Vec::SignatureReg’ is deprecated [-Wdeprecated-enum-enum-conversion]
  353 | inline VecV Vec::d2() const noexcept { return VecV(OperandSignature{VecV::kSignature | kSignatureElementD}, id()); }
      |                                                                     ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/tmp/TypeRunner/src/checker/vm2.cpp: At global scope:
/tmp/TypeRunner/src/checker/vm2.cpp:788:51: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
  788 |     inline void print(Type *type, char *title = "") {
      |                                                   ^
In file included from /tmp/TypeRunner/src/checker/././pool_single.h:9,
                 from /tmp/TypeRunner/src/checker/./vm2.h:5:
/tmp/TypeRunner/src/checker/././../core.h: In instantiation of ‘void tr::debug(T, Args&& ...) [with T = const char*; Args = {std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >}]’:
/tmp/TypeRunner/src/checker/vm2.cpp:173:18:   required from here
/tmp/TypeRunner/src/checker/././../core.h:240:33:   in ‘constexpr’ expansion of ‘fmt::v8::basic_format_string<char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(fmt)’
/tmp/TypeRunner/src/checker/././../core.h:240:33: error: ‘fmt’ is not a constant expression
  240 |         std::cout << fmt::format(fmt, std::forward<Args>(args)...) << "\n";
      |                      ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/TypeRunner/src/checker/././../core.h: In instantiation of ‘void tr::debug(T, Args&& ...) [with T = const char*; Args = {}]’:
/tmp/TypeRunner/src/checker/vm2.cpp:743:14:   required from here
/tmp/TypeRunner/src/checker/././../core.h:240:33:   in ‘constexpr’ expansion of ‘fmt::v8::basic_format_string<char>(fmt)’
/tmp/TypeRunner/src/checker/././../core.h:240:33: error: ‘fmt’ is not a constant expression
/tmp/TypeRunner/src/checker/././../core.h: In instantiation of ‘void tr::debug(T, Args&& ...) [with T = const char*; Args = {unsigned int&}]’:
/tmp/TypeRunner/src/checker/vm2.cpp:745:14:   required from here
/tmp/TypeRunner/src/checker/././../core.h:240:33:   in ‘constexpr’ expansion of ‘fmt::v8::basic_format_string<char, unsigned int&>(fmt)’
/tmp/TypeRunner/src/checker/././../core.h:240:33: error: ‘fmt’ is not a constant expression
/tmp/TypeRunner/src/checker/././../core.h: In instantiation of ‘void tr::debug(T, Args&& ...) [with T = const char*; Args = {unsigned int&, char*&, unsigned int&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void*}]’:
/tmp/TypeRunner/src/checker/vm2.cpp:789:14:   required from here
/tmp/TypeRunner/src/checker/././../core.h:240:33:   in ‘constexpr’ expansion of ‘fmt::v8::basic_format_string<char, unsigned int&, char*&, unsigned int&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void*>(fmt)’
/tmp/TypeRunner/src/checker/././../core.h:240:33: error: ‘fmt’ is not a constant expression
/tmp/TypeRunner/src/checker/././../core.h: In instantiation of ‘void tr::debug(T, Args&& ...) [with T = const char*; Args = {unsigned int&, instructions::OP}]’:
/tmp/TypeRunner/src/checker/vm2.cpp:1713:26:   required from here
/tmp/TypeRunner/src/checker/././../core.h:240:33:   in ‘constexpr’ expansion of ‘fmt::v8::basic_format_string<char, unsigned int&, tr::instructions::OP>(fmt)’
/tmp/TypeRunner/src/checker/././../core.h:240:33: error: ‘fmt’ is not a constant expression
/tmp/TypeRunner/src/checker/vm2.cpp: In function ‘tr::vm2::Type* tr::vm2::resolveObjectIndexType(Type*, Type*)’:
/tmp/TypeRunner/src/checker/vm2.cpp:501:5: warning: control reaches end of non-void function [-Wreturn-type]
  501 |     }
      |     ^
/tmp/TypeRunner/src/checker/vm2.cpp: In function ‘tr::vm2::ActiveSubroutine* tr::vm2::pushSubroutine(ModuleSubroutine*, unsigned int)’:
/tmp/TypeRunner/src/checker/vm2.cpp:430:5: warning: control reaches end of non-void function [-Wreturn-type]
  430 |     }
      |     ^
make[2]: *** [src/CMakeFiles/typescript.dir/build.make:216: src/CMakeFiles/typescript.dir/checker/vm2.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:391: src/CMakeFiles/typescript.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Vendicated avatar Oct 18 '22 16:10 Vendicated

This saved some time, thanks!

I got a little further in the compile before I hit a dead-end (68%). I noticed I needed a few dependencies too: brew install cmake googletest sdl2 catch2 so far. I believe a very modern compiler is needed (std::span is used, so C++20 at least), and the most recent clang/llvm installed via xcode seems to meet this. I see a compiler warning when using clang (clang: warning: argument unused during compilation: '-fno-semantic-interposition' [-Wunused-command-line-argument]), so perhaps a modern g++ is intended?

However, I noticed a few changes needed to be made, here's the changes I made so far, which got me to 68%:

Git diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1f8f280..6e10211 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,12 +3,14 @@ project(typescript)

set(CMAKE_CXX_STANDARD 23)

-set(CMAKE_CXX_FLAGS "-Wno-unused-variable -Wno-switch")
+set(CMAKE_CXX_FLAGS "-Wno-unused-variable -Wno-switch -Wno-trigraphs -Wno-deprecated-anon-enum-enum-conversion")

if(CMAKE_BUILD_TYPE STREQUAL "Release")
   set(CMAKE_CXX_FLAGS "-Wno-unused-variable -O3 -ffast-math")
endif() 

+# This probably belongs in my .zshrc rather than here :)
+include_directories("/opt/homebrew/include/")
+
include_directories(libs/tracy/)
include_directories(libs/fmt/include/)

diff --git a/src/checker/checks.h b/src/checker/checks.h
index 6b75b2b..85001b2 100644
--- a/src/checker/checks.h
+++ b/src/checker/checks.h
@@ -1,5 +1,8 @@
#pragma once

+// XXX: Include such that we can use vm2::DiagnosticMessage. This appears to be
+// the intended class references, as the ctor fits.
+#include "./module2.h"
#include "./types.h"
#include "../core.h"

@@ -66,15 +69,15 @@ namespace tr::vm {
           return r;
       }

-        DiagnosticMessage errorMessage() {
-            if (stack.empty()) return DiagnosticMessage("Type '{}' is not assignable to type '{}'", 0);
+        vm2::DiagnosticMessage errorMessage() {
+            if (stack.empty()) return vm2::DiagnosticMessage("Type '{}' is not assignable to type '{}'", 0);

           auto [left, right] = stack.back();
//            auto [left, right] = stack.front();
           auto message = fmt::format("Type '{}' is not assignable to type '{}'", stringify(left), stringify(right));
//            auto message = fmt::format("Type '' is not assignable to type ''");

-            return DiagnosticMessage(message, left->ip);
+            return vm2::DiagnosticMessage(message, left->ip);
       }

       void push(const shared<Type> &left, const shared<Type> &right) {
diff --git a/src/checker/instructions.h b/src/checker/instructions.h
index 9844c2f..64ecbbd 100644
--- a/src/checker/instructions.h
+++ b/src/checker/instructions.h
@@ -133,8 +133,8 @@ namespace tr::instructions {
       Pop,
       Inline, //Execute a subroutine on the same active frame

-        //Frame, //creates a new stack frame
-        //FrameEnd,
+        Frame, //creates a new stack frame
+        FrameEnd,
       Return, //end of a subroutine
       ReturnStatement, //used in inferring return types of functions

diff --git a/src/checker/types2.h b/src/checker/types2.h
index a3d0aec..5ec3acd 100644
--- a/src/checker/types2.h
+++ b/src/checker/types2.h
@@ -4,6 +4,7 @@
#include <functional>
#include <array>
#include <vector>
+#include <span>
#include "../enum.h"
#include "../hash.h"

diff --git a/src/checker/vm.h b/src/checker/vm.h
index c129275..1e985d4 100644
--- a/src/checker/vm.h
+++ b/src/checker/vm.h
@@ -1,5 +1,6 @@
#pragma once

+#include "./module2.h"
#include "./types.h"
#include "../core.h"
#include "./instructions.h"
@@ -245,8 +246,8 @@ namespace tr::vm {
    * For each active subroutine this object is created.
    */
   struct ProgressingSubroutine {
-        shared<Module> module;
-        ModuleSubroutine *subroutine;
+        shared<vm2::Module> module;
+        vm2::ModuleSubroutine *subroutine;

       unsigned int ip = 0; //instruction pointer
       unsigned int end = 0; //last instruction pointer
@@ -258,7 +259,7 @@ namespace tr::vm {

       sharedOpt<ProgressingSubroutine> previous = nullptr;

-        explicit ProgressingSubroutine(shared<Module> module, ModuleSubroutine *subroutine): module(module), subroutine(subroutine) {}
+        explicit ProgressingSubroutine(shared<vm2::Module> module, vm2::ModuleSubroutine *subroutine): module(module), subroutine(subroutine) {}

       uint32_t parseUint32() {
           auto val = readUint32(module->bin, ip + 1);
@@ -379,7 +380,7 @@ namespace tr::vm {

       bool stepper = false;

-        vector<shared<Module>> modules;
+        vector<shared<vm2::Module>> modules;

       unordered_map<unsigned int, function<shared<Type>(VM &)>> optimised;

@@ -404,7 +405,7 @@ namespace tr::vm {
           return errors;
       }

-        void prepare(shared<Module> module) {
+        void prepare(shared<vm2::Module> module) {
           parseHeader(module);
           modules.push_back(module);

@@ -419,13 +420,13 @@ namespace tr::vm {
           if (frames.size() > 1) frames.back().fromFrame(frames[frames.size() - 2]);
       }

-        void run(shared<Module> module) {
+        void run(shared<vm2::Module> module) {
           profiler.clear();
           prepare(module);
           process();
       }

-        void call(shared<Module> &module, unsigned int index = 0, unsigned int arguments = 0) {
+        void call(shared<vm2::Module> &module, unsigned int index = 0, unsigned int arguments = 0) {
           const auto loopRunning = !!subroutine;

           auto routine = module->getSubroutine(index);
@@ -549,13 +550,13 @@ namespace tr::vm {
//            }
       }

-        void report(DiagnosticMessage message) {
+        void report(vm2::DiagnosticMessage message) {
           message.module = subroutine->module;
           subroutine->module->errors.push_back(message);
       }

       void report(const string &message, const shared<Type> node) {
-            report(DiagnosticMessage(message, node->ip));
+            report(vm2::DiagnosticMessage(message, node->ip));
       }

       void extends() {

  • I silenced some warnings, because they were simply too noisy
  • Uncommenting some enums due to no other definition existing
  • Adding some namespacing to DiagnosticMessage, as that seemed to be the intended reference (either that, or there's a missing ctor)
  • Changing to it vm2::Module, as there exists no Module definition, only a forward declaration, so it complains about accessing members. However the vm2::Module probably isn't correct, as that's where I've hit a dead end - the member variable mainAddress doesn't exist (closest match is sourceMapAddress in vm2::Module).

Dead end-error:

In file included from github.com/marcj/TypeRunner/src/tests/test_bench.cpp:7:
github.com/marcj/TypeRunner/src/tests/../checker/vm.h:415:32: error: no member named 'mainAddress' in 'tr::vm2::Module'
            next->ip = module->mainAddress;

I'm guessing there's some missing code changes that haven't been pushed to master. Either way, I'm very much looking forward to the future of this project! Count me in as a supporter :)

pnappa avatar Oct 19 '22 02:10 pnappa

Thanks, already fixed in master. There's also a Dockerfile now to easily compile/test locally

marcj avatar Nov 03 '22 10:11 marcj