Recent

Author Topic: PowerPC request for testing  (Read 12047 times)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
PowerPC request for testing
« on: October 05, 2014, 04:40:33 pm »
Could people with a PowerPC please test issue
http://bugs.freepascal.org/view.php?id=14473
to see if it still is a problem?

Thanks!
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

jwdietrich

  • Hero Member
  • *****
  • Posts: 1232
    • formatio reticularis
Re: PowerPC request for testing
« Reply #1 on: October 05, 2014, 09:20:59 pm »
The latest Lazarus version that supports PowerPC is 1.2.2. Will that be OK?

With Lazarus 1.2.2 I get a table with headers only (see attached screenshot), which is obviously not intended.
« Last Edit: October 05, 2014, 09:35:11 pm by jwdietrich »
function GetRandomNumber: integer; // xkcd.com
begin
  GetRandomNumber := 4; // chosen by fair dice roll. Guaranteed to be random.
end;

http://www.formatio-reticularis.de

Lazarus 2.2.6 | FPC 3.2.2 | PPC, Intel, ARM | macOS, Windows, Linux

jwdietrich

  • Hero Member
  • *****
  • Posts: 1232
    • formatio reticularis
Re: PowerPC request for testing
« Reply #2 on: October 05, 2014, 09:37:39 pm »
BTW, the database file has to be copied into the bundle, otherwise I get an error message (see attachment).
function GetRandomNumber: integer; // xkcd.com
begin
  GetRandomNumber := 4; // chosen by fair dice roll. Guaranteed to be random.
end;

http://www.formatio-reticularis.de

Lazarus 2.2.6 | FPC 3.2.2 | PPC, Intel, ARM | macOS, Windows, Linux

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: PowerPC request for testing
« Reply #3 on: October 06, 2014, 08:36:36 am »
Thanks, DoDi, no headers only wasn't intended. You don't see any error messages at all?

This is how it looks on win32...

Ah well, given that Laz support for PowerPC seems to have ended (? sorry haven't kept up) a fix is unlikely but perhaps at least FPC can be fixed (if the problem is there and FPC still supports PowerPC)...

Edit: indicate my lack of knowledge re support status
« Last Edit: October 06, 2014, 08:40:41 am by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: PowerPC request for testing
« Reply #4 on: October 06, 2014, 09:49:05 am »
I don't know Lazarus still supports powerpc. Not having release binaries doesn't automatically indicate end of support? It might still be usable.

jwdietrich

  • Hero Member
  • *****
  • Posts: 1232
    • formatio reticularis
Re: PowerPC request for testing
« Reply #5 on: October 06, 2014, 06:04:08 pm »
I don't know Lazarus still supports powerpc. Not having release binaries doesn't automatically indicate end of support? It might still be usable.
Yes, currently every second version is available for PowerPC.
function GetRandomNumber: integer; // xkcd.com
begin
  GetRandomNumber := 4; // chosen by fair dice roll. Guaranteed to be random.
end;

http://www.formatio-reticularis.de

Lazarus 2.2.6 | FPC 3.2.2 | PPC, Intel, ARM | macOS, Windows, Linux

jwdietrich

  • Hero Member
  • *****
  • Posts: 1232
    • formatio reticularis
Re: PowerPC request for testing
« Reply #6 on: October 06, 2014, 10:48:00 pm »
Now I managed to compile Lazarus 1.2.4 from sources. It works well on a PowerMac G5 with Mac OS X 10.5 Leopard, but the DBase test program again delivers a table with headers only.

The bug has therefore to be considered as unresolved.
function GetRandomNumber: integer; // xkcd.com
begin
  GetRandomNumber := 4; // chosen by fair dice roll. Guaranteed to be random.
end;

http://www.formatio-reticularis.de

Lazarus 2.2.6 | FPC 3.2.2 | PPC, Intel, ARM | macOS, Windows, Linux

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: PowerPC request for testing
« Reply #7 on: October 07, 2014, 08:51:18 am »
You don't see any error messages at all?
Did you?

Now I managed to compile Lazarus 1.2.4 from sources.
Testing with trunk would have been even better :) though I suspect the problem is with the TDBF code in FPC itself.

If you'd like to, you could compile/run <fpc source dir>\packages\fcl-db\examples\dbftool.lpr with the test dbf in the same directory and post the entire output - it should list the field contents etc which I suspect it won't...
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

jwdietrich

  • Hero Member
  • *****
  • Posts: 1232
    • formatio reticularis
Re: PowerPC request for testing
« Reply #8 on: October 11, 2014, 08:21:20 pm »
Well, now I compiled Lazarus 1.3 Beta from trunk (SVN revision 46529), but the result is still the same. The program doesn't report any error.

Furthermore, the program dfbtool doesn't open the test dbf file. Rather it creates two demonstration DBFs and after that it silently quits.
function GetRandomNumber: integer; // xkcd.com
begin
  GetRandomNumber := 4; // chosen by fair dice roll. Guaranteed to be random.
end;

http://www.formatio-reticularis.de

Lazarus 2.2.6 | FPC 3.2.2 | PPC, Intel, ARM | macOS, Windows, Linux

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: PowerPC request for testing
« Reply #9 on: October 27, 2014, 08:51:56 am »
Hi jwdietrich, sorry I responded so late and thanks for testing.

Code: [Select]
Rather it creates two demonstration DBFs and after that it silently quits.

Running dbftool from FPC 2.6.4 on my x86 Windows system without any dbfs present in the directory correctly prints out:
Code: [Select]
Could not find any dbf files
and exits.
Running it with --createdemo gives (yes this is the 2.6.4 version of the code despite the output directory):
Code: [Select]
Creating CUSTOMER.DBF with table level 4
Creating EMPLOYEE.DBF with table level 4
*** Opening: C:\Development\fpctrunk\packages\fcl-db\examples\customer.dbf
Database tablelevel: 4
Database codepage:   1252
Record 1
Field CUST_NO has value: 1
Field CUSTOMER has value: Michael Design
Field CITY has value: San Diego
Field COUNTRY has value: USA

Record 2
Field CUST_NO has value: 2
Field CUSTOMER has value: Michael Design
Field CITY has value: San Diego
Field COUNTRY has value: USA

Record 3
Field CUST_NO has value: 3
Field CUSTOMER has value: VC Technologies
Field CITY has value: Dallas
Field COUNTRY has value: USA

Record 4
Field CUST_NO has value: 4
Field CUSTOMER has value: Klämpfl, Van Canneyt
Field CITY has value: Boston
Field COUNTRY has value: USA

Record 5
Field CUST_NO has value: 5
Field CUSTOMER has value: Felipe's Bank
Field CITY has value: Manchester
Field COUNTRY has value: England

*** Opening: C:\Development\fpctrunk\packages\fcl-db\examples\employee.dbf
Database tablelevel: 4
Database codepage:   1252
Record 1
Field EMP_NO has value: 1
Field FIRST_NAME has value: William
Field LAST_NAME has value: Shatner
Field PHONE_EXT has value: 1702
Field JOB_CODE has value: CEO
Field JOB_GRADE has value: 1
Field JOB_COUNTR has value: USA
Field SALARY has value: 48000

Record 2
Field EMP_NO has value: 2
Field FIRST_NAME has value: Ivan
Field LAST_NAME has value: Ishenin
Field PHONE_EXT has value: 9802
Field JOB_CODE has value: Eng
Field JOB_GRADE has value: 2
Field JOB_COUNTR has value: Russia
Field SALARY has value: 38000

Record 3
Field EMP_NO has value: 3
Field FIRST_NAME has value: Erin
Field LAST_NAME has value: Powell
Field PHONE_EXT has value: 1703
Field JOB_CODE has value: Admin
Field JOB_GRADE has value: 2
Field JOB_COUNTR has value: USA
Field SALARY has value: 45368

