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

os-path causes build conflict with unix_ffi os #795

Open
osresearch opened this issue Feb 2, 2024 · 2 comments
Open

os-path causes build conflict with unix_ffi os #795

osresearch opened this issue Feb 2, 2024 · 2 comments

Comments

@osresearch
Copy link

Building fails for the unix port when adding the glob package to the variant manifest with:

require("glob", unix_ffi=True)

glob's manifest requires os-path, without unix_ffi, and that in turns requires os also without unix_ffi:

require("os", unix_ffi=True)
require("os-path")

os-path's manifest requires os:

require("os")
package("os")

This causes a conflict with the os that has already been required with unix_ffi:

build-standard/frozen_content.c:20526:27: error: redefinition of ‘const_qstr_table_data_os___init__’
20526 | static const qstr_short_t const_qstr_table_data_os___init__[158] = {
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
build-standard/frozen_content.c:17919:27: note: previous definition of ‘const_qstr_table_data_os___init__’ was here
17919 | static const qstr_short_t const_qstr_table_data_os___init__[158] = {
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
....

If I add unix_ffi=True to lib/micropython-lib/python-stdlib/os-path/manifest.py, then it is able to compile the frozen content.

@dpgeorge
Copy link
Member

dpgeorge commented Feb 7, 2024

If I add unix_ffi=True to lib/micropython-lib/python-stdlib/os-path/manifest.py, then it is able to compile the frozen content.

I don't think that's the correct solution because it will most likely break targets (eg bare-metal ports) that can't use the unix-ffi code.

One solution would be to make it ignore subsequent packages if one is already require'd by the same name. So in this case the unix_ffi os will take precedence because it's require'd first.

@dpgeorge
Copy link
Member

dpgeorge commented Feb 8, 2024

Should be fixed by micropython/micropython#13620

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