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

Remove creation of temporary files #5

Open
GalaxyShard opened this issue Dec 27, 2024 · 1 comment
Open

Remove creation of temporary files #5

GalaxyShard opened this issue Dec 27, 2024 · 1 comment

Comments

@GalaxyShard
Copy link
Contributor

It appears mmutil is using files to pass arguments between functions globally. Currently these files (named sampJ328G54AU3.tmp and songDJ34957FAI.tmp) are created in the working directory, and as a result this causes issues when running mmutil in parallel within the same directory; mmutil attempts to access the file created by other instances of mmutil, causing odd audio bugs in the output.

I currently have a patch that allows overriding the path of the temporary file (so that it can be placed in the proper temporary directory like /tmp on linux) (GalaxyShard@5961920), although it appears that removing the creation of the files altogether might be a bit more involved.

@AntonioND
Copy link
Member

Overriding the path looks like a very fragile fix. If a build system wants to run multiple instances of mmutil at the same time, the build system needs to pass the name, which is a bad idea.

Wouldn't it be better to open a file mapped in RAM? We could use fmemopen() https://pubs.opengroup.org/onlinepubs/9799919799/functions/fmemopen.html or similar so that we don't have to modify the code that much.

But yeah, because of this issue I had to add a workaround to my build system: https://github.com/AntonioND/architectds/blob/7aa01b1f1366b674bc8cae32443909fefa862f02/architectds/architectds.py#L1978-L1986

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