apjanke / octave-packajoozle

A just-for-fun reworking of GNU Octave's `pkg` tool
GNU General Public License v3.0
4 stars 1 forks source link

pkj review INDEX generation failure #44

Closed lostbard closed 5 years ago

lostbard commented 5 years ago

When testing against the dicom package, I am getting an error about no existing packinfo/INDEX file generate_index at line 874 column 7.

Mos tlikely due to the fact that the dicom package doesn't have any m files (only src files) so no index would be created from the inst dir.

apjanke commented 5 years ago

I can't get dicom to build on macOS 10.14.

octave:6> pkj review -verbose dicom-0.2.1.tar.gz
PkgReviewer: Working dir: /var/folders/_4/9mx5ryp52bb_z6drbcbrhwl40000gn/T/packajoozle/pkj-review/work-WlTVy8
PkgReviewer: Reviewing dicom 0.2.1 from file dicom-0.2.1.tar.gz
PkgReviewer: Examining distribution file contents
PkgReviewer: Installing package
/usr/local/Cellar/octave/4.4.1_6/bin/mkoctfile-4.4.1 -I/usr/local/include/gdcm-2.8   -DHAVE_CONFIG_H -c dicomdict.cpp
/usr/local/Cellar/octave/4.4.1_6/bin/mkoctfile-4.4.1  -I/usr/local/include/gdcm-2.8   -DHAVE_CONFIG_H -Wl,-framework -Wli,CoreFoundation dicomdict.cpp
/usr/local/Cellar/octave/4.4.1_6/bin/mkoctfile-4.4.1  -I/usr/local/include/gdcm-2.8   -DHAVE_CONFIG_H -Wl,-framework -Wli,CoreFoundation dicomread.cpp
/usr/local/Cellar/octave/4.4.1_6/bin/mkoctfile-4.4.1  -I/usr/local/include/gdcm-2.8   -DHAVE_CONFIG_H -Wl,-framework -Wli,CoreFoundation _gendicomdict.cpp
/usr/local/Cellar/octave/4.4.1_6/bin/mkoctfile-4.4.1  -I/usr/local/include/gdcm-2.8   -DHAVE_CONFIG_H -Wl,-framework -Wli,CoreFoundation isdicom.cpp
/usr/local/Cellar/octave/4.4.1_6/bin/mkoctfile-4.4.1  -I/usr/local/include/gdcm-2.8   -DHAVE_CONFIG_H -Wl,-framework -Wli,CoreFoundation dicomuid.cpp
warning: unknown warning option '-Wli,CoreFoundation'; did you mean '-Wdocumentation'? [-Wunknown-warning-option]
warning: unknown warning option '-Wli,CoreFoundation'; did you mean '-Wdocumentation'? [-Wunknown-warning-option]
warning: unknown warning option '-Wli,CoreFoundation'; did you mean '-Wdocumentation'? [-Wunknown-warning-option]
warning: unknown warning option '-Wli,CoreFoundation'; did you mean '-Wdocumentation'? [-Wunknown-warning-option]
warning: unknown warning option '-Wli,CoreFoundation'; did you mean '-Wdocumentation'? [-Wunknown-warning-option]
isdicom.cpp:35:10: warning: 'file_stat' is deprecated [-Wdeprecated-declarations]
  return file_stat (filename).exists () && reader.Read ();
         ^
/usr/local/Cellar/octave/4.4.1_6/include/octave-4.4.1/octave/../octave/file-stat.h:330:1: note: 'file_stat' has been explicitly marked deprecated here
OCTAVE_DEPRECATED (4.2, "use 'octave::sys::file_stat' instead")
^
/usr/local/Cellar/octave/4.4.1_6/include/octave-4.4.1/octave/octave-config.h:73:59: note: expanded from macro 'OCTAVE_DEPRECATED'
#      define OCTAVE_DEPRECATED(ver, msg) __attribute__ ((__deprecated__))
                                                          ^
1 warning generated.
ld: framework not found -loctinterp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [dicomuid.oct] Error 1
make: *** Waiting for unfinished jobs....
2 warnings generated.
ld: framework not found -loctinterp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [isdicom.oct] Error 1
1 warning generated.
ld: framework not found -loctinterp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [dicomread.oct] Error 1
1 warning generated.
ld: framework not found -loctinterp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [_gendicomdict.oct] Error 1
1 warning generated.
ld: framework not found -loctinterp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [dicomdict.oct] Error 1

Installed dicom 0.2.1 from /var/folders/_4/9mx5ryp52bb_z6drbcbrhwl40000gn/T/packajoozle/pkj-review/work-WlTVy8/dicom-0.2.1.tar.gz to user pkg dir
Package review failed for dicom-0.2.1.tar.gz.
Errors:
  Installation failed: pkj: error running `make' for the dicom package.
octave:7>

But I think I see the problem. Octave pkg generates the INDEX file automatically if it's not present. I don't think I have that part implemented yet. Marking as bug.

apjanke commented 5 years ago

Could you post your error message in a comment on this bug report?

apjanke commented 5 years ago

Maybe I see the problem. There was a missing "w" for file open mode in generate_index's fopen call. Fixed in https://github.com/apjanke/octave-packajoozle/commit/ac968c1a8d17b427589e0d4f1b7c24d187bcce6a, I think.

Pull and try now.

lostbard commented 5 years ago

I guess dicom has an issue with macOS then - can you provide the config.log from its build?

apjanke commented 5 years ago

Here you go:

config.log

This is under Octave 4.4.1 on macOS 10.14.3.

lostbard commented 5 years ago

I just realized that was 0.2.1 not the to be released 0.2.2. If you have some spare time can you check against the next version ? https://sourceforge.net/p/octave/package-releases/_discuss/thread/5954dd9951/3095/attachment/dicom-0.2.2.tar.gz

lostbard commented 5 years ago

Your packajoozle fix above fixed the review for dicom in Linux for me :)

apjanke commented 5 years ago

Here's the output:

octave:25> ver
----------------------------------------------------------------------
GNU Octave Version: 4.4.1 (hg id: 1f46d371968c)
GNU Octave License: GNU General Public License
Operating System: Darwin 18.2.0 Darwin Kernel Version 18.2.0: Thu Dec 20 20:46:53 PST 2018; root:xnu-4903.241.1~1/RELEASE_X86_64 x86_64
----------------------------------------------------------------------
no packages installed.
octave:26> pkj install -verbose dicom-0.2.2.tar.gz
pkj: build temp dir: /var/folders/_4/9mx5ryp52bb_z6drbcbrhwl40000gn/T/packajoozle-build-S7u5w5
/usr/local/Cellar/octave/4.4.1_6/bin/mkoctfile-4.4.1 -I/usr/local/include/gdcm-2.8   -DHAVE_CONFIG_H -c dicomdict.cpp
/usr/local/Cellar/octave/4.4.1_6/bin/mkoctfile-4.4.1  -I/usr/local/include/gdcm-2.8   -DHAVE_CONFIG_H -Wl,-framework -Wli,CoreFoundation dicomdict.cpp
/usr/local/Cellar/octave/4.4.1_6/bin/mkoctfile-4.4.1  -I/usr/local/include/gdcm-2.8   -DHAVE_CONFIG_H -Wl,-framework -Wli,CoreFoundation dicomread.cpp
/usr/local/Cellar/octave/4.4.1_6/bin/mkoctfile-4.4.1  -I/usr/local/include/gdcm-2.8   -DHAVE_CONFIG_H -Wl,-framework -Wli,CoreFoundation _gendicomdict.cpp
/usr/local/Cellar/octave/4.4.1_6/bin/mkoctfile-4.4.1  -I/usr/local/include/gdcm-2.8   -DHAVE_CONFIG_H -Wl,-framework -Wli,CoreFoundation isdicom.cpp
/usr/local/Cellar/octave/4.4.1_6/bin/mkoctfile-4.4.1  -I/usr/local/include/gdcm-2.8   -DHAVE_CONFIG_H -Wl,-framework -Wli,CoreFoundation dicomuid.cpp
warning: unknown warning option '-Wli,CoreFoundation'; did you mean '-Wdocumentation'? [-Wunknown-warning-option]
warning: unknown warning option '-Wli,CoreFoundation'; did you mean '-Wdocumentation'? [-Wunknown-warning-option]
warning: unknown warning option '-Wli,CoreFoundation'; did you mean '-Wdocumentation'? [-Wunknown-warning-option]
warning: unknown warning option '-Wli,CoreFoundation'; did you mean '-Wdocumentation'? [-Wunknown-warning-option]
warning: unknown warning option '-Wli,CoreFoundation'; did you mean '-Wdocumentation'? [-Wunknown-warning-option]
1 warning generated.
ld: framework not found -loctinterp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [dicomuid.oct] Error 1
make: *** Waiting for unfinished jobs....
1 warning generated.
ld: framework not found -loctinterp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [isdicom.oct] Error 1
1 warning generated.
ld: framework not found -loctinterp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [dicomread.oct] Error 1
1 warning generated.
ld: framework not found -loctinterp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [_gendicomdict.oct] Error 1
1 warning generated.
ld: framework not found -loctinterp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [dicomdict.oct] Error 1

Installed dicom 0.2.2 from dicom-0.2.2.tar.gz to user pkg dir
octave:27>

And the config.log: config.log

lostbard commented 5 years ago

I made a change in the repo that hopefully will fix it https://sourceforge.net/p/octave/dicom/ci/default/tree/

apjanke commented 5 years ago

The dicom make dist and make clean targets aren't working for me on macOS. Maybe they're using GNU grep extensions that are not compatible with BSD grep?

$ hg status
[~/tmp/octave-forge/repos/octave-dicom]
$ hg log |head
changeset:   97:22df5448861a
tag:         tip
user:        John Donoghue
date:        Tue Mar 26 09:18:41 2019 -0400
summary:     * src/configure.ac: fix typo on macos addition of foundation framework

changeset:   96:d541b22db840
user:        John Donoghue
date:        Thu Jan 03 13:11:55 2019 -0500
summary:     *  src/dicomdict.cpp: move include of interpreter.h to after config.h
[~/tmp/octave-forge/repos/octave-dicom]
$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.14.3
BuildVersion:   18D109
[~/tmp/octave-forge/repos/octave-dicom]
$ grep --version
grep (BSD grep) 2.5.1-FreeBSD
[~/tmp/octave-forge/repos/octave-dicom]
$ make dist
usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]]
    [-e pattern] [-f file] [--binary-files=value] [--color=when]
    [--context[=num]] [--directories=action] [--label] [--line-buffered]
    [--null] [pattern] [file ...]
Creating package version  release ...
rm -f -r "target/-"
hg archive --exclude ".hg*" --type files "target/-"
cd "target/-/src" && ./bootstrap && rm -f -r "autom4te.cache"
# need to build any tests
cd "target/-" && /Applications/Xcode-10.1.app/Contents/Developer/usr/bin/make test_files
usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]]
    [-e pattern] [-f file] [--binary-files=value] [--color=when]
    [--context[=num]] [--directories=action] [--label] [--line-buffered]
    [--null] [pattern] [file ...]
Extracting tests from src/dicomdict.cpp ...
Extracting tests from src/dicominfo.cpp ...
Extracting tests from src/dicomlookup.cpp ...
Extracting tests from src/dicomread.cpp ...
Extracting tests from src/dicomuid.cpp ...
Extracting tests from src/dicomwrite.cpp ...
Extracting tests from src/isdicom.cpp ...
chmod -R a+rX,u+w,go-w "target/-"
tar -c -f - --posix -C "target/" "-" | gzip -9n > "target/-.tar.gz"
tar: no files or directories specified
[~/tmp/octave-forge/repos/octave-dicom]
$ tar tvf target/-.tar.gz
[~/tmp/octave-forge/repos/octave-dicom]
$ make clean
usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]]
    [-e pattern] [-f file] [--binary-files=value] [--color=when]
    [--context[=num]] [--directories=action] [--label] [--line-buffered]
    [--null] [pattern] [file ...]
rm -f -r target fntests.log
test ! -e src/Makefile || /Applications/Xcode-10.1.app/Contents/Developer/usr/bin/make -C src clean
[~/tmp/octave-forge/repos/octave-dicom]
$
lostbard commented 5 years ago

Yeah am guessing grep --files-with-matches '^%!' doesn't work in macos

lostbard commented 5 years ago

Its doing:

grep --files-with-matches '^%!' src/*.cpp

Which should be the same as

grep -l '^%!' src/*.cpp (that's a lowercase L)

So maybe it doesn't recognize the long format command line ?

apjanke commented 5 years ago

Nah, it's the -P for PCRE that it doesn't like:

$ grep -r --files-with-matches '^%!' .
./src/dicomwrite.cpp
./src/isdicom.cpp
./src/dicomread.cpp
./src/dicomdict.cpp
./src/dicomuid.cpp
./src/dicomlookup.cpp
./src/dicominfo.cpp
$ grep -sPho '(?<=(//|\#\#) PKG_ADD: ).*' **/*.cpp
usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]]
    [-e pattern] [-f file] [--binary-files=value] [--color=when]
    [--context[=num]] [--directories=action] [--label] [--line-buffered]
    [--null] [pattern] [file ...]
lostbard commented 5 years ago

ok Its also not grabbing the name correctly - things like:

hg archive --exclude ".hg*" --type files "target/-"

should be target/dicom-0..2.2

apjanke commented 5 years ago

Here's a version that looks like it works in both BSD and GNU sed:

$ sed -n -E -e 's/^Name: *(\S*)/\1/p' DESCRIPTION
dicom
$ gsed -n -E -e 's/^Name: *(\S*)/\1/p' DESCRIPTION
dicom
lostbard commented 5 years ago

I pushed up using grep, the same as whats in io, so hopefully that will work. I also removed the PKG_ADD as its not being used anyway

apjanke commented 5 years ago

Works now. Thanks!

$ make dist
Creating package version 0.2.2 release ...
rm -f -r "target/dicom-0.2.2"
hg archive --exclude ".hg*" --type files "target/dicom-0.2.2"
cd "target/dicom-0.2.2/src" && ./bootstrap && rm -f -r "autom4te.cache"
# need to build any tests
cd "target/dicom-0.2.2" && /Applications/Xcode-10.1.app/Contents/Developer/usr/bin/make test_files
Extracting tests from src/dicomdict.cpp ...
Extracting tests from src/dicominfo.cpp ...
Extracting tests from src/dicomlookup.cpp ...
Extracting tests from src/dicomread.cpp ...
Extracting tests from src/dicomuid.cpp ...
Extracting tests from src/dicomwrite.cpp ...
Extracting tests from src/isdicom.cpp ...
chmod -R a+rX,u+w,go-w "target/dicom-0.2.2"
tar -c -f - --posix -C "target/" "dicom-0.2.2" | gzip -9n > "target/dicom-0.2.2.tar.gz"
[~/tmp/octave-forge/repos/octave-dicom]
$ make clean
rm -f -r target fntests.log
test ! -e src/Makefile || /Applications/Xcode-10.1.app/Contents/Developer/usr/bin/make -C src clean

It passes pkj review now for me.

octave:1> addpath('~/local/repos/octave-packajoozle/inst')
octave:2> pkj review target/dicom-0.2.2.tar.gz
pkj: build temp dir: /var/folders/_4/9mx5ryp52bb_z6drbcbrhwl40000gn/T/packajoozle/packajoozle-build-S0JpyS
Installed dicom 0.2.2 from /var/folders/_4/9mx5ryp52bb_z6drbcbrhwl40000gn/T/packajoozle/pkj-review/work-ckUO0Y/dicom-0.2.2.tar.gz to user pkg dir
For information about changes from previous versions of the dicom package, run 'news dicom'.
pkj: loading: dicom 0.2.2
Package review passed for target/dicom-0.2.2.tar.gz.

And I can see a generated INDEX file in the installation.

[~/octave/dicom-0.2.2]
$ ls packinfo/INDEX
packinfo/INDEX
[~/octave/dicom-0.2.2]
$ cat packinfo/INDEX
dicom >> dicom: file io for medical images and other data
imaging
  _gendicomdict
  dicomdict
  dicominfo
  dicomlookup
  dicomread
  dicomuid
  dicomwrite
  isdicom
[~/octave/dicom-0.2.2]
$

Maybe I fixed the INDEX generation in one of the recent changes.

lostbard commented 5 years ago

nice! and thanks for helping get it working for the mac!

apjanke commented 5 years ago

Great! Closing as fixed.