Record 4
Field EMP_NO has value: 4
Field FIRST_NAME has value: Margaret
Field LAST_NAME has value: Tetchy
Field PHONE_EXT has value: 3804
Field JOB_CODE has value: Eng
Field JOB_GRADE has value: 3
Field JOB_COUNTR has value: England
Field SALARY has value: 28045

Record 5
Field EMP_NO has value: 5
Field FIRST_NAME has value: Sergey
Field LAST_NAME has value: Bron
Field PHONE_EXT has value: 3807
Field JOB_CODE has value: Admin
Field JOB_GRADE has value: 3
Field JOB_COUNTR has value: England
Field SALARY has value: 24468
So there is something fishy going on on your PPC system...

Could you remove customer.dbf/employee.dbf if present, leaving the test db, and copy/paste the full output of the program please?
« Last Edit: October 27, 2014, 08:58:34 am by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

jwdietrich

  • Hero Member
  • *****
  • Posts: 1232
    • formatio reticularis
Re: PowerPC request for testing
« Reply #10 on: November 02, 2014, 11:29:15 pm »
It is weird. When run from Lazarus, dbftool creates the two demo databases (as if run with the option --createdemo), but if launched from shell it simply states "Could not find any dbf files".

Interestingly, if run from the shell with the option --createdemo it returns:

Creating CUSTOMER.DBF with table level 4
Creating EMPLOYEE.DBF with table level 4
Could not find any dbf files


There seems to be a problem with finding files, but only, if the program is run from shell.

If it is run from Lazarus the situation seems to be different. Stepping through the code of dbftool reveals that the procedure TDBFTool.DoRun correctly finds the test database file. DBFs.Count is > 0, therefore here the message "Could not find any dbf files" is not returned. Additionally, MyDbf.FilePath and MyDbf.TableName are correctly assigned. However, already with the first record MyDbf.EOF is true, therefore nothing else is returned.
function GetRandomNumber: integer; // xkcd.com
begin
  GetRandomNumber := 4; // chosen by fair dice roll. Guaranteed to be random.
end;

http://www.formatio-reticularis.de

Lazarus 2.2.6 | FPC 3.2.2 | PPC, Intel, ARM | macOS, Windows, Linux

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: PowerPC request for testing
« Reply #11 on: November 03, 2014, 03:15:15 pm »
Re running from Lazarus: have a look at Run/Run parameters; --createdbf may be specified as an argument there...

Quote
There seems to be a problem with finding files, but only, if the program is run from shell.
I'm assuming the files actually don't exist either?

Quote
However, already with the first record MyDbf.EOF is true
Interesting, thanks. TDBF does some parsing of the header to get language ID, dbf version, find any associated memo files etc so the tdbf code may well fail there...
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

jwdietrich

  • Hero Member
  • *****
  • Posts: 1232
    • formatio reticularis
Re: PowerPC request for testing
« Reply #12 on: November 08, 2014, 09:30:32 pm »
After debugging for two hours we have moved forward a small step.

There is a bug in Free Pascal's DBF tool. On Mac OS X, it cannot find any file when run from Terminal, since the default working directory is the current user directory (~), rather than the program's directory. (Interestingly, this is different, if the program is launched from Lazarus; here, the working directory IS the folder, where the program is located.)

By changing the procedure GetDBFList in the DBF tool to

Code: [Select]
  procedure GetDBFList(Results: TStringList);
  // Gets list of all .dbf files in a directory and its subdirectories.
  var
    r: TSearchRec;
{$IFDEF DARWIN}
    thePath: String;
{$ENDIF}
  begin
{$IFDEF DARWIN}
    thePath := ParamStr(0);
    thePath := ExtractFileDir(thePath);
    if not SetCurrentDir(thePath) then
      writeln('Error setting path to ' + thePath);
{$ENDIF}
    results.Clear;
    if FindFirst('*.dbf', faAnyFile -
{$WARNINGS OFF}
      faVolumeID - faSymLink
{$WARNINGS ON}
      , r) = 0 then
    begin
      repeat
        if (r.Attr and faDirectory) <> faDirectory then
        begin
          results.add(expandfilename(r.Name));
        end;
      until (FindNext(r) <> 0);
      findclose(r);
    end;
  end;

the demo file can be found. The program then returns

Code: [Select]
*** Opening: /....................../fcl-db/examples/Client.dbf
Database tablelevel: 7
Database codepage:   1252

There is still another bug, since the DBF tool doesn't find the DBF files that it created with the option --createdbf. The reason is that the files have an uppercase "DBF" extension, but the function FindFirst doesn't find them when searching for '*.dbf'. This is a bug in FindFirst, since the used file system is case-insensitive.

There is also still the bug in the DBase Test program that seems to be independent from the bug in the DBF tool.

Edit: I have reported both bugs in the FPC bug tracker (issue IDs 0027017 and 0027018).
« Last Edit: November 09, 2014, 01:47:36 am by jwdietrich »
function GetRandomNumber: integer; // xkcd.com
begin
  GetRandomNumber := 4; // chosen by fair dice roll. Guaranteed to be random.
end;

http://www.formatio-reticularis.de

Lazarus 2.2.6 | FPC 3.2.2 | PPC, Intel, ARM | macOS, Windows, Linux

kamischi

  • Full Member
  • ***
  • Posts: 177
Re: PowerPC request for testing
« Reply #13 on: November 09, 2014, 02:41:24 pm »
There is still another bug, since the DBF tool doesn't find the DBF files that it created with the option --createdbf. The reason is that the files have an uppercase "DBF" extension, but the function FindFirst doesn't find them when searching for '*.dbf'. This is a bug in FindFirst, since the used file system is case-insensitive.
My two cents: The default HFS file system is case insensitive, but it can also be chosen to be case sensitive.
fpc 2.6.4, lazarus 1.4.0, Mac OS X, fink

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: PowerPC request for testing
« Reply #14 on: November 09, 2014, 03:02:09 pm »
Thanks a lot for the investigation and bug reports.

Responding here for clarification to avoid complicating the bug report too much.
There is a bug in Free Pascal's DBF tool. On Mac OS X, it cannot find any file when run from Terminal, since the default working directory is the current user directory (~), rather than the program's directory. (Interestingly, this is different, if the program is launched from Lazarus; here, the working directory IS the folder, where the program is located.)

The program is designed to look in the current working directory (not the application directory) for dbf files. This makes it easier to test any dbf file "laying around"
1. So you mean that even changing to the directory with the dbf files (using cd) and then running dbftool fails? (And the current directory for some strange reason remains ~?)

Edit: noticed that running --createdemo under FPC trunk with Windows seems to create dbfs in the application dir, not in the current dir. Sorry about that. Going to fix it first...

2. You propose using paramstr(0) but that is unreliable as far as
http://wiki.lazarus.freepascal.org/Multiplatform_Programming_Guide#On_Unix_there_is_no_.22application_directory.22
is concerned (and AFAIR there is no cross platform solution to get the path of the application).

Additionally the help says:
Quote
In the interest of portability, the ParamStr function tries to behave the same on all operating systems: like the original ParamStr function in Turbo Pascal. This means even on Unix, paramstr(0) returns the full path to the program executable. A notable exception is Mac OS X, where the return value depends on how the application was started. It may be that just the name of the application is returned (in case of a command-line launch)
Obviously it seems to work for you but at least the help suggests it's not reliable...

Edit: although, to be hones, I actually use the same code in my fpcup installer which also runs on OSX...

My two cents: The default HFS file system is case insensitive, but it can also be chosen to be case sensitive.
Agreed. IIRC, even on Windows, an FS can be case sensitive (e.g. when installing Unix System Services).

As a workaround/fix I'll adjust the GetDBFList search code to search for all files then uppercase the extension and test for .DBF..
« Last Edit: November 09, 2014, 04:07:00 pm by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

 

TinyPortal © 2005-2018