-
Notifications
You must be signed in to change notification settings - Fork 375
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
idris2.ss: support powerpc #3326
Conversation
Every change in the bootstrap file's production procedure needs a change in the release checklist here https://github.com/idris-lang/Idris2/blob/main/Release/CHECKLIST or else it will be just overwritten on the next release |
@buzden Thank you. Could you please take a look and say if that will do? I am not really sure of conventions in that regard. |
@barracuda156 Is this something that needs to be added manually, or can we configure Chez Scheme to consider PowerPC support valid from the get-go? As far as I can tell, there is nothing functionally changing, other than adding the right magic strings to let the pattern match load the library on those architectures as well? |
@CodingCellist Perhaps you can, but I have no idea where that should be done. Locally I had to patch this file to make it work. |
This is only changing the bootstrap file, which is an output of the Idris compiler. That's fine (and necessary) for a one-time fix of bootstrap. But it's not actually changing the source to the compiler itself. If you recompile Idris with this bootstrap compiler, it will no longer produce compatible programs. The PR changes After that, I don't think we need the additional checklist item, when the next bootstrap file is generated, it should be built with the updated compiler. |
@dunhamsteve Thank you! For some reason BBEdit did not find that instance for me. I will fix it now and drop checklist. |
@dunhamsteve Is it correct now? |
I think you were doing |
@dunhamsteve Thank you, added that. |
Looks good to me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's one other spot where chez handles the machine type: support/chez/support.ss
.
I think it's fine if support is selectively added for Chez, but it might be just as well (and a bit more robust) to also add the same additional machine types for the Racket backed if they are supported by Racket as well.
Seems like Racket does indeed support Mac PowerPC: https://github.com/racket/racket/blob/cb410f3e9c349588f8c55aa687aa16585f16e8c1/racket/src/bc/sconfig.h#L647-L660 |
On a side note, this is slightly incorrect, it seems: it will hardcode the arch to |
@mattpolzin This makes sense, but I need to verify if it actually works. Turns out, there is no port for |
@mattpolzin @dunhamsteve Looks like Racket does not specify arch anywhere besides the bootstrap file? How is it generated? For chez, I have added ppc to |
Re |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not worry too much about Racket in this PR given the difficulty with even checking that support for Racket on PowerPC is working.
The PR looks good to me. Thanks!
As a side note, I think there's something fishy with our Racket bootstrap code. It does not appear to be the result of the Racket.idr compiler sourcecode (as noted above)... Nothing to be addressed in this PR. I could also be making the wrong assumption about whether the Racket backend uses any of the Chez backend's code (other than the common scheme files which of course are shared).
(and @mattpolzin) I am also scratching my head here... As far as I can tell, based on the bootstrap files going all the way back to But indeed, this is a problem for a different PR. I am also happy with this as-is : ) |
I think I've narrowed it down: we include the Chez Scheme header in the Racket bootstrap file because it's derived from building I'm basing this off that afaict, So maybe Racket handles architecture-specific things at the time of building Racket itself and then it is forever part of that install? |
@mattpolzin @barracuda156 do you think it would make sense to revert the changes to the bootstrap files? These will be overwritten with fresh builds on the next release (whenever that may be), and with the other changes from this PR landing, should automatically include support for ppc (at least for the Chez compiler). |
I think it’s worth making the changes to the bootstrap files here or else we would need to wait for a release to actually support bootstrapping on a PowerPC as is the original goal here. |
Description
Fix building on macOS PowerPC
Should this change go in the CHANGELOG?
implementation, I have updated
CHANGELOG_NEXT.md
(and potentially alsoCONTRIBUTORS.md
).