Skip to content

adjust sys.platform for various C linkers#3564

Closed
pmp-p wants to merge 3 commits intomicropython:masterfrom
pmp-p:patch-1
Closed

adjust sys.platform for various C linkers#3564
pmp-p wants to merge 3 commits intomicropython:masterfrom
pmp-p:patch-1

Conversation

@pmp-p
Copy link
Copy Markdown
Contributor

@pmp-p pmp-p commented Jan 14, 2018

android ffi modules require identification of platform as they use a different model.

ffilib.py would load unversionned lib*.so because android are not versionned like linux assumed default.

wasm platform use .wasm files for dlopen()

sys.platform would give 'android' and at REPL: MicroPython v1.9.3-240-ga275cb0-dirty on 2018-01-14; android version

sys.platform would give 'wasm' and at REPL: MicroPython v1.9.3-240-ga275cb0-dirty on 2018-01-14; wasm version

use case: https://github.com/pmp-p/micropython-ffigen

android => android

emscripten ( that's just the compiler) => wasm ( is the standard )

android ffi modules require identification of platform as they use a different model. ffilib would load unversionned lib*.so
sys.platform would give 'android' and at REPL:  MicroPython v1.9.3-240-ga275cb0-dirty on 2018-01-14; android version
@pmp-p
Copy link
Copy Markdown
Contributor Author

pmp-p commented Jan 23, 2018

cpython may follow that too, as proposed here in case of true android support https://mail.python.org/pipermail/python-dev/2018-January/151874.html

https://bugs.python.org/issue32637
edit/ was closed so free to chose "bionic" identifier instead of a unfriendly trademark.
edit/ let's keep "android "

edit/ wasm has been defined for good, so just use that.

@pmp-p pmp-p changed the title adjust sys.platform for android builds adjust sys.platform for AOSP builds Jan 10, 2019
@pfalcon
Copy link
Copy Markdown
Contributor

pfalcon commented Jan 10, 2019

The latest change is unlikely for good. There's no trademark for word android. The fact that there's somebody's trademark sounding similarly is purely a coincidence.

@pmp-p
Copy link
Copy Markdown
Contributor Author

pmp-p commented Jan 10, 2019

i don't know, some1 i spoke with had his site closed for just using that word in his application name ( a javascript coding IDE ), could be a store specific store rule i did not dig further.
maybe Mac OS X refers to darwin as android refers to aosp

Also for a pet project on allwinner soc i have with micropython+bionic libc instead of java+bionic libc i'd like to break free of that word for good.

even if "blobbed_platorm_pick_a_number" would be probably as good as any of the others i'm open to suggestions :)

@pfalcon
Copy link
Copy Markdown
Contributor

pfalcon commented Jan 12, 2019

i'm open to suggestions

IMHO, "android" is the obvious choice. When (if) some entity will have issues with that, ideas for something else can be considered.

@pmp-p pmp-p changed the title adjust sys.platform for AOSP builds adjust sys.platform for various C linker Jan 12, 2019
@pmp-p pmp-p changed the title adjust sys.platform for various C linker adjust sys.platform for various C linkers Jan 12, 2019
@pmp-p
Copy link
Copy Markdown
Contributor Author

pmp-p commented Jan 12, 2019

Thanks for helping deciding ! i intend to keep some android/wasm/midipix ports up to date they define __ANDROID__ __EMCRIPTEN__ and __midipix__

@dpgeorge
Copy link
Copy Markdown
Member

Closing because CPython still uses sys.platform=="linux" on Android, so we currently match CPython there.

Feel free to reopen if there's still a need for this, with details on why it's needed.

@dpgeorge dpgeorge closed this May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants