Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed compilation on Haiku #13018

Closed
wants to merge 1 commit into from
Closed

Fixed compilation on Haiku #13018

wants to merge 1 commit into from

Conversation

Teashrock
Copy link
Contributor

Fixed #13017.
It's a temporary solution, I suppose.

It's a temporary solution, I suppose.
@Araq
Copy link
Member

Araq commented Jan 3, 2020

Such a weird bug, maybe instead compile koch.nim with --gc:none (it doesn't allocate all that much memory anyway),

@Teashrock
Copy link
Contributor Author

@Araq
I'll try this. Meanwile, I decided to open Python console and apply ord() to both of characters. ':' is 58, and '/' is 47. This is a difference by 11. Maybe there's some bitwise operation accidently doing this?

@Araq
Copy link
Member

Araq commented Jan 3, 2020

Who knows but it doesn't seem likely.

@Teashrock
Copy link
Contributor Author

Teashrock commented Jan 3, 2020

@Araq
Now it tries to lauch ./koch boot -d:release automatically right after it's compilation and then throws said error.

And no, manually compiling koch with --gc:none didn't help. Still the same error.

@Araq
Copy link
Member

Araq commented Jan 5, 2020

Well sorry, this workaround is unacceptable. We need to find and fix the root cause.

@Teashrock
Copy link
Contributor Author

@Araq
Actually, it may even be a bug in Haiku's GCC 8, not in compiler sources.

@Teashrock
Copy link
Contributor Author

But no, then it would be GCC complaining... So, it's not the case.

@Araq
Copy link
Member

Araq commented Jan 8, 2020

Huh? Of course GCC could produce wrong code and then we would see this behavior.

@Teashrock
Copy link
Contributor Author

@Araq
My bad. I just was too sleepy at that moment. I'll check.

@Teashrock
Copy link
Contributor Author

Teashrock commented Jan 8, 2020

@Araq
I sorta localized the bug. With 90% probability it's at os.'/' It's a simple "joinPath" function. This function for some unknown reason converts any group of ':' to '/' or nothing. In fact, just perceives it like path divider.

Examples:
1:

echo "one:two:three"

Result: one:two:three

2:

import os

echo "one:two" / ":three"
echo "test::::::::" / "test"
echo "test" / "::::::::test"
echo "test::::" / "::::test"

Result:
one/two/three
test/test
test/test
test/test

@Araq
Copy link
Member

Araq commented Jan 8, 2020

osseps.nim contains this section

  AltSep* =
    when doslikeFileSystem: '/'
    elif defined(haiku): ':'
    else: DirSep

which seems to be responsible. :-)

@genotrance
Copy link
Contributor

elif defined(haiku): ':'

This was inherited from platform.nim and wasn't in the original osseps.nim prior to this PR.

@Teashrock
Copy link
Contributor Author

@Araq
What the heck? O_O What sort of "genius" did this? I thought this was a bug, and this happened to be intended!

Give me time, I'll make another pull request.

@Teashrock Teashrock closed this Jan 9, 2020
@Teashrock Teashrock deleted the patch-1 branch January 9, 2020 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Haiku] Nimcache glitches on Koch boot
3 participants