Skip to content

Handle '~' in find_mpy_root function#47

Open
Josverl wants to merge 1 commit intomattytrentini:mainfrom
Josverl:fix_userdir
Open

Handle '~' in find_mpy_root function#47
Josverl wants to merge 1 commit intomattytrentini:mainfrom
Josverl:fix_userdir

Conversation

@Josverl
Copy link
Copy Markdown
Contributor

@Josverl Josverl commented Nov 12, 2024

Add support for folder configuration such as MICROPY_DIR=~/micropython.

@mattytrentini
Copy link
Copy Markdown
Owner

Which operating system is this failing on? I'm using Ubuntu 24.04.2 LTS and these both work without this PR (and with too, so the PR seems good!):

>MICROPY_DIR=/home/matt/code/micropython mpbuild list renesas-ra
>MICROPY_DIR=~/code/micropython mpbuild list renesas-ra

It would be just nicer if I could see a failing example, update with this PR and see it fixed. 😃

@Josverl
Copy link
Copy Markdown
Contributor Author

Josverl commented Mar 20, 2025

Issue was on Windows 11, + Docker Desktop, running in WSL2
Python version in WSL2 : Python 3.11.10
Description: Ubuntu 22.04.5 LTS

Docker needs an absolute path, and without the addition that is not guaranteed by Python.
that is what expanduser does.

Possibly if you have docker or podman installed in linux ( rather than on ubuntus superviser) , then it will handle the ~ when it receives a path.

Should be simple to repro

image

well - Today I learned that dropping the "" also helps.
export MICROPY_DIR=~/micropython
image

ITIR that linux shells have a tendency to pre-resolve wildcards in file like strings - that has gotten in my way before and "" were the way to stop that from happening.

I think this still has value though, there are bound to be others like me with windows trained muscle memory for using baz="bar" when setting environment variables

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.

3 participants