Skip Menu |

This queue is for tickets about the IO-Compress-Brotli CPAN distribution.

Report information
The Basics
Id: 125995
Status: open
Priority: 0/
Queue: IO-Compress-Brotli

People
Owner: Nobody in particular
Requestors: ZDM [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: not installed under strawberry perl 5.28 x64
cp Brotli/tests/testdata/zeros.compressed blib\lib\IO\Compress\Brotli\tests\testdata\zeros.compressed cp Brotli/tests/testdata/zeros blib\lib\IO\Compress\Brotli\tests\testdata\zeros cd brotli && CFLAGS=-fPIC `which gmake || echo gmake` lib 'CFLAGS' is not recognized as an internal or external command, operable program or batch file. gmake` lib Running Mkbootstrap for Brotli () "D:\devel\perl\perl\bin\perl.exe" -MExtUtils::Command -e chmod -- 644 "Brotli.bs" "D:\devel\perl\perl\bin\perl.exe" -MExtUtils::Command::MM -e cp_nonempty -- Brotli.bs blib\arch\auto\IO\Compress\Brotli\Brotli.bs 644 "D:\devel\perl\perl\bin\perl.exe" "D:\devel\perl\perl\lib\ExtUtils/xsubpp" -typemap D:\devel\perl\perl\lib\ExtUtils\typemap -typemap C:\Users\zdm\AppData\Local\Temp\.cpanm\work\1533360812.7980\IO-Compress-Brotli-0.004001\typemap Brotli.xs > Brotli.xsc "D:\devel\perl\perl\bin\perl.exe" -MExtUtils::Command -e mv -- Brotli.xsc Brotli.c gcc -c -Ibrotli/c/include -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields -s -O2 -DVERSION=\"0.004001\" -DXS_VERSION=\"0.004001\" "-ID:\devel\perl\perl\lib\CORE" Brotli.c In file included from Brotli.xs:6:0: ppport.h:4385:0: warning: "WIDEST_UTYPE" redefined # define WIDEST_UTYPE U64TYPE In file included from D:\devel\perl\perl\lib\CORE/perl.h:2465:0, from Brotli.xs:3: D:\devel\perl\perl\lib\CORE/handy.h:1064:0: note: this is the location of the previous definition # define WIDEST_UTYPE U64 "D:\devel\perl\perl\bin\perl.exe" -MExtUtils::Mksymlists \ -e "Mksymlists('NAME'=>\"IO::Compress::Brotli\", 'DLBASE' => 'Brotli', 'DL_FUNCS' => { }, 'FUNCLIST' => [], 'IMPORTS' => { }, 'DL_VARS' => []);" g++.exe Brotli.def -o blib\arch\auto\IO\Compress\Brotli\Brotli.xs.dll -mdll -s -L"D:\devel\perl\perl\lib\CORE" -L"D:\devel\perl\c\lib" Brotli.o brotli/libbrotli.a "D:\devel\perl\perl\lib\CORE\libperl528.a" -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 -Wl,--enable-auto-image-base g++.exe: error: brotli/libbrotli.a: No such file or directory gmake: *** [Makefile:638: blib\arch\auto\IO\Compress\Brotli\Brotli.xs.dll] Error 1 FAIL ! Installing IO::Compress::Brotli failed. See C:\Users\zdm\AppData\Local\Temp\.cpanm\work\1533360812.7980\build.log for details. Retry with --force to force install it.
Successfully installed on Strawberry Perl 5.28.0 with some tweaks. Show quoted text
>cd IO-Compress-Brotli-0.004001 >cd brotli >bash
$CC=g++ CFLAGS+=-fpermissive make lib # for -fpermissive, cf. https://github.com/google/brotli/issues/731 $exit Show quoted text
>cd .. >cpanm -n .
You need to skip test (-n) or apply the following patch: --- 01-uncompress.t.orig +++ 01-uncompress.t @@ -15,6 +15,7 @@ is $decoded, $expected, "$test"; open FH, '<', $test; + binmode(FH); my $unbro = IO::Uncompress::Brotli->create; my ($buf, $out); until (eof FH) {
I added the "binmode FH" in development release 0.004_002, but I did not add -fpermissive. I see in the Github issue that a patch was merged to not require -fpermissive anymore, but the patch is not included in the latest release of Brotli (v1.0.7), which is what IO-Compress-Brotli 0.004_002 uses. I'm not familiar with writing Makefiles for Windows. Looking at a cpantesters report[0], the command cd brotli && CFLAGS=-fPIC `which gmake || echo gmake` lib is not valid on Windows. Can someone suggest a replacement for this that makes sense on Windows? I can then add a special case in Makefile.PL: If we are running on Windows, use an alternative command (which uses g++ and -fpermissive). [0]: http://www.cpantesters.org/cpan/report/3c3c319f-6c58-1014-9aec-d494a83b49b6
Above comment I used g++, but it was just my wrong assumption. gcc was there. I have attached a diff that makes it work on (and only on) Windows Straberry Perl. Basically avoiding commands that needs *nix shell. It uses File::Remove (on make clean,) which is preinstalled on the distro, but don't know if other distros do. Since I'm not familar with all the make systems' mechanics, I'm not sure it is the right way to go. Hope this helps.
Subject: win.diff
--- IO-Compress-Brotli-0.004001.orig/Makefile.PL +++ IO-Compress-Brotli-0.004001/Makefile.PL @@ -30,6 +30,6 @@ sub MY::postamble { ' $(MYEXTLIB): brotli/Makefile - cd brotli && CFLAGS=-fPIC `which gmake || echo $(MAKE)` lib + cd brotli && set CC=$(CC) && set CFLAGS=-fPIC && $(MAKE) lib ' } --- IO-Compress-Brotli-0.004001.orig/brotli/Makefile +++ IO-Compress-Brotli-0.004001/brotli/Makefile @@ -21,13 +21,13 @@ .PHONY: all clean test $(DIRS): - mkdir -p $@ + perl -MFile::Path -e 'File::Path::make_path(q[$@])' $(EXECUTABLE): $(OBJECTS) $(CC) $(LDFLAGS) $(OBJECTS) -lm -o $(BINDIR)/$(EXECUTABLE) lib: $(LIBOBJECTS) - rm -f $(LIB_A) + perl -e 'unlink($$_) for @ARGV' $(LIB_A) ar -crs $(LIB_A) $(LIBOBJECTS) test: $(EXECUTABLE) @@ -35,7 +35,7 @@ tests/roundtrip_test.sh clean: - rm -rf $(BINDIR) $(LIB_A) + perl -MFile::Remove -e 'File::Remove::remove(\1, $$_) for @ARGV' $(BINDIR) $(LIB_A) .SECONDEXPANSION: $(OBJECTS): $$(patsubst %.o,%.c,$$(patsubst $$(OBJDIR)/%,%,$$@)) | $(DIRS) --- IO-Compress-Brotli-0.004001.orig/t/01-uncompress.t +++ IO-Compress-Brotli-0.004001/t/01-uncompress.t @@ -15,6 +15,7 @@ is $decoded, $expected, "$test"; open FH, '<', $test; + binmode(FH); my $unbro = IO::Uncompress::Brotli->create; my ($buf, $out); until (eof FH) {