Open maximusfox opened 4 years ago
I am guessing it is crashing somewhere here:
https://github.com/Perl5-FFI/FFI-Platypus-Lang-Go/blob/master/inc/mymm-build.pl#L93-L99
Because if it was a compile error it should print the appropriate diagnostic. It looks like Perl and go have the same arch (amd64). I think a Go uintptr
should be the same as a C size_t
?
My Go version:
go version go1.14.3 windows/amd64
My Perl version:
This is perl 5, version 28, subversion 0 (v5.28.0) built for MSWin32-x64-multi-thread
As i am anderstand both have amd64 arch.
I am add debug print to inc/mymm-build.pl using Data::Dumper module:
print Dumper(\%types);
Then i am try to run gmake manualy, and have this error againe:
λ gmake
"C:\Strawberry\perl\bin\perl.exe" inc/mymm-build.pl
Found go go1.14.3
For arch windows/amd64
$VAR1 = {
'gouint64' => 'sint64',
'goint8' => 'sint8',
'gochan' => 'opaque',
'gouint8' => 'sint8',
'gomap' => 'opaque',
'gouint32' => 'sint32',
'gobool' => 'uint8',
'gobyte' => 'uint8',
'gorune' => 'sint32',
'gofloat32' => 'float',
'goint64' => 'sint64',
'goint32' => 'sint32',
'goint16' => 'sint16',
'gouint' => 'uint64',
'goint' => 'sint64',
'gouintptr' => 'uint64',
'gofloat64' => 'double',
'gouint16' => 'sint16'
};
gmake: *** [Makefile:955: mymm-build] Error -1073741819
Generated simple.h:
/* Code generated by cmd/cgo; DO NOT EDIT. */
/* package command-line-arguments */
#line 1 "cgo-builtin-export-prolog"
#include <stddef.h> /* for ptrdiff_t below */
#ifndef GO_CGO_EXPORT_PROLOGUE_H
#define GO_CGO_EXPORT_PROLOGUE_H
#ifndef GO_CGO_GOSTRING_TYPEDEF
typedef struct { const char *p; ptrdiff_t n; } _GoString_;
#endif
#endif
/* Start of preamble from import "C" comments. */
/* End of preamble from import "C" comments. */
/* Start of boilerplate cgo prologue. */
#line 1 "cgo-gcc-export-header-prolog"
#ifndef GO_CGO_PROLOGUE_H
#define GO_CGO_PROLOGUE_H
typedef signed char GoInt8;
typedef unsigned char GoUint8;
typedef short GoInt16;
typedef unsigned short GoUint16;
typedef int GoInt32;
typedef unsigned int GoUint32;
typedef long long GoInt64;
typedef unsigned long long GoUint64;
typedef GoInt64 GoInt;
typedef GoUint64 GoUint;
typedef __SIZE_TYPE__ GoUintptr;
typedef float GoFloat32;
typedef double GoFloat64;
typedef float _Complex GoComplex64;
typedef double _Complex GoComplex128;
/*
static assertion to make sure the file is being used on architecture
at least with matching size of GoInt.
*/
typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1];
#ifndef GO_CGO_GOSTRING_TYPEDEF
typedef _GoString_ GoString;
#endif
typedef void *GoMap;
typedef void *GoChan;
typedef struct { void *t; void *v; } GoInterface;
typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
#endif
/* End of boilerplate cgo prologue. */
#ifdef __cplusplus
extern "C" {
#endif
extern GoUintptr SizeOfBool();
extern GoUintptr SizeOfInt();
extern GoUintptr SizeOfUint();
#ifdef __cplusplus
}
#endif
Interesting. I was able to get to my windows box this morning and reproduce this error. It seems to be creating the config.pl
needed for runtime correctly, but something in unwinding the simple.so file is going sideways.
As a workaround you can add || (exit 0)
to the call to inc/mymm-build.pl
to get make
to ignore the error. You can adjust the Makefile.PL
like this:
$postamble .=
"pure_all :: mymm-build\n" .
"mymm-build :\n" .
"\t\$(FULLPERL) inc/mymm-build.pl || (exit 0)\n\n";
obviously this is a bug somewhere, so I'd like to figure out why it is exiting with an error.
I am adjust Makefile.PL
like you say.
Then do this:
gmake
gmake test
gmake install
And module successfuly installed.
I think cpanm --force FFI::Platypus::Lang::Go
should work fine too.
Hi. I try to install your module using cpanminus, but have an error. Is it posible to fix? Install log: