Re: [Oorexx-devel] DARWIN build issue

2019-02-19 Thread Enrico Sorichetti via Oorexx-devel
Hello Rick

Here is the modified function 

/**
 * test if an individual file is a case sensitive name
 *
 * @return For Unix systems, always returns true. For MacOS,
 * this needs to be determined on a case-by-case basis.
 */
bool SysFileSystem::isCaseSensitive(const char *name)
{
#ifndef HAVE_PC_CASE_SENSITIVE
return true;
#else
char  *tmp = strdup(name);
size_t len;

while ( !SysFileSystem::exists(tmp) )
{
len = strlen(tmp);
// scan backwards to find the previous directory delimiter
for (; len > 0; len --)
{
// is this the directory delimiter?
if (tmp[len] == '/')
{
tmp[len] = '\0';
break;
}
}
// ugly hack . . . to preserve the "/"
if ( len == 0 )
tmp[len+1] = '\0';
}

// at this point the tmp variable contains something that exists
long res = pathconf(tmp, _PC_CASE_SENSITIVE);
free(tmp) ;
if (res != -1)
{
return (res == 1);
}

// non-determined, just return true
return true;
#endif
}



There is a spelling glitch in config.h.i.cmake , the good one is

/* Define to 1 if _PC_CASE_SENSITIVE is a valid value */
#cmakedefine HAVE_PC_CASE_SENSITIVE

E






> On 19 Feb 2019, at 13:23, Rick McGuire  wrote:
> 
>  did what you suggested, but wouldn't performing the check on the directory 
> the file is in give a more accurate result?

___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] DARWIN build issue

2019-02-19 Thread Enrico Sorichetti via Oorexx-devel
Good Idea… I will run a few tests and let You know 

But …  the backtracking to an existing directory might be murky

E

> On 19 Feb 2019, at 13:23, Rick McGuire  wrote:
> 
> I did what you suggested, but wouldn't performing the check on the directory 
> the file is in give a more accurate result?
> 

___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] DARWIN build issue

2019-02-19 Thread Rick McGuire
On Mon, Feb 18, 2019 at 4:10 PM Enrico Sorichetti via Oorexx-devel <
oorexx-devel@lists.sourceforge.net> wrote:

> Here is the tested and WORKING code sequence
> IIRC I had to fix the testSuite in a couple of places
>
> I did run the test suite twice ,
> once on the boot volume ( case insensitive by default )
> The second time on an external disk with a case sensitive file system
>
>
> Pathconf needs  the  file or directory to exist
>
> Darwin case sensitiveness applies to each file system
> So in case of file not found it will return the system case sensitiveness
>
I did what you suggested, but wouldn't performing the check on the
directory the file is in give a more accurate result?

Rick


>
> On NOT Darwin systems it will just cost one extra call ,
> If You are trying to squeeze performance to the last bit
> The second call could be #ifdeffed  ,
>
> Cheers
> E
>
>
>
> /**
>  * indicate whether the file system is case sensitive.
>  *
>  * @return For Unix systems, always returns true. For MacOS,
>  * this needs to be determined on a case-by-case basis.
>  * This returns the information for the root file system
>  */
> bool SysFileSystem::isCaseSensitive()
> {
> #ifdef HAVE_PC_CASE_SENSITIVE
> long res = pathconf("/", _PC_CASE_SENSITIVE);
> if (res != -1)
> {
> return (res==1);
> }
> #endif
> // any error means this value is not supported for this file system
> // so the result is most likely true (unix standard)
> return true;
> }
>
> /**
>  * test if an individual file is a case sensitive name
>  *
>  * @return For Unix systems, always returns true. For MacOS,
>  * this needs to be determined on a case-by-case basis.
>  */
> bool SysFileSystem::isCaseSensitive(const char *name)
> {
> #ifdef HAVE_PC_CASE_SENSITIVE
> long res = pathconf(name, _PC_CASE_SENSITIVE);
> if (res != -1)
> {
> return (res==1) ;
> }
> // probably file not found
> // returns the information for the root file system
> res = pathconf("/", _PC_CASE_SENSITIVE);
> if (res != -1)
> {
> return (res==1) ;
> }
> #endif
> // any error means this the value is not supported for this file system
> // so the result is most likely true (unix standard)
> return true;
> }
>
>
>
>
> On 18 Feb 2019, at 21:52, Erich Steinböck 
> wrote:
>
> PC_CASE_SENSITIVE
>
>
> ___
> Oorexx-devel mailing list
> Oorexx-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>
___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] DARWIN build issue

2019-02-18 Thread Rick McGuire
Yeah, I have no idea what the compiler is objecting to. There's nothing
wrong with that bit of code.

Rick

On Mon, Feb 18, 2019 at 5:18 PM Enrico Sorichetti via Oorexx-devel <
oorexx-devel@lists.sourceforge.net> wrote:

> Unfortunately it seems there are some issues with the centos 7 gcc
> compilers
>  they are a bit outdated g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)
>
> And  the build chokes with
>
> In file included from
> /home/vagrant/ooRexx.svn.src/interpreter/platform/unix/SysRexxUtil.cpp:181:0:
> /home/vagrant/ooRexx.svn.src/interpreter/runtime/RexxUtilCommon.hpp: In
> constructor 'TreeFinder::AttributeMask::AttributeMask()':
> /home/vagrant/ooRexx.svn.src/interpreter/runtime/RexxUtilCommon.hpp:278:11:
> error: array used as initializer
>{
>
> Installed clang and everything seems to work even if clang is not the
> latest one
>
> clang version 3.4.2 (tags/RELEASE_34/dot2-final)
>
> The cmake command
>
> cmake -G Ninja -DCMAKE_C_COMPILER=`which clang`
> -DCMAKE_CXX_COMPILER=`which clang++`
> -DCMAKE_INSTALL_PREFIX=/home/vagrant/ooRexx
> -DCMAKE_BUILD_TYPE=Release /home/vagrant/ooRexx.svn.src
>
>
>
> To be sure I run the build 2 x 2 and the second run confirmed the first one
>
> Clang works gcc does not
> Ninja
> E
>
> On 18 Feb 2019, at 22:15, Rick McGuire  wrote:
>
>
> There are spurious leading "_" characters on the #ifdef test. I'll fix
> this with the other issues you raised shortly.
>
> Rick
>
> On Mon, Feb 18, 2019 at 3:53 PM Erich Steinböck <
> erich.steinbo...@gmail.com> wrote:
>
>> Our Mac build slave finds _PC_CASE_SENSITIVE
>>
>> ~~~
>> -- Looking for _PC_CASE_SENSITIVE
>> -- Looking for _PC_CASE_SENSITIVE - found
>> ~~~
>>
>> but still correctly builds SysFileSystem which seems impossible due to a
>> typo `if (res \= -1)` that should prevent compilation. (The bug repeats
>> a few lines further down).
>>
>> The built Rexx executable incorrectly returns true for
>> .File~isCaseSensitive (the file system is not case sensitive).
>>
>> SysFileSystem:
>>
>> ~~~
>> bool SysFileSystem::isCaseSensitive()
>> {
>> #ifndef _HAVE_PC_CASE_SENSITIVE
>> return true;
>> #else
>> long res = pathconf("/", _PC_CASE_SENSITIVE);
>> if (res \= -1)
>> {
>> return res == 1;
>> }
>> ~~~
>> ___
>> Oorexx-devel mailing list
>> Oorexx-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>>
> ___
> Oorexx-devel mailing list
> Oorexx-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>
>
> ___
> Oorexx-devel mailing list
> Oorexx-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>
___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] DARWIN build issue

2019-02-18 Thread Enrico Sorichetti via Oorexx-devel
Unfortunately it seems there are some issues with the centos 7 gcc compilers 
 they are a bit outdated g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)

And  the build chokes with
 
