prefix-dev / rattler-build

rattler-build is a universal package builder for Windows, macOS and Linux
https://prefix-dev.github.io/rattler-build
BSD 3-Clause "New" or "Revised" License
185 stars 38 forks source link

How do I tell rattler-build to use a different location for scratch? #956

Closed sg-s closed 2 months ago

sg-s commented 2 months ago

first of all, let me say i love rattler-build! it's everything i've been looking for.

I'm trying to run rattler-build in a AWS lambda function. That is a fairly restricted environment, and only /tmp is writeable.

so, when i try to do rattler-build build in the /tmp folder, i get this error:


  │ cache
  ├─▶ failed to acquire a lock on the repodata cache
  ├─▶ failed to open: /root/.cache/rattler/cache/repodata/3018e552.lock
  ╰─▶ Read-only file system (os error 30)

looks like rattler is trying to write to files outside of /tmp. how can i force it to stay in /tmp?

thanks! any help appreciated.

wolfv commented 2 months ago

Hi @sg-s - thanks for your kind words!

We use the default location of the rattler-cache, which is set to the location of XDG cache dir (using this function: https://docs.rs/dirs/latest/dirs/fn.cache_dir.html)

So the only option currently would be to change that.

Or can you mount a drive, and create a user account that has their home folder on that drive?

sg-s commented 2 months ago

hmmm, interesting, thank you!

i tried:

os.environ["XDG_CACHE_HOME"] = "/tmp/.cache/"

and i'm getting a different error, so that's progress! closing this as this answers my question

wolfv commented 2 months ago

Awesome! I am curious what you're building with rattler-build on AWS Lambda if you're free to share. Exciting anyways :) Let us know if you find any bugs etc.

sg-s commented 2 months ago

we're trying to build conda packages for some of the tools we created and for other packages that don't have conda packages yet. i wanted to build a lambda so that we can have a service that essentially converts a recipe into a conda package, and pushes it to some channel.