*ONE* KOS Error: libbz2 validation error

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
Doctor Dan
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 35
Joined: Sat Dec 27, 2014 11:17 pm
Has liked: 0
Been liked: 0

*ONE* KOS Error: libbz2 validation error

Post by Doctor Dan » Thu Feb 16, 2017 6:12 pm

Nice job on the new guide and kos_install_script.sh at https://dcemulation.org/?title=DCEmulation:IRC_Chat https://dcemulation.org/?title=Compiling_KOS_on_Windows

Everything worked fine, except for one error I'm having, preventing me from running build-all.sh

Code: Select all

make: *** [opt/toolchains/dc/kos/../kos-ports/scripts/validate.mk:9 validate-dist] error 1
I could research and test different fixes, but I don't want to break my install. the kos_install_script took 6 hours to complete. I'd rather wait from a proper situation specific solution from someone who knows what they're talking about here than redo everything

Thanks a lot for any help 8-)
Last edited by Doctor Dan on Fri Feb 17, 2017 5:03 pm, edited 1 time in total.
User avatar
bogglez
Moderator
Moderator
Posts: 576
Joined: Sun Apr 20, 2014 9:45 am
Has liked: 0
Been liked: 0

Re: *ONE* KOS Error: libbz2 validation error

Post by bogglez » Fri Feb 17, 2017 9:30 am

Thanks for the compliment!

BlueCrab should be able to help with that better than me.

However, if you're not using libbz in your game you can just build the ports that you need for you game, if any, and start development already. If you don't use libbz in your game you don't need this port.

You also don't need to rerun the whole script, just the kos-ports related stuff.
Wiki & tutorials: http://dcemulation.org/?title=Development
Wiki feedback: viewtopic.php?f=29&t=103940
My libgl playground (not for production): https://bitbucket.org/bogglez/libgl15
My lxdream fork (with small fixes): https://bitbucket.org/bogglez/lxdream
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5387
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has liked: 1 time
Been liked: 12 times
Contact:

Re: *ONE* KOS Error: libbz2 validation error

Post by BlueCrab » Fri Feb 17, 2017 1:51 pm

Is there anything above that line that might shed more light on what the issue is? Unfortunately, that doesn't tell me much of anything -- there should be an error message before that.

But, as bogglez said, unless you're planning on using libbz2, then you shouldn't worry about it. This is why I don't encourage using the build-all script. :wink:
Doctor Dan
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 35
Joined: Sat Dec 27, 2014 11:17 pm
Has liked: 0
Been liked: 0

Re: *ONE* KOS Error: libbz2 validation error

Post by Doctor Dan » Fri Feb 17, 2017 4:54 pm

Well for some reason I can compile the dreameye example, and the g1ata example, but if I try the hello example, it fails due to genromfs
hello.png
hello.png (7.31 KiB) Viewed 1721 times
dreameye.png
Here are the libbz2 errors, and the same thing happens when I try to build all the examples in the examples root directory
errors.png
I would like to resolve any of that so I know everything is functioning correctly, and I'm a novice, so when I get errors I know it's me and not missing components
Thanks for the help though. I'm going to setup my CRT w/ 6ft coders cable and start trying the examples out. I'll probably learn programming by building larger applications out of the examples

Again amazing job on the kos_setup_script. This is my 5th or 6th time attempting to build the sdk
Doctor Dan
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 35
Joined: Sat Dec 27, 2014 11:17 pm
Has liked: 0
Been liked: 0

Re: *ONE* KOS Error: libbz2 validation error

Post by Doctor Dan » Fri Feb 17, 2017 4:59 pm

Tried to edit but I can only have 3 attachments

Here are the kos-ports build-all.sh errors
kosports.png
kosports.png (10.78 KiB) Viewed 1721 times
Edit:
It also compains about makefile.rules, I know this is something really simple, but I don't know how to correct

Code: Select all

make *** [path/to/kos/Makefile.rules:19: stuff.o] Error 1
I won't spam the board for help after this, I just want to get it up and running where I can compile the examples
Thanks again

---------------------------------------------------
Edit2: The validation error also happens when trying to build SDL (is this 1.2 or 2?). Same thing happens with LibPNG

So I don't think it's just LibBZ2, that's the first KOS-Port, so I think the problem is much larger

Here is the output from build-all.sh
build-all.png
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5387
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has liked: 1 time
Been liked: 12 times
Contact:

Re: *ONE* KOS Error: libbz2 validation error

Post by BlueCrab » Sat Feb 18, 2017 11:20 am

That means you don't have Python installed properly. Disable the validation step in the config.mk file by changing the VALIDATE_DISTFILES line to be false instead of true.

As for genromfs, that's already been discussed in the programming forum. Speaking of which, that's where this belongs, so off we go.
Doctor Dan
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 35
Joined: Sat Dec 27, 2014 11:17 pm
Has liked: 0
Been liked: 0

Re: *ONE* KOS Error: libbz2 validation error

Post by Doctor Dan » Sat Feb 18, 2017 3:35 pm

Well I disabled the validation parameter, and when I attempted to run build-all.sh it returns immediately without output, same thing for clean-all.sh.

Unless when I reopen the MSys2 MinGW shell I have to input something to use the KOS profile/config. I was using the same window from initial install and closed last night

I installed python with 'pacman -Sy python', and changed the validation back to true and there was no change in the returning of build-all/clean-all

Now when I run 'make' on anything, it outputs this
make.png
So it's probably some environment variable or config command I'm not aware of
As for genromfs, that's already been discussed in the programming forum. Speaking of which, that's where this belongs, so off we go.
Could you link to the specific thread you're talking about?

----------------------------
I understand from looking at other threads like this that when someone who doesn't know what they're doing asks for help with something like this, it's usually responded to with annoyance and contempt or 'figure it out yourself', which I totally understand(not saying it's this board). But I'd like to get this up and running so I know any problems I encounter are me and not some wrong config in the toolchain.

I do have a few questions regarding SDL which I'll make another thread a little bit after I get this running and do my own research, but I just want to reassure that I won't spam the board asking for help with stuff I have no idea what I'm doing

There's also someone at dc-talk trying to get a toolchain running, and ran into the same problems I had before I used the new guide, so this thread will help since he'll probably run into the same issue http://dreamcast-talk.com/forum/viewtop ... f=5&t=9931

Not to overstate but thanks again for the help
User avatar
bogglez
Moderator
Moderator
Posts: 576
Joined: Sun Apr 20, 2014 9:45 am
Has liked: 0
Been liked: 0

Re: *ONE* KOS Error: libbz2 validation error

Post by bogglez » Sat Feb 18, 2017 4:01 pm

You should run

Code: Select all

. /opt/toolchains/dc/kos/environ.sh
to have the environment variables set again.

Regarding genromfs, atariowl wanted to work on this a bit, but I don't know whether he had any success. He used a downloaded executable as a workaround

viewtopic.php?f=29&t=103940&p=1052599&h ... s#p1052159
Wiki & tutorials: http://dcemulation.org/?title=Development
Wiki feedback: viewtopic.php?f=29&t=103940
My libgl playground (not for production): https://bitbucket.org/bogglez/libgl15
My lxdream fork (with small fixes): https://bitbucket.org/bogglez/lxdream
nymus
DC Developer
DC Developer
Posts: 955
Joined: Tue Feb 11, 2003 4:12 pm
Location: In a Dream
Has liked: 0
Been liked: 1 time

Re: *ONE* KOS Error: libbz2 validation error

Post by nymus » Sat Feb 18, 2017 4:54 pm

Regarding genromfs, I don't think it has external dependencies so you could just go into ${KOS_BASE}/utils/genromfs and "make" which should build it. if not, looks like bogglez linked to the alternative thread...

Going with what Bluecrab said about Python not being installed, check which version pacman installed for you. I have encountered a situation on NetBSD which installs a versioned python binary eg /usr/pkg/bin/python-3.4 so typing "python" at the command prompt does not find the command in the environment.

To resolve this, I added an alias to my .profile (.bashrc in Linux) "alias python='/usr/pkg/bin/python-3.4'. This "might" get the validate script to work so you can compile kos-ports as is. Always source the environ.sh before attempting to build anything e.g. by adding it to your .profile.

Compiling gcc, binutils and newlib takes the most time so you won't need 6 hours unless you delete the sh-elf and arm-eabi directories.

Good luck getting everything running. We all went through this first hurdle.
behold the mind
inspired by Dreamcast
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5387
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has liked: 1 time
Been liked: 12 times
Contact:

Re: *ONE* KOS Error: libbz2 validation error

Post by BlueCrab » Sat Feb 18, 2017 5:26 pm

nymus wrote:Regarding genromfs, I don't think it has external dependencies so you could just go into ${KOS_BASE}/utils/genromfs and "make" which should build it. if not, looks like bogglez linked to the alternative thread...
The problem is genromfs does require a POSIX environment (with a POSIX-ish libc and all), which isn't normally installed in MSYS2/MinGW...

@Doctor Dan: From what I remember hearing, to fix the issue, you need to install the MSYS2 GCC, then use the MSYS shell (not the MinGW one). Then, genromfs should be able to be built. Dark Morford in that other thread did do it, so perhaps either PM him or find him on IRC to ask for more info...
Doctor Dan
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 35
Joined: Sat Dec 27, 2014 11:17 pm
Has liked: 0
Been liked: 0

Re: *ONE* KOS Error: libbz2 validation error

Post by Doctor Dan » Sat Feb 18, 2017 6:07 pm

I see, the only reason I'm using MinGW is because in the guide it says
As the setup completes, it will ask whether you want to open a shell. Don't. Open C:\msys32\mingw32_shell.bat instead (mingw shell instead of msys2 shell).
I'll give it a go later, thanks for patience

-----------
Edit:
I installed GCC using 'pacman -Sy gcc' on MSYS2 shell, which it gave me an error about cygwin dll path and advised to restart the PC, without restarting I did the same in MinGW shell, it worked, then switched back to MSYS2 shell, no change, ran pacman command to install GCC using msys2 shell, worked this time, still no change. Restarted PC, no change, re-ran pacman GCC in MSYS2 shell , no change

I then tried to 'make clean' and 'make' in $kos_base and it tells me 'you don't seem to have a working environ.sh'. Which is confusing because I already built it

Do you advise I delete the entire /opt/ folder, and re-run the kos_setup_script.sh using MSYS2 shell? Or will this break things more?
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5387
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has liked: 1 time
Been liked: 12 times
Contact:

Re: *ONE* KOS Error: libbz2 validation error

Post by BlueCrab » Sun Feb 19, 2017 1:27 am

You shouldn't have to rebuild the entire compiler.

You do, however, have to source the environ script every time you start the shell (or cause it to be done every time by putting it in your bash startup). That's why you're getting the error about not having a working environ script.

I don't use Windows for development at all, so I really can't be of much help beyond suggesting what I've seen other people say worked for them.
Doctor Dan
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 35
Joined: Sat Dec 27, 2014 11:17 pm
Has liked: 0
Been liked: 0

Re: *ONE* KOS Error: libbz2 validation error

Post by Doctor Dan » Sun Feb 19, 2017 2:27 am

Alright. So I'll rebuild KOS, copy the environ script to the bash startup, install python/gcc, (then switch to MYSY2 from MinGW or use MSYS2 the entire time?), then find the Dark Morford and post results tomorrow

I'm going to try to build a Linux kernel if I can, then attempt implementing a writable SD card filesystem to install packages to
User avatar
bogglez
Moderator
Moderator
Posts: 576
Joined: Sun Apr 20, 2014 9:45 am
Has liked: 0
Been liked: 0

Re: *ONE* KOS Error: libbz2 validation error

Post by bogglez » Sun Feb 19, 2017 4:31 pm

Ah yeah I remember now.. if you use the mingw shell instead it should work according to someone else, in which case I'll correct that note in the wiki.. I just never got any confirmation and don't know whether the list of packages changes. I also don't use Windows so I rely on reports
Wiki & tutorials: http://dcemulation.org/?title=Development
Wiki feedback: viewtopic.php?f=29&t=103940
My libgl playground (not for production): https://bitbucket.org/bogglez/libgl15
My lxdream fork (with small fixes): https://bitbucket.org/bogglez/lxdream
Doctor Dan
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 35
Joined: Sat Dec 27, 2014 11:17 pm
Has liked: 0
Been liked: 0

Re: *ONE* KOS Error: libbz2 validation error

Post by Doctor Dan » Thu Feb 23, 2017 4:59 pm

Hey thanks a real lot for all your replies and explainations. I distanced myself from this project for a few days, if I don't go through all your replies in detail tonight I'll get it running over the weekend. Don't think I asked for help for no reason and ditched it :)

--------
Edit: My issue with both environ.sh and build-all.sh was I was using the "SH" command (according to the guide) instead of ".". Using "." environ.sh resets the variables and I was able to build the previous samples again, and build-all.sh is currently building. After build-all.sh I'm going to try getting genromfs to build and edit this post again
Doctor Dan
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 35
Joined: Sat Dec 27, 2014 11:17 pm
Has liked: 0
Been liked: 0

Re: *ONE* KOS Error: libbz2 validation error

Post by Doctor Dan » Thu Feb 23, 2017 6:07 pm

When I try to build genromfs this is the output

Code: Select all

Dan@Dan-Desktop MINGW32 /opt/toolchains/dc/kos/utils/genromfs
$ make
cc -O2 -Wall    -c -o genromfs.o genromfs.c
In file included from genromfs.c:83:0:
C:/msys32/mingw32/include/netinet/in.h:73:2: error: unknown type name 'u_long'
  u_long s_addr;
  ^~~~~~
C:/msys32/mingw32/include/netinet/in.h:116:2: error: unknown type name 'u_char'
  u_char sin_len;
  ^~~~~~
C:/msys32/mingw32/include/netinet/in.h:117:2: error: unknown type name 'u_char'
  u_char sin_family;
  ^~~~~~
C:/msys32/mingw32/include/netinet/in.h:118:2: error: unknown type name 'u_short'
  u_short sin_port;
  ^~~~~~~
