buildenvsetup

6 views
Skip to first unread message

robert lytton

unread,
Mar 31, 2023, 5:58:10 AM3/31/23
to Compiler Explorer Development
Hi,
I am running CE with a range of compiler versions, each with its own set_var.sh to set up the environment around it - which I am not currently calling.
So I was wondering if I could call the appropriate script (for the chosen compiler) prior to doing the compilation.
Looking at the codebase, it seems buildenvsetup() is where it should happen.
I also notice that the c++.amazon.properties sets a property (a class to use?).

Would anyone be able to explain the mechanism to me - please?
Can I set this per compiler.xyz.buildenvsetup   ?
Am I expecting too much from the codebase viz a lot of work needed on my part?!

Thank you.
Bob

Matt Godbolt

unread,
Mar 31, 2023, 10:27:30 AM3/31/23
to compiler-explo...@googlegroups.com
Hi Bob,

The buildenvsetup is only used when linking, so might not be the right fit. We don't really have a good spot for setting environment variables directly.  We do support a "compiler-wrapper" which might work in your case, setting the wrapper to the compiler's set_var.sh. That said I can't see that we're using the compiler-wrapper in any code...but it would be worth a go. Something like:

compiler.mycompiler.exe=/path/to/exe
compiler.mycompiler.compiler-wrapper=/path/to/set_var.sh

the set_var might have to be changed to then run whatever args are passed to it...or maybe you'll need to write your own wrapper that calls set_var and then `exec "$*"` (or the bash magic to invoke onwards).

Hope that gives some clue: but in general launching a shell script to set env vars before running the compiler is not directly supported yet.

Cheers, Matt

--
You received this message because you are subscribed to the Google Groups "Compiler Explorer Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to compiler-explorer-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/compiler-explorer-development/dfb05b66-57c1-482f-9df4-2782a17cf09en%40googlegroups.com.


--
Matt
(he/him)
Reply all
Reply to author
Forward
Message has been deleted
0 new messages