In file included from 
/home/vagrant/ooRexx.svn.src/interpreter/platform/unix/SysRexxUtil.cpp:181:0:
/home/vagrant/ooRexx.svn.src/interpreter/runtime/RexxUtilCommon.hpp: In 
constructor 'TreeFinder::AttributeMask::AttributeMask()':
/home/vagrant/ooRexx.svn.src/interpreter/runtime/RexxUtilCommon.hpp:278:11: 
error: array used as initializer
   {

Installed clang and everything seems to work even if clang is not the latest one

clang version 3.4.2 (tags/RELEASE_34/dot2-final)

The cmake command  

cmake -G Ninja -DCMAKE_C_COMPILER=`which clang` -DCMAKE_CXX_COMPILER=`which 
clang++` -DCMAKE_INSTALL_PREFIX=/home/vagrant/ooRexx 
-DCMAKE_BUILD_TYPE=Release /home/vagrant/ooRexx.svn.src



To be sure I run the build 2 x 2 and the second run confirmed the first one

Clang works gcc does not
Ninja
E

> On 18 Feb 2019, at 22:15, Rick McGuire  wrote:
> 
> There are spurious leading "_" characters on the #ifdef test. I'll fix this 
> with the other issues you raised shortly. 
> 
> Rick
> 
> On Mon, Feb 18, 2019 at 3:53 PM Erich Steinböck  > wrote:
> Our Mac build slave finds _PC_CASE_SENSITIVE
> 
> ~~~
> -- Looking for _PC_CASE_SENSITIVE
> -- Looking for _PC_CASE_SENSITIVE - found
> ~~~
> 
> but still correctly builds SysFileSystem which seems impossible due to a typo 
> `if (res \= -1)` that should prevent compilation. (The bug repeats a few 
> lines further down).
> 
> The built Rexx executable incorrectly returns true for .File~isCaseSensitive 
> (the file system is not case sensitive).
> 
> SysFileSystem:
> 
> ~~~
> bool SysFileSystem::isCaseSensitive()
> {
> #ifndef _HAVE_PC_CASE_SENSITIVE
> return true;
> #else
> long res = pathconf("/", _PC_CASE_SENSITIVE);
> if (res \= -1)
> {
> return res == 1;
> }
> ~~~
> ___
> Oorexx-devel mailing list
> Oorexx-devel@lists.sourceforge.net 
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel 
> 
> ___
> Oorexx-devel mailing list
> Oorexx-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel

___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] DARWIN build issue

2019-02-18 Thread Rick McGuire
There are spurious leading "_" characters on the #ifdef test. I'll fix this
with the other issues you raised shortly.

Rick

On Mon, Feb 18, 2019 at 3:53 PM Erich Steinböck 
wrote:

> Our Mac build slave finds _PC_CASE_SENSITIVE
>
> ~~~
> -- Looking for _PC_CASE_SENSITIVE
> -- Looking for _PC_CASE_SENSITIVE - found
> ~~~
>
> but still correctly builds SysFileSystem which seems impossible due to a
> typo `if (res \= -1)` that should prevent compilation. (The bug repeats a
> few lines further down).
>
> The built Rexx executable incorrectly returns true for
> .File~isCaseSensitive (the file system is not case sensitive).
>
> SysFileSystem:
>
> ~~~
> bool SysFileSystem::isCaseSensitive()
> {
> #ifndef _HAVE_PC_CASE_SENSITIVE
> return true;
> #else
> long res = pathconf("/", _PC_CASE_SENSITIVE);
> if (res \= -1)
> {
> return res == 1;
> }
> ~~~
> ___
> Oorexx-devel mailing list
> Oorexx-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>
___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] DARWIN build issue

2019-02-18 Thread Enrico Sorichetti via Oorexx-devel
Here is the tested and WORKING code sequence 
IIRC I had to fix the testSuite in a couple of places

I did run the test suite twice , 
once on the boot volume ( case insensitive by default )
The second time on an external disk with a case sensitive file system


Pathconf needs  the  file or directory to exist 

Darwin case sensitiveness applies to each file system 
So in case of file not found it will return the system case sensitiveness 

On NOT Darwin systems it will just cost one extra call , 
If You are trying to squeeze performance to the last bit
The second call could be #ifdeffed  ,

Cheers 
E 



/**
 * indicate whether the file system is case sensitive.
 *
 * @return For Unix systems, always returns true. For MacOS,
 * this needs to be determined on a case-by-case basis.
 * This returns the information for the root file system
 */
bool SysFileSystem::isCaseSensitive()
{
#ifdef HAVE_PC_CASE_SENSITIVE
long res = pathconf("/", _PC_CASE_SENSITIVE);
if (res != -1)
{
return (res==1);
}
#endif
// any error means this value is not supported for this file system
// so the result is most likely true (unix standard)
return true;
}

/**
 * test if an individual file is a case sensitive name
 *
 * @return For Unix systems, always returns true. For MacOS,
 * this needs to be determined on a case-by-case basis.
 */
bool SysFileSystem::isCaseSensitive(const char *name)
{
#ifdef HAVE_PC_CASE_SENSITIVE
long res = pathconf(name, _PC_CASE_SENSITIVE);
if (res != -1)
{
return (res==1) ;
}
// probably file not found
// returns the information for the root file system
res = pathconf("/", _PC_CASE_SENSITIVE);
if (res != -1)
{
return (res==1) ;
}
#endif
// any error means this the value is not supported for this file system
// so the result is most likely true (unix standard)
return true;
}




> On 18 Feb 2019, at 21:52, Erich Steinböck  wrote:
> 
> PC_CASE_SENSITIVE

___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


[Oorexx-devel] DARWIN build issue

2019-02-18 Thread Erich Steinböck
Our Mac build slave finds _PC_CASE_SENSITIVE

~~~
-- Looking for _PC_CASE_SENSITIVE
-- Looking for _PC_CASE_SENSITIVE - found
~~~

but still correctly builds SysFileSystem which seems impossible due to a
typo `if (res \= -1)` that should prevent compilation. (The bug repeats a
few lines further down).

The built Rexx executable incorrectly returns true for
.File~isCaseSensitive (the file system is not case sensitive).

SysFileSystem:

~~~
bool SysFileSystem::isCaseSensitive()
{
#ifndef _HAVE_PC_CASE_SENSITIVE
return true;
#else
long res = pathconf("/", _PC_CASE_SENSITIVE);
if (res \= -1)
{
return res == 1;
}
~~~
___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel