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

How to generate scripts for a currently unsupported platform with niminst? #24414

Open
barracuda156 opened this issue Nov 7, 2024 · 3 comments

Comments

@barracuda156
Copy link

Summary

Could someone explain (or refer to a documentation) how exactly to use niminst to generate build scripts for a currently unsupported platform? I need that for csources to begin with, and then for Nim.

Description

The context: I have a PR for initial support of Darwin PowerPC (it is WIP, cannot be merged yet): nim-lang/csources_v1#7
I did some manual patching back then, but it is not the right way to go. I was able to compile niminst from source on a arm64 Mac, but cannot figure out what to do to generate w/e needed for PowerPC.

Alternatives

No response

Examples

No response

Backwards Compatibility

No response

Links

No response

@Araq
Copy link
Member

Araq commented Nov 7, 2024

Assuming the setup is already covered by compiler/platform.nim (check!), you need to edit compiler/installer.ini and then run niminst. Then inside csources_v2 run push_c_code.nim that assumes your nim that was used for niminst is in ../nim2! But you can also edit this push_c_code.nim program or do what it does manually.

@Araq
Copy link
Member

Araq commented Nov 7, 2024

Note that macosx: i386;amd64;powerpc64;arm64 is already listed in installer.ini. I think you want macosx: i386;amd64;powerpc64;powerpc;arm64 instead.

@barracuda156
Copy link
Author

@Araq Thank you for responding!

Note that macosx: i386;amd64;powerpc64;arm64 is already listed in installer.ini. I think you want macosx: i386;amd64;powerpc64;powerpc;arm64 instead.

Yes, that I have done. We also need an alternative way to decide on the build arch for powerpc, since a) uname -m returns Power Macintosh and not the arch name, and b) even using correct uname -p does not really help, since it cannot differentiate between ppc and ppc64 (either can be built at least on 10.5.8 on G5 machine).
I might have amended the script in a way build arch gonna be respected, but need to sort out generating scripts from templates first.

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

No branches or pull requests

2 participants