Giter VIP home page Giter VIP logo

Comments (9)

Frityet avatar Frityet commented on September 25, 2024 1

Also, I have the most recent version of pcre2 on brew

You most definitely do not. The latest version is 10.43

https://formulae.brew.sh/formula/pcre2

Yep, just found out it wasn't linked, thank you!

from crystal.

Frityet avatar Frityet commented on September 25, 2024 1

Verified, works like a charm! I will make the PR now

from crystal.

Frityet avatar Frityet commented on September 25, 2024

When attempting to compile the project:

❯ make -j
Using /usr/local/opt/llvm/bin/llvm-config [version=17.0.6]
clang++ -c  -o src/llvm/ext/llvm_ext.o src/llvm/ext/llvm_ext.cc -I/usr/local/Cellar/llvm/17.0.6_1/include -std=c++17 -stdlib=libc++   -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
CRYSTAL_CONFIG_BUILD_COMMIT="4cea10199" CRYSTAL_CONFIG_PATH='$ORIGIN/../share/crystal/src' SOURCE_DATE_EPOCH="1712838701"  CRYSTAL_CONFIG_LIBRARY_PATH='$ORIGIN/../lib/crystal' ./bin/crystal build -D strict_multi_assign -D preview_overload_order -Dwithout_interpreter  -o .build/crystal src/compiler/crystal.cr -D without_openssl -D without_zlib -D use_pcre2
Showing last frame. Use --error-trace for full trace.

There was a problem expanding macro 'embed'

Code in macro 'def_to_s'

 2 | ECR.embed "/Users/frityet/Documents/Packages/crystal/src/compiler/crystal/tools/init/template/example_spec.cr.ecr", "__io__"
     ^
Called macro defined in src/ecr/macros.cr:69:3

 69 | macro embed(filename, io_name)

Which expanded to:

 > 1 | {{ run("ecr/process", "/Users/frityet/Documents/Packages/crystal/src/compiler/crystal/tools/init/template/example_spec.cr.ecr", "__io__") }}
          ^--
Error: Error executing run (exit code: 1): ecr/process /Users/frityet/Documents/Packages/crystal/src/compiler/crystal/tools/init/template/example_spec.cr.ecr __io__


stderr:

    Unhandled exception: Invalid Int32: "36-RC1" (ArgumentError)
      from /Users/frityet/.cache/crystal/Users-frityet-Documents-Packages-crystal-src-ecr-process.cr/macro_run in 'raise<ArgumentError>:NoReturn'
      from /Users/frityet/.cache/crystal/Users-frityet-Documents-Packages-crystal-src-ecr-process.cr/macro_run in 'String#to_i32<Int32, Bool, Bool, Bool, Bool, Bool>:Int32'
      from /Users/frityet/.cache/crystal/Users-frityet-Documents-Packages-crystal-src-ecr-process.cr/macro_run in '__crystal_main'
      from /Users/frityet/.cache/crystal/Users-frityet-Documents-Packages-crystal-src-ecr-process.cr/macro_run in 'main'
      from /usr/lib/dyld in 'start'

make: *** [.build/crystal] Error 1

from crystal.

Blacksmoke16 avatar Blacksmoke16 commented on September 25, 2024

This is failing on

{version.byte_slice(0, dot).to_i, version.byte_slice(dot + 1, space - dot - 1).to_i}
because it seems the version of PCRE2 you have does not match the normal convention of XX.YY but instead is XX-RC1 format. Probably should handle this I'd wager, but until then can probably just work around it by upgrading PCRE2 to a more recent version.

from crystal.

Frityet avatar Frityet commented on September 25, 2024

This is failing on

{version.byte_slice(0, dot).to_i, version.byte_slice(dot + 1, space - dot - 1).to_i}

because it seems the version of PCRE2 you have does not match the normal convention of XX.YY but instead is XX-RC1 format. Probably should handle this I'd wager, but until then can probably just work around it by upgrading PCRE2 to a more recent version.

Is it alright for me to make a patch to accommodate for this? Or is it out of scope

from crystal.

straight-shoota avatar straight-shoota commented on September 25, 2024

This patch should fix it:

--- i/src/regex/pcre2.cr
+++ w/src/regex/pcre2.cr
@@ -17,7 +17,7 @@ module Regex::PCRE2
     version = self.version
     dot = version.index('.') || raise RuntimeError.new("Invalid libpcre2 version")
     space = version.index(' ', dot) || raise RuntimeError.new("Invalid libpcre2 version")
-    {version.byte_slice(0, dot).to_i, version.byte_slice(dot + 1, space - dot - 1).to_i}
+    {version.byte_slice(0, dot).to_i, version.byte_slice(dot + 1, space - dot - 1).to_i(strict: false)}
   end

   # :nodoc:

You can monkey patch the getter into your code to test this.

from crystal.

Blacksmoke16 avatar Blacksmoke16 commented on September 25, 2024

Also, I have the most recent version of pcre2 on brew

You most definitely do not. The latest version is 10.43. I don't even know where this 36-RC1 version is coming from 🤷. Probably old system version?

https://formulae.brew.sh/formula/pcre2

from crystal.

Frityet avatar Frityet commented on September 25, 2024

This patch should fix it:

--- i/src/regex/pcre2.cr
+++ w/src/regex/pcre2.cr
@@ -17,7 +17,7 @@ module Regex::PCRE2
     version = self.version
     dot = version.index('.') || raise RuntimeError.new("Invalid libpcre2 version")
     space = version.index(' ', dot) || raise RuntimeError.new("Invalid libpcre2 version")
-    {version.byte_slice(0, dot).to_i, version.byte_slice(dot + 1, space - dot - 1).to_i}
+    {version.byte_slice(0, dot).to_i, version.byte_slice(dot + 1, space - dot - 1).to_i(strict: false)}
   end

   # :nodoc:

You can monkey patch the getter into your code to test this.

Alright nice! Im guessing I shouldn't make a PR for this?

from crystal.

straight-shoota avatar straight-shoota commented on September 25, 2024

Feel free to do so if you can verify it actually works.

from crystal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.