On Tue, Apr 13, 2021 at 1:27 PM Floh <flo...@gmail.com> wrote:

> Yeah, I never used python literals in EM_CONFIG, misunderstanding on my
> part :)
>
> About the other thing:
>
> > a) Use `which emcc` to find where emscripten is
>
> In my case, emcc is not in the path because this is a local installation
> (via "emsdk activate --embedded") without any traces in the environment
> (I'm setting EM_CONFIG only temporary in the "python environment" before
> evaluating .emscripten as a workaround.
>
>
Is there some reason you don't want to add the emscripten directory to you
PATH?  Is that somehow worse than setting EM_CONFIG and then parsing it?

> b) Have emsdk set `EMSCRIPTEN_ROOT` directly in the environment rather
> than in the config file.
>
> ...this also isn't an option for the same reason as above, there is no
> "global emscripten installation" at all, and there may be multiple
> installations of the emscripten SDK with different versions side by side.
>
>
I'm not sure I understand.  You say you are setting `EM_CONFIG` in your
environment according to your needs, so that there is not one global
`EM_CONFIG`.  Is there some reason you couldn't alternatively set
`EMSCRIPTEN_ROOT`?

I don't see how either of these imply some "global emscripten
installation".  In both cases the current environment determins the
installation to use, no?.   In other words, would it be possible (in your
setup) to point to emscripten directly via `EMSCRIPTEN_ROOT` rather than
pointing at a config file via `EM_CONFIG` (and then parsing the config file
to find EMSCRIPTEN_ROOT)?  (it would then be up to the emcc executable to
find its own config file).



> Cmake takes are of making all paths (compiler tools, header search paths
> etc...) absolute starting at EMSCRIPTEN_ROOT (which cmake doesn't read from
> an environement variable but gets as command line argument, like cmake
> -DEMSCRIPTEN_ROOT=xxx.
>
> However as long as EMSCRIPTEN_ROOT is always is at "/upstream/emscripten"
> under the SDK's installation directory, I think I don't need to "parse"
> .emscripten any longer (IFIR in the past this wasn't true, it was something
> like "/[version]/emscripten", and this was why I had to peek into
> .emscripten in the first place.
>
> Some other alternatives which would work for me:
>
> - turn .emscripten into a plain text file with simple "key = value" lines
> which is generated at SDK installation time (no more python magic)
>
> - ...or add a subcommand to the emsdk tool which prints the emscripten
> root directory to stdout (which I could then call in my cmake wrapper
> scripts)
>

> I basically need a way to get the absolute directory where emcc is located
> if all I know is the absolute directory where the emsdk tool is located.
>

> Cheers!
> -Andre.
>
> On Tuesday, 13 April 2021 at 19:08:28 UTC+2 s...@google.com wrote:
>
>> On Tue, Apr 13, 2021 at 3:46 AM Floh <flo...@gmail.com> wrote:
>>
>>> I guess this was released in 2.0.17 yesterday (according to the release
>>> notes at least)? Happy to report that nothing broke on my side ;)
>>>
>>> (I'm extracting the EMSCRIPTEN_ROOT value for use in a cmake toolchain
>>> file by evaluating the .emscripten config file, and this still seems to
>>> work, I'm still setting an EM_CONFIG environment variable before running
>>> the .emscripten file through python, but I guess this isn't needed anymore
>>> now, but it doesn't hurt either).
>>>
>>
>> Its really a separate issue but I'd love to move folks away from parsing
>> `.emscripten` using non-emscripten tools.   Do you think we can find a way
>> to move you away from doing that?
>>
>> How about:
>>
>> a) Use `which emcc` to find where emscripten is
>> b) Have emsdk set `EMSCRIPTEN_ROOT` directly in the environment rather
>> than in the config file.
>>
>> The reason I don't like (b) much is that we have to deal with the case
>> where somebody runs `path/foo/emcc` on the command line with
>> `EMSCRIPTEN_ROOT=path/bar` in the environment.   We already have this issue
>> with `EMSCRIPTEN_ROOT` in the config file, and I'd love to remove it one
>> day.
>>
>> Regardless, unless I'm misunderstanding this is unrelated to this thread
>> which is about putting python literals in the EM_CONFIG environment.. You
>> aren't relying on that are you?
>>
>>
>>
>>
>>> Cheers!
>>> On Saturday, 10 April 2021 at 17:36:34 UTC+2 s...@google.com wrote:
>>>
>>>> FYI, I'm hoping to remove this feature this week:
>>>> https://github.com/emscripten-core/emscripten/pull/13855
>>>>
>>>> IIUC nobody is relying on it anymore.
>>>>
>>>> On Mon, Jul 20, 2020 at 8:57 AM Sam Clegg <s...@google.com> wrote:
>>>>
>>>>>
>>>>>
>>>>> On Thu, May 21, 2020 at 11:10 AM 'Steven Johnson' via
>>>>> emscripten-discuss <emscripte...@googlegroups.com> wrote:
>>>>>
>>>>>> It will be next week at the earliest -- I am currently elbow-deep in
>>>>>> work on the Halide build/test setup (and, as it turns out, the emcc 
>>>>>> testing
>>>>>> hasn't been enabled for our public repo recently, so it might have broken
>>>>>> for other reasons).
>>>>>>
>>>>>>
>>>>> Hi Steven,
>>>>>
>>>>> I'm hoping to re-land this deprecation this week:
>>>>> https://github.com/emscripten-core/emscripten/pull/11684
>>>>>
>>>>> Have you managed to transition away from using this feature yet?
>>>>>
>>>>> cheers,
>>>>> sam
>>>>>
>>>>>
>>>>> On Thu, May 21, 2020 at 8:59 AM 'Sam Clegg' via emscripten-discuss <
>>>>>> emscripte...@googlegroups.com> wrote:
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Wed, May 20, 2020 at 6:55 PM 'Steven Johnson' via
>>>>>>> emscripten-discuss <emscripte...@googlegroups.com> wrote:
>>>>>>>
>>>>>>>> I did not know that. That sounds like a much better approach anyway
>>>>>>>> :-)
>>>>>>>>
>>>>>>>
>>>>>>> I'll hold off changing any of this until you can make your change
>>>>>>> downstream.  Can you let me know when have converted?
>>>>>>>
>>>>>>> cheers,
>>>>>>> sam
>>>>>>>
>>>>>>>
>>>>>>>> On Wed, May 20, 2020 at 5:21 PM 'Sam Clegg' via emscripten-discuss <
>>>>>>>> emscripte...@googlegroups.com> wrote:
>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Wed, May 20, 2020 at 2:12 PM 'Steven Johnson' via
>>>>>>>>> emscripten-discuss <emscripte...@googlegroups.com> wrote:
>>>>>>>>>
>>>>>>>>>> Halide uses the EM_CONFIG variable in its build script.
>>>>>>>>>>
>>>>>>>>>> The reason for this is that we need to ensure that LLVM_ROOT
>>>>>>>>>> points to the specific version of LLVM being used by the rest of 
>>>>>>>>>> Halide.
>>>>>>>>>> (Having these out of sync can cause amusingly bad things to happen.) 
>>>>>>>>>> We
>>>>>>>>>> slurp in the default ~/.emscripten config file and make an altered 
>>>>>>>>>> version
>>>>>>>>>> (with LLVM_ROOT pointing to the LLVM we are using), so that we can 
>>>>>>>>>> always
>>>>>>>>>> build with the 'correct' version (ie the one that the rest of Halide 
>>>>>>>>>> is
>>>>>>>>>> using).
>>>>>>>>>>
>>>>>>>>>> Requiring that ~/.emscripten be edited is problematic as Halide
>>>>>>>>>> supports multiple versions of LLVM at any one time (currently, v9, 
>>>>>>>>>> v10, and
>>>>>>>>>> v11/trunk), so this file would need to edited in lockstep with other 
>>>>>>>>>> things
>>>>>>>>>> in Halide to keep things in step.
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Thanks for the heads up steven!
>>>>>>>>>
>>>>>>>>> We had another report of someone using it, so I reverted the
>>>>>>>>> warning for now.
>>>>>>>>>
>>>>>>>>> I'm hoping we can move both of you in different direction over
>>>>>>>>> time.   For example, did you know that you can set the LLVM_ROOT 
>>>>>>>>> using the
>>>>>>>>> `EM_LLVM_ROOT` environment variable?  This seems more targeted and 
>>>>>>>>> easier
>>>>>>>>> for you.  Any variable that you can set from the config file can also 
>>>>>>>>> be
>>>>>>>>> set via the environment in the form of `EM_<NAME>`.
>>>>>>>>>
>>>>>>>>> cheers,
>>>>>>>>> sam
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Tue, May 19, 2020 at 11:46 AM 'Sam Clegg' via
>>>>>>>>>> emscripten-discuss <emscripte...@googlegroups.com> wrote:
>>>>>>>>>>
>>>>>>>>>>> emscripten has a feature where you can avoid using a config file
>>>>>>>>>>> completely and instead pass a python literal in the EM_CONFIG
>>>>>>>>>>> environment variable or `--em-config` command line.
>>>>>>>>>>>
>>>>>>>>>>> e.g.  `emcc --em-config="<python code>`
>>>>>>>>>>>
>>>>>>>>>>> As part of routine cleanup I'm hoping to be able to remove this
>>>>>>>>>>> feature and allow the code to depend on the existence of  a
>>>>>>>>>>> config
>>>>>>>>>>> file on disk.
>>>>>>>>>>>
>>>>>>>>>>> I'm not imagining there are any users of this feature, and we can
>>>>>>>>>>> make it into warning a few releases to confirm this.
>>>>>>>>>>>
>>>>>>>>>>> Does anyone know of any users of this feature?
>>>>>>>>>>>
>>>>>>>>>>> cheers,
>>>>>>>>>>> sam
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>> You received this message because you are subscribed to the
>>>>>>>>>>> Google Groups "emscripten-discuss" group.
>>>>>>>>>>> To unsubscribe from this group and stop receiving emails from
>>>>>>>>>>> it, send an email to emscripten-disc...@googlegroups.com.
>>>>>>>>>>> To view this discussion on the web visit
>>>>>>>>>>> https://groups.google.com/d/msgid/emscripten-discuss/CAL_va28seE50BNe4BKJ4cFzoQNNZPE6xbFFwDvXQSdWfiF2WAA%40mail.gmail.com
>>>>>>>>>>> <https://groups.google.com/d/msgid/emscripten-discuss/CAL_va28seE50BNe4BKJ4cFzoQNNZPE6xbFFwDvXQSdWfiF2WAA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>>>>>> .
>>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> You received this message because you are subscribed to the
>>>>>>>>>> Google Groups "emscripten-discuss" group.
>>>>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>>>>> send an email to emscripten-disc...@googlegroups.com.
>>>>>>>>>> To view this discussion on the web visit
>>>>>>>>>> https://groups.google.com/d/msgid/emscripten-discuss/CAM%3DdnveGTKtEqGWue_qyUMjdyLdGXZbXEm8m4fhPjreRgd4tGQ%40mail.gmail.com
>>>>>>>>>> <https://groups.google.com/d/msgid/emscripten-discuss/CAM%3DdnveGTKtEqGWue_qyUMjdyLdGXZbXEm8m4fhPjreRgd4tGQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>>>>> .
>>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> You received this message because you are subscribed to the Google
>>>>>>>>> Groups "emscripten-discuss" group.
>>>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>>>> send an email to emscripten-disc...@googlegroups.com.
>>>>>>>>> To view this discussion on the web visit
>>>>>>>>> https://groups.google.com/d/msgid/emscripten-discuss/CAL_va29xtsd5emac0nfmvUys84xaBdx-xMes515U1sATFPJe1w%40mail.gmail.com
>>>>>>>>> <https://groups.google.com/d/msgid/emscripten-discuss/CAL_va29xtsd5emac0nfmvUys84xaBdx-xMes515U1sATFPJe1w%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>>>> .
>>>>>>>>>
>>>>>>>> --
>>>>>>>> You received this message because you are subscribed to the Google
>>>>>>>> Groups "emscripten-discuss" group.
>>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>>> send an email to emscripten-disc...@googlegroups.com.
>>>>>>>> To view this discussion on the web visit
>>>>>>>> https://groups.google.com/d/msgid/emscripten-discuss/CAM%3Ddnvf79x%3DXt_CLym76VCoTeJBmpu0pw9%2BWWR0CH6ixTcjptg%40mail.gmail.com
>>>>>>>> <https://groups.google.com/d/msgid/emscripten-discuss/CAM%3Ddnvf79x%3DXt_CLym76VCoTeJBmpu0pw9%2BWWR0CH6ixTcjptg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>>> .
>>>>>>>>
>>>>>>> --
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "emscripten-discuss" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>> send an email to emscripten-disc...@googlegroups.com.
>>>>>>> To view this discussion on the web visit
>>>>>>> https://groups.google.com/d/msgid/emscripten-discuss/CAL_va2_CFGdXYRhbB2Vx3Cim8qo0Z1NuErepc-GapsAmDWNBLQ%40mail.gmail.com
>>>>>>> <https://groups.google.com/d/msgid/emscripten-discuss/CAL_va2_CFGdXYRhbB2Vx3Cim8qo0Z1NuErepc-GapsAmDWNBLQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "emscripten-discuss" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>> send an email to emscripten-disc...@googlegroups.com.
>>>>>> To view this discussion on the web visit
>>>>>> https://groups.google.com/d/msgid/emscripten-discuss/CAM%3DdnvcWFdmoiG-1-z2yhPqgEHdSXs5aRHJpc%2BTtQXL26Z0pGA%40mail.gmail.com
>>>>>> <https://groups.google.com/d/msgid/emscripten-discuss/CAM%3DdnvcWFdmoiG-1-z2yhPqgEHdSXs5aRHJpc%2BTtQXL26Z0pGA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "emscripten-discuss" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to emscripten-disc...@googlegroups.com.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/emscripten-discuss/185eae5b-2ee6-462d-8719-1210204d4f5cn%40googlegroups.com
>>> <https://groups.google.com/d/msgid/emscripten-discuss/185eae5b-2ee6-462d-8719-1210204d4f5cn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to emscripten-discuss+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/emscripten-discuss/2653d96f-9437-449b-a0dd-7938d0fdd7e9n%40googlegroups.com
> <https://groups.google.com/d/msgid/emscripten-discuss/2653d96f-9437-449b-a0dd-7938d0fdd7e9n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to emscripten-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/CAL_va2-2316RwcY%2BGp2XJsaZANWsOwedYpGu7s9sYmyPAd8wHA%40mail.gmail.com.

Reply via email to