genromfs.c:92:5: error: unknown type name 'int32_t'
     int32_t nextfh;
     ^~~~~~~
genromfs.c:93:5: error: unknown type name 'int32_t'
     int32_t spec;
     ^~~~~~~
genromfs.c:94:5: error: unknown type name 'int32_t'
     int32_t size;
     ^~~~~~~
genromfs.c:95:5: error: unknown type name 'int32_t'
     int32_t checksum;
     ^~~~~~~
genromfs.c: In function 'nodematch':
genromfs.c:209:12: warning: implicit declaration of function 'fnmatch' [-Wimplic                                                                                                                                                                                               it-function-declaration]
     return fnmatch(pattern, start, FNM_PATHNAME | FNM_PERIOD);
            ^~~~~~~
genromfs.c:209:36: error: 'FNM_PATHNAME' undeclared (first use in this function)
     return fnmatch(pattern, start, FNM_PATHNAME | FNM_PERIOD);
                                    ^~~~~~~~~~~~
genromfs.c:209:36: note: each undeclared identifier is reported only once for ea                                                                                                                                                                                               ch function it appears in
genromfs.c:209:51: error: 'FNM_PERIOD' undeclared (first use in this function)
     return fnmatch(pattern, start, FNM_PATHNAME | FNM_PERIOD);
                                                   ^~~~~~~~~~
genromfs.c: In function 'romfs_checksum':
genromfs.c:229:5: error: unknown type name 'int32_t'
     int32_t sum, *ptr;
     ^~~~~~~
genromfs.c:236:16: warning: implicit declaration of function 'ntohl' [-Wimplicit                                                                                                                                                                                               -function-declaration]
         sum += ntohl(*ptr++);
                ^~~~~
genromfs.c: In function 'fixsum':
genromfs.c:245:20: warning: implicit declaration of function 'htonl' [-Wimplicit                                                                                                                                                                                               -function-declaration]
     ri->checksum = htonl(-romfs_checksum(ri, size));
                    ^~~~~
genromfs.c: In function 'dumpnode':
genromfs.c:361:13: warning: implicit declaration of function 'S_ISLNK' [-Wimplic                                                                                                                                                                                               it-function-declaration]
     else if(S_ISLNK(node->modes)) {
             ^~~~~~~
genromfs.c:365:9: warning: implicit declaration of function 'readlink' [-Wimplic                                                                                                                                                                                               it-function-declaration]
         readlink(node->realname, bigbuf, node->size);
         ^~~~~~~~
genromfs.c:407:25: warning: implicit declaration of function 'major' [-Wimplicit                                                                                                                                                                                               -function-declaration]
         ri.spec = htonl(major(node->devnode) << 16 | minor(node->devnode));
                         ^~~~~
genromfs.c:407:54: warning: implicit declaration of function 'minor' [-Wimplicit                                                                                                                                                                                               -function-declaration]
         ri.spec = htonl(major(node->devnode) << 16 | minor(node->devnode));
                                                      ^~~~~
genromfs.c:419:13: warning: implicit declaration of function 'S_ISSOCK' [-Wimpli                                                                                                                                                                                               cit-function-declaration]
     else if(S_ISSOCK(node->modes)) {
             ^~~~~~~~
genromfs.c: In function 'processdir':
genromfs.c:583:13: warning: implicit declaration of function 'lstat' [-Wimplicit                                                                                                                                                                                               -function-declaration]
         if(!lstat(link->realname, sb)) {
             ^~~~~
genromfs.c:659:35: warning: implicit declaration of function 'makedev' [-Wimplic                                                                                                                                                                                               it-function-declaration]
                     sb->st_rdev = makedev(major, minor);
                                   ^~~~~~~
genromfs.c: In function 'nodematch':
genromfs.c:210:1: warning: control reaches end of non-void function [-Wreturn-ty                                                                                                                                                                                               pe]
 }
 ^
make: *** [<builtin>: genromfs.o] Error 1

Dan@Dan-Desktop MINGW32 /opt/toolchains/dc/kos/utils/genromfs
$
I did this
AtariOwl wrote:OK

Sooooo... i got frustrated trying to get genromfs to build so i took an exe from ...

https://sourceforge.net/p/cadcdev/kalli ... /genromfs/

that wasnt happy as it didnt have a cygwin1.dll so i took one from

https://github.com/Light-Dark/dcvqtex

and put it in the genromfs directory


Can i compile?
Image


Now i know this is something of a shortcut and we really should try to get this working properly. But i'm up and running at least.
I can compile now, but its kind of hack, maybe those errors are a larger issue that needs fixing. Just letting you guys know

It seems I'm all setup. Thanks @BlueCrab @Bogglez @Nymus 8-)
Post Reply