Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Need help using Inline::Module with JavaScript::Embedded

by syphilis (Archbishop)
on Jul 13, 2022 at 13:27 UTC ( [id://11145487]=note: print w/replies, xml ) Need Help??


in reply to Need help using Inline::Module with JavaScript::Embedded

I've been trying for a few days now to get JavaScript::Embedded to work with Inline::Module, but i never could get it to work.

I've downloaded JavaScript-Embedded-2.7.1, and had a go at building it on Windows 7, perl-5.36.0, but during 'make test', I continually hit the fatal perl.exe error "The procedure entry point GetSystemTimePreciseAsFileTime could not be located in the dynamic link library KERNEL32.dll".
This happens at the beginning of each of the 56 test scripts.
KERNEL32.dll is, of course a Windows system dll.

If I switch to perl-5.34.0 on the same machine, the module builds and tests fine - so I guess I'll work with that perl for the moment.

What is it that you want to fix ?
When the test suite is run for the first time, Inline::C performs its required compilation before the tests run.
When the test suite is run for the second time, no compilation is done and the existing compiled binaries are used.
That all looks correct. If I can get a better idea of what you want to alter then I might be able to help.

UPDATE: I think I can now see the issues that need to be addressed. I'll upload a separate post (in this thread) with some fixes, later today.

Cheers,
Rob
  • Comment on Re: Need help using Inline::Module with JavaScript::Embedded

Replies are listed 'Best First'.
Re^2: Need help using Inline::Module with JavaScript::Embedded
by harangzsolt33 (Chaplain) on Jul 13, 2022 at 18:38 UTC
    When the test suite is run for the first time, Inline::C performs its required compilation before the tests run. When the test suite is run for the second time, no compilation is done and the existing compiled binaries are used.

    Sorry for the slightly off-topic questions ahead, but I am still a beginner, learning Perl.

    So, I want to understand this a little bit better. So, when inline C is used, the compiler saves the binaries. How does Perl know not to compile it again? And where does the compiler save the binaries when done? Is it in /tmp/ramdisk or is there a specific directory for Perl inline C binaries? How are these binaries named? Are they given random names?

        Thank you for pointing me in the right direction. That answered my questions.
      In brief:

      How does Perl know not to compile it again?

      Any change to the C code (including changes affecting only whitespace) will be detected as a change to the MD5 fingerprint, and the code will only then be recompiled.
      Changes to Inline configuration options will not alone trigger a rebuild - unless it's the FORCE_BUILD option that is being changed to a TRUE value.

      And where does the compiler save the binaries when done?

      Generally the building is done in ./_Inline/build and the binaries saved in ./_Inline/lib, but the name of the parent directory is configurable.

      How are these binaries named?

      A combination of the filename of the script, and the leading hex digits of the MD5 fingerprint of the code section.

      Cheers,
      Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11145487]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (2)
As of 2024-04-20 04:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found