Add activated_cfg for ccache - #1345
Conversation
| "bitness": 64, | ||
| "url": "https://github.com/juj/ccache.git", | ||
| "git_branch": "emscripten", | ||
| "activated_cfg": "CCACHE=%installation_dir%/bin", |
There was a problem hiding this comment.
CCACHE is not a recognized setting the emscripten config file as far as I can tell.
The valid config settings are listed here: https://github.com/emscripten-core/emscripten/blob/7cdfa8d9f22562e7c08789a5ae29ad9a1025a8e4/tools/config.py#L122-L140 (not the CACHE is unrelated to ccache).
There was a problem hiding this comment.
Ah, should I add a CCACHE setting there then? FWIW, when I made this change locally, it worked fine without adding it to the config.py list.
| "url": "https://github.com/juj/ccache.git", | ||
| "git_branch": "emscripten", | ||
| "activated_cfg": "CCACHE=%installation_dir%/bin", | ||
| "activated_path": "%installation_dir%/bin", |
There was a problem hiding this comment.
This line should add ccache to your PATH. You would need to be sure to include it in your emsdk activate command line though I think.
There was a problem hiding this comment.
Without activated_cfg, this clause causes ccache to not be added to the path:
Lines 1733 to 1735 in c18280c
There was a problem hiding this comment.
activated_cfg doesn't have anything to do with the PATH. activated_cfg is used to add things to the emscripten config file. As far as I know ccache has not place in the emscripten config file.
The things that adds to your PATH is activated_path.
There was a problem hiding this comment.
Okay, then it would seem we need to change L1733-L1735 here, as this results in any tool without an activated_cfg and no deps being excluded. ccache is the only tool without an activated_cfg as far as I can tell.
There was a problem hiding this comment.
I think if we change L1735 to return True then this will result in ccache always being active if it's installed? I'm not super familiar with how emsdk works—where is the list of currently activated tools stored?
There was a problem hiding this comment.
Yes, it looks like we can completely remove those lines I think.
I'm not sure why would declare a tool inactive simply because it has no dependencies.
Store active tools and SDKs in a dedicated `activated.json` file when they are activated by `emsdk activate`. Update `Tool.is_active()` to check against `activated.json` rather than matching entries in `.emscripten`. This solves several issues with the previous `.emscripten`-based `is_active()` logic: 1. Tools with no `activated_cfg` (such as `ccache` or tools that only modify `PATH` or environment variables) previously returned `is_active() == False` because they had no `.emscripten` keys and no dependencies (`len(deps) == 0`). 2. Tools with dependencies but no `activated_cfg` previously falsely reported `is_active() == True` whenever their dependencies were active, even if the tool itself was never activated. 3. Ambiguity between SDK meta-packages and individual tools is eliminated by providing a single unified tracking mechanism in `activated.json`. See: #1345
Store active tools and SDKs in a dedicated `activated.json` file when they are activated by `emsdk activate`. Update `Tool.is_active()` to check against `activated.json` rather than matching entries in `.emscripten`. This solves several issues with the previous `.emscripten`-based `is_active()` logic: 1. Tools with no `activated_cfg` (such as `ccache` or tools that only modify `PATH` or environment variables) previously returned `is_active() == False` because they had no `.emscripten` keys and no dependencies (`len(deps) == 0`). 2. Tools with dependencies but no `activated_cfg` previously falsely reported `is_active() == True` whenever their dependencies were active, even if the tool itself was never activated. 3. Ambiguity between SDK meta-packages and individual tools is eliminated by providing a single unified tracking mechanism in `activated.json`. See: #1345
Store active tools and SDKs in a dedicated `activated.json` file when they are activated by `emsdk activate`. Update `Tool.is_active()` to check against `activated.json` rather than matching entries in `.emscripten`. This solves several issues with the previous `.emscripten`-based `is_active()` logic: 1. Tools with no `activated_cfg` (such as `ccache` or tools that only modify `PATH` or environment variables) previously returned `is_active() == False` because they had no `.emscripten` keys and no dependencies (`len(deps) == 0`). 2. Tools with dependencies but no `activated_cfg` previously falsely reported `is_active() == True` whenever their dependencies were active, even if the tool itself was never activated. 3. Ambiguity between SDK meta-packages and individual tools is eliminated by providing a single unified tracking mechanism in `activated.json`. See: #1345
Store active tools and SDKs in a dedicated `activated.json` file when they are activated by `emsdk activate`. Update `Tool.is_active()` to check against `activated.json` rather than matching entries in `.emscripten`. This solves several issues with the previous `.emscripten`-based `is_active()` logic: 1. Tools with no `activated_cfg` (such as `ccache` or tools that only modify `PATH` or environment variables) previously returned `is_active() == False` because they had no `.emscripten` keys and no dependencies (`len(deps) == 0`). 2. Tools with dependencies but no `activated_cfg` previously falsely reported `is_active() == True` whenever their dependencies were active, even if the tool itself was never activated. 3. Ambiguity between SDK meta-packages and individual tools is eliminated by providing a single unified tracking mechanism in `activated.json`. See: #1345
Store active tools and SDKs in a dedicated `activated.json` file when they are activated by `emsdk activate`. Update `Tool.is_active()` to check against `activated.json` rather than matching entries in `.emscripten`. This solves several issues with the previous `.emscripten`-based `is_active()` logic: 1. Tools with no `activated_cfg` (such as `ccache` or tools that only modify `PATH` or environment variables) previously returned `is_active() == False` because they had no `.emscripten` keys and no dependencies (`len(deps) == 0`). 2. Tools with dependencies but no `activated_cfg` previously falsely reported `is_active() == True` whenever their dependencies were active, even if the tool itself was never activated. Replaces: #1345
Store active tools and SDKs in a dedicated `activated.json` file when they are activated by `emsdk activate`. Update `Tool.is_active()` to check against `activated.json` rather than matching entries in `.emscripten`. This solves several issues with the previous `.emscripten`-based `is_active()` logic: 1. Tools with no `activated_cfg` (such as `ccache` or tools that only modify `PATH` or environment variables) previously returned `is_active() == False` because they had no `.emscripten` keys and no dependencies (`len(deps) == 0`). 2. Tools with dependencies but no `activated_cfg` previously falsely reported `is_active() == True` whenever their dependencies were active, even if the tool itself was never activated. Replaces: #1345
|
My hope is that #1766 will remove the need for this |
Store active tools and SDKs in a dedicated `activated.json` file when they are activated by `emsdk activate`. Update `Tool.is_active()` to check against `activated.json` rather than matching entries in `.emscripten`. This solves several issues with the previous `.emscripten`-based `is_active()` logic: 1. Tools with no `activated_cfg` (such as `ccache` or tools that only modify `PATH` or environment variables) previously returned `is_active() == False` because they had no `.emscripten` keys and no dependencies (`len(deps) == 0`). 2. Tools with dependencies but no `activated_cfg` previously falsely reported `is_active() == True` whenever their dependencies were active, even if the tool itself was never activated. Replaces: #1345
|
Closing in favor of #1766 |
Store active tools and SDKs in a dedicated `activated.json` file when they are activated by `emsdk activate`. Update `Tool.is_active()` to check against `activated.json` rather than matching entries in `.emscripten`. This solves several issues with the previous `.emscripten`-based `is_active()` logic: 1. Tools with no `activated_cfg` (such as `ccache` or tools that only modify `PATH` or environment variables) previously returned `is_active() == False` because they had no `.emscripten` keys and no dependencies (`len(deps) == 0`). 2. Tools with dependencies but no `activated_cfg` previously falsely reported `is_active() == True` whenever their dependencies were active, even if the tool itself was never activated. Replaces: #1345
With this missing, ccache was never being added to PATH, and _EMCC_CCACHE wasn't being set.