Wouks
Wouks
MModular
Created by Wouks on 10/26/2024 in #questions
Error when running Mojo when path contains # (hash)
Since the introduction of Magic I have noticed that previous mojo scripts would give me an error when running "magic run mojo hello.mojo". Even using "magic shell" and then "mojo hello.mojo" does not solve the problem. The files are contained in a path where one of the folders starts with a #. When running mojo I get the following error: /home/user/Documents/#MojoProjects/hello-world/.magic/envs/default/bin/mojo: error: cannot map file that is not an actual file or block device When I rename the folder from #MojoProjects to MojoProjects I get the option to reinstall the environment:
? The environment directory seems have to moved! Environments are non-relocatable, moving them can cause issues.

/home/user/Documents/#MojoProjects/hello-world/.magic/envs/default -> /home/user/Documents/MojoProjects/hello-world/.magic/envs/default

This can be fixed by reinstall the environment from the lock-file in the new location.
? The environment directory seems have to moved! Environments are non-relocatable, moving them can cause issues.

/home/user/Documents/#MojoProjects/hello-world/.magic/envs/default -> /home/user/Documents/MojoProjects/hello-world/.magic/envs/default

This can be fixed by reinstall the environment from the lock-file in the new location.
After making this change to not have a # in the path the program runs without a problem. Magic version: 0.4.0 I am wondering if anyone else ran into this issue.
13 replies