0

I've created a docker container (ubuntu:focal) with a C++ application that is using boost::filesystem (v1.76.0) to create some directories while processing data. It works if I run the container locally, but it fails when deployed to Cloud Run.

A simple statement like

boost::filesystem::exists(boost::filesystem::current_path())

fails with "Invalid argument '/current/path/here'". It doesn't work in this C++ application, but from a Python app running equivalent statements, it does work.

Reading the docs I can see Cloud Run is using gVisor and not all the system calls are fully supported (link: https://gvisor.dev/docs/user_guide/compatibility/linux/amd64/), nevertheless I would expect simple calls to work: check if a directory exists, create a directory, remove,...

Maybe I'm doing something wrong when deploying my container. Is there any way to work around it? Any boost configuration I can use to prevent it from using some syscalls?

Thanks for your help!

jgsogo
  • 706
  • 1
  • 9
  • 18
  • Tried with `std::filesystem` (C++17), it works. Probably I'll change the codebase, but still if someone can contribute a work around it could be useful for future reference. – jgsogo May 28 '21 at 07:11
  • I think you need to report to the boost devs. With a reproducing case. In this case likely platform and permissions are essential to understanding the cause. I think this has been the second time in abiut a month that I see a similar issue. I don't think we're need a workaround, i think we need a library QoI fix (or gVisor does, if they notice the problem for their customers) – sehe May 28 '21 at 08:22

0 Answers0