Weird OSX issue

Chris via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue May 12 01:50:59 PDT 2015


On Monday, 27 April 2015 at 13:54:42 UTC, Steven Schveighoffer
wrote:
> On 4/25/15 3:07 AM, Dan Olson wrote:
>> Jacob Carlborg <doob at me.com> writes:
>>
>>> On 2015-04-24 20:37, Steven Schveighoffer wrote:
>>>
>>>> So am I going crazy? Or is dmd doing things differently 
>>>> depending on
>>>> where its environment is? Any compiler gurus out there 
>>>> understand why
>>>> the symbol is different?
>>>>
>>>> I don't want to file a bug with this, because it seems 
>>>> dependent on
>>>> installation location, would possibly not be reproducible.
>>>
>>> I can't reproduce this with DMD from DVM (compiler is 
>>> installed in the
>>> user home directory).
>>
>> I have lots of version laying around and they all worked fine 
>> on the
>> posted code.
>>
>> But maybe a clue here...
>>
>> $ ~/dmd2.066.0/osx/bin/dmd mod1.d
>> $ nm mod1.o | grep start
>>                  U _D4core6thread6Thread5startMFZv
>> $ dmd mod1.d
>> $ nm mod1.o | grep start
>>                  U 
>> _D4core6thread6Thread5startMFNbZC4core6thread6Thread
>>
>> --- a/src/core/thread.d
>> +++ b/src/core/thread.d
>> @@ -587,7 +587,7 @@ class Thread
>>       * Throws:
>>       *  ThreadException if the thread fails to start.
>>       */
>> -    final Thread start()
>> +    final Thread start() nothrow
>>      in
>>      {
>>          assert( !next && !prev );
>>
>> I wonder if dmd -v will show where its picking up stuff.
>>
>
> Thank you. It is something I missed. Lo and behold:
>
> dmd -v mod1.d:
>
> ...
>
> import    
> core.thread	(/usr/share/dmd/src/druntime/import/core/thread.di)
>
> ...
>
> ~/Downloads/dmd2/osx/bin/dmd -v mod1.d:
>
> ...
>
> import    core.thread 
> (/Users/steves/Downloads/dmd2/osx/bin/../../src/druntime/import/core/thread.d)
>
> ...
>
> Hm... thread.di vs thread.d (and I didn't notice before because 
> all the other imports were .d, I just glanced over that detail).
>
> And so, let's see here:
>
> ls -l /usr/share/dmd/src/druntime/import/core/thread.*
>
> -rw-rw-r--   1 steves  staff  157781 Mar 24 10:44 thread.d
> -rw-rw-r--+  1 steves  staff   31382 Feb 24  2014 thread.di
>
> Hey, looky there :)
>
> So, looking at time machine (love that feature), I found that 
> when I installed 2.066, back in October, we had switched to 
> using thread.d instead of thread.di. But the installer did not 
> erase the old thread.di.
>
> BTW, found this: 
> https://github.com/D-Programming-Language/druntime/pull/865
>
> So I think the issue here is that the pkg installer on OSX does 
> not clean up the target directory if it already exists (or at 
> least purposely remove thread.di). Will look into fixing that. 
> At least now, it works properly, thanks (did a rm -rf 
> /usr/share/dmd and reinstall).
>
> -Steve

Now that you mention it, I had similar issues on my Linux distro
at work (Ubuntu, alas!). The installer for 2.067.0 (or 2.066.0?)
didn't erase old files and I got compiler errors for no apparent
reason. What I did was to use dvm to install and manage my dmd
versions. This is much cleaner. I just didn't have the patience
to go through all the /dmd/ directories and clean them up.

dvm installs its own copy, it's not a system wide installation,
so you never have any issues with old files. I wouldn't want to
miss it now.

dvm install 2.067.1

later in your shell you just type

dvm use 2.067.1

https://github.com/jacob-carlborg/dvm


More information about the Digitalmars-d-learn mailing list