Setting environment variables in sailfishos-chum

Hey, how does one add environment variables (secrets) in open build service? My app needs api key (as most apps do I think :smiley: ) but I did not find any instructions here nor online on how to add one for sailfishos-chum builds. My app currently uses .env file for this, I parse it in .pro and pass it down as defines into the app. Now I thought I could use $$getenv()for this but not sure anymore :man_shrugging: Thanks in advance and sorry if this was a stupid question :sweat_smile:

1 Like

The short answer is that something like this is not possible currently on OBS.

See here for a longer discussion:


You can define custom rpm macros in your private OBS project in prjconf but that is

  1. publicly visible
  2. not feasible to do in Chum/Chum testing.

Thanks! I guess we’ll have to wait and see what happens :slight_smile:

What I’ve seen people do (in another context, not SFOS), is to compile in such keys in a .o or .so file off-line, commit that to the source repo, and then link it in in the build process.
Not ideal, but a bit better than cleartext keys in the source.

1 Like