Skip to content

Do not create temp directories and files at runtime #24

@probonopd

Description

@probonopd

Currently mktemp is being used.
Let's try to avoid creating temp directories and files at runtime if possible.

  • I think it would be more in line with the spirit of AppDir as read-only single-file bundles that don't need to be extracted in order to run the application.
  • It should also speed up execution, if only a tiny bit
  • It should be less fragile (e.g., run on non-GNU systems), addressing step 1 of Use /bin/sh and make mktemp use compatible with non-GNU #22
  • It should be easier and more robust to clean up after the application has exited

In go-appimage, we are doing without a temp file for loaders.cache:

  export GDK_PIXBUF_MODULE_FILE=$(find "$HERE" -name loaders.cache -type f -path '*gdk-pixbuf*') # Patched to contain no paths

https://github.com/probonopd/go-appimage/blob/36cf7d1b81a2407aed8e89e03f8a68fb10d4659b/src/appimagetool/appdirtool.go#L114

As you can see, we are using a pre-made loaders.cache file that is contained inside the AppImage.

Can you see any downsides to this approach?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions