mys-lang / mys

The Mys programming language - an attempt to create a statically typed Python-like language that produces fast binaries. See https://mys-lang.org for more information.
Other
132 stars 5 forks source link

fail to build #51

Closed ghost closed 2 years ago

ghost commented 2 years ago

What did you do?

mys build

What did you expect to see? finish building the program

What did you see instead?

✔ Reading package configuration (0 seconds) ✔ Downloading dependencies (0 seconds) ✘ Building (0.1 seconds) /an/duyum/etki/ld: build/speed/mys.o: in function std::_Sp_counted_deleter<pcre2_real_code_32*, mys::Regex::Regex(mys::String const&, mys::String const&)::{lambda(pcre2_real_code_32*)#1}, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose()': mys.cpp:(.text._ZNSt19_Sp_counted_deleterIP18pcre2_real_code_32ZN3mys5RegexC4ERKNS2_6StringES6_EUlS1_E_SaIvELN9__gnu_cxx12_Lock_policyE2EE10_M_disposeEv+0x9): undefined reference topcre2_code_free_32' /an/duyum/etki/ld: build/speed/mys.o: in function std::_Sp_counted_deleter<pcre2_real_match_data_32*, mys::Regex::match(mys::String const&) const::{lambda(pcre2_real_match_data_32*)#1}, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose()': mys.cpp:(.text._ZNSt19_Sp_counted_deleterIP24pcre2_real_match_data_32ZNK3mys5Regex5matchERKNS2_6StringEEUlS1_E_SaIvELN9__gnu_cxx12_Lock_policyE2EE10_M_disposeEv+0x9): undefined reference topcre2_match_data_free_32' /an/duyum/etki/ld: build/speed/mys.o: in function mys::Regex::Regex(mys::String const&, mys::String const&) [clone .cold]': mys.cpp:(.text.unlikely._ZN3mys5RegexC2ERKNS_6StringES3_+0x78): undefined reference topcre2_code_free_32' /an/duyum/etki/ld: build/speed/mys.o: in function mys::Regex::Regex(mys::String const&, mys::String const&)': mys.cpp:(.text._ZN3mys5RegexC2ERKNS_6StringES3_+0xd0): undefined reference topcre2_compile_32' /an/duyum/etki/ld: mys.cpp:(.text._ZN3mys5RegexC2ERKNS6StringES3+0x195): undefined reference to pcre2_get_error_message_32' /an/duyum/etki/ld: build/speed/mys.o: in functionmys::RegexMatch::span(int) const': mys.cpp:(.text._ZNK3mys10RegexMatch4spanEi+0x26): undefined reference to pcre2_get_ovector_pointer_32' /an/duyum/etki/ld: mys.cpp:(.text._ZNK3mys10RegexMatch4spanEi+0x32): undefined reference topcre2_get_ovector_count_32' /an/duyum/etki/ld: build/speed/mys.o: in function mys::RegexMatch::span(int) const [clone .constprop.0]': mys.cpp:(.text._ZNK3mys10RegexMatch4spanEi.constprop.0+0x24): undefined reference topcre2_get_ovector_pointer_32' /an/duyum/etki/ld: mys.cpp:(.text._ZNK3mys10RegexMatch4spanEi.constprop.0+0x2f): undefined reference to pcre2_get_ovector_count_32' /an/duyum/etki/ld: build/speed/mys.o: in functionmys::Regex::get_error(int)': mys.cpp:(.text._ZN3mys5Regex9get_errorEi+0x61): undefined reference to pcre2_get_error_message_32' /an/duyum/etki/ld: build/speed/mys.o: in functionmys::RegexMatch::group(int) const': mys.cpp:(.text._ZNK3mys10RegexMatch5groupEi+0x30): undefined reference to pcre2_substring_get_bynumber_32' /an/duyum/etki/ld: mys.cpp:(.text._ZNK3mys10RegexMatch5groupEi+0x1b3): undefined reference topcre2_substring_free_32' /an/duyum/etki/ld: build/speed/mys.o: in function mys::Regex::match(mys::String const&) const [clone .cold]': mys.cpp:(.text.unlikely._ZNK3mys5Regex5matchERKNS_6StringE+0x39): undefined reference topcre2_match_data_free_32' /an/duyum/etki/ld: build/speed/mys.o: in function mys::Regex::match(mys::String const&) const': mys.cpp:(.text._ZNK3mys5Regex5matchERKNS_6StringE+0x5b): undefined reference topcre2_match_data_create_from_pattern_32' /an/duyum/etki/ld: mys.cpp:(.text._ZNK3mys5Regex5matchERKNS_6StringE+0xad): undefined reference to pcre2_match_32' /an/duyum/etki/ld: build/speed/mys.o: in functionmys::RegexMatch::group_index(mys::String const&) const': mys.cpp:(.text._ZNK3mys10RegexMatch11group_indexERKNS_6StringE+0x104): undefined reference to pcre2_substring_number_from_name_32' /an/duyum/etki/ld: build/speed/mys.o: in functionmys::Regex::replace(mys::String const&, mys::String const&, int) const': mys.cpp:(.text._ZNK3mys5Regex7replaceERKNS_6StringES3_i+0x131): undefined reference to pcre2_substitute_32' /an/duyum/etki/ld: build/speed/mys.o: in functionmys::Regex::split(mys::String const&) const': mys.cpp:(.text._ZNK3mys5Regex5splitERKNS_6StringE+0x82): undefined reference to pcre2_get_ovector_count_32' /an/duyum/etki/ld: build/speed/mys.o: in functionmys::RegexMatch::groups() const': mys.cpp:(.text._ZNK3mys10RegexMatch6groupsEv+0x56): undefined reference to pcre2_get_ovector_count_32' /an/duyum/etki/ld: build/speed/mys.o: in functionmys::RegexMatch::group_dict() const': mys.cpp:(.text._ZNK3mys10RegexMatch10group_dictEv+0x7b): undefined reference to pcre2_get_ovector_count_32' /an/duyum/etki/ld: mys.cpp:(.text._ZNK3mys10RegexMatch10group_dictEv+0x93): undefined reference topcre2_pattern_info_32' /an/duyum/etki/ld: mys.cpp:(.text._ZNK3mys10RegexMatch10group_dictEv+0xa6): undefined reference to pcre2_pattern_info_32' /an/duyum/etki/ld: mys.cpp:(.text._ZNK3mys10RegexMatch10group_dictEv+0xb9): undefined reference topcre2_pattern_info_32' collect2: error: ld returned 1 exit status make[1]: *** [build/speed/Makefile:88: build/speed/app] Error 1

Mys version 0.341.0 latest git(1df7f7a)

OS musl libc based custom x86_64 linux distribution

pmp-p commented 2 years ago

hi it may help if you provide the library pcre2 location and version you used on that custom distro "mys build" is expected to build it if you don't have it, but there could be a network error on remote repo used ( i know some of my CI sometimes had problem with pcre2 recently and i've switched to mirror https://ftp.exim.org/pub/pcre/pcre2-10.37.tar.gz ).

ghost commented 2 years ago

The local pcre2 installation were missing libpcre2-16.so and libpcre2-32.so so I have rebuilt it again enabling the 16 and 32 bit libraries as well. And now mys compiles the program and builds it without pcre2 errors. I guess the issue is resolved now.

eerimoq commented 2 years ago

I have considered to build the dependencies as part of mys build, or possibly when installing mys, since I guess most users compiles for the machine they installed mys on.