{"id":16160895,"url":"https://github.com/spoutn1k/unspacked-rs","last_synced_at":"2026-04-28T10:37:14.755Z","repository":{"id":41242894,"uuid":"489421376","full_name":"spoutn1k/unspacked-rs","owner":"spoutn1k","description":"Accelerate spack calls by translating them to environment manipulation","archived":false,"fork":false,"pushed_at":"2022-09-28T23:44:11.000Z","size":40,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-17T15:31:18.566Z","etag":null,"topics":["shell","spack"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spoutn1k.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-06T16:22:55.000Z","updated_at":"2022-09-17T16:04:05.000Z","dependencies_parsed_at":"2022-08-31T10:23:23.300Z","dependency_job_id":null,"html_url":"https://github.com/spoutn1k/unspacked-rs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/spoutn1k/unspacked-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spoutn1k%2Funspacked-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spoutn1k%2Funspacked-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spoutn1k%2Funspacked-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spoutn1k%2Funspacked-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spoutn1k","download_url":"https://codeload.github.com/spoutn1k/unspacked-rs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spoutn1k%2Funspacked-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32377593,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T09:24:15.638Z","status":"ssl_error","status_checked_at":"2026-04-28T09:24:15.071Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["shell","spack"],"created_at":"2024-10-10T02:06:15.210Z","updated_at":"2026-04-28T10:37:14.731Z","avatar_url":"https://github.com/spoutn1k.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `unspacked-rs`\n\n## What ?\n\nThis tool is meant to accelerate execution of `spack`-ed scripts by replacing `spack` calls by their equivalent in environment manipulation.\n\n## Why ?\n\nBecause `spack` is *slow*. For instance the following:\n```sh\n. /spack/share/spack/setup-env.sh\n\necho \"Loading packages ...\"\nspack load --first trilinos\nspack load --first jsoncpp\necho \"Done !\"\n\nspack load --list\n```\nTakes more than 10s to run while the `unspacked` equivalent:\n```sh\nload_9eed1b0e789b80782838c7f85171514ff2070e49f9db023fe402d0bb63c3bfe7() {\n# Compiled version of 'spack load --sh --first trilinos'\nexport ACLOCAL_PATH=/spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-9.3.0/libx...\nexport BOOST_ROOT=/spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-9.3.0/boost-...\nexport CMAKE_PREFIX_PATH=/spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-9.3.0...\nexport LD_LIBRARY_PATH=/spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-9.3.0/t...\nexport MANPATH=/spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-9.3.0/mpich-3.4...\nexport PATH=/spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-9.3.0/trilinos-13....\nexport PKG_CONFIG_PATH=/spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-9.3.0/s...\nexport SPACK_LOADED_HASHES=an5qvws33abtt6ggtrdqyn2za5qm7uro:u4caraxm24o23syf...\n}\n\nload_dc9bc243e421ca740f39ba3dd705f5298f1c20490a0ec9bb59e406b81d1f7181() {\n# Compiled version of 'spack load --sh --first jsoncpp'\nexport CMAKE_PREFIX_PATH=/spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-9.3.0...\nexport LD_LIBRARY_PATH=/spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-9.3.0/j...\nexport PKG_CONFIG_PATH=/spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-9.3.0/j...\nexport SPACK_LOADED_HASHES=rftwq6kvnmmpt73kkbgzkfknct35laj5:an5qvws33abtt6gg...\n}\n\necho \"Loading packages ...\"\nload_9eed1b0e789b80782838c7f85171514ff2070e49f9db023fe402d0bb63c3bfe7\nload_dc9bc243e421ca740f39ba3dd705f5298f1c20490a0ec9bb59e406b81d1f7181\necho \"Done !\"\n```\nTakes less than a hundredth of one, on the same machine.\n\n```\n$ time source ~/spacked.sh \nLoading packages ...\nDone !\n==\u003e 17 loaded packages\n[...]\n\nreal\t0m11.907s\nuser\t0m11.372s\nsys\t0m0.452s\n$ spack unload\n$ time source ~/unspacked.sh \nLoading packages ...\nDone !\n\nreal\t0m0.007s\nuser\t0m0.007s\nsys\t0m0.000s\n$ spack load --list\n==\u003e 17 loaded packages\n[...]\n```\n\nOn a single system where you load spack once this is just a few seconds, but when working with spack in temporary environments, having to repeat the load calls leads to a lot of wasted time.\n\n## How ?\n\nThis crate makes use of the `conch_parser` crate to interpret `shell` scripts, extract `spack` references, then use the `spack load [--sh|--csh|--fish]` capabilities to translate calls. The output is an self-modifying script that can then be run in the `spack` environment, to create the final, `unspacked` version of the original script.\n\n```\n$ unspack spacked.sh \u003e unspacked.sh\n$ bash unspacked.sh\n```\n\nThe generated script can also be sourced, and will make the requested changes to the spack environment in addition to modifying itself.\n\n# Disclaimer\n\n- This will only work for `spack load` calls, and targets initialization scripts with little `spack` logic involved.\n- The resulting scripts are also extremely single minded. They will overwrite whatever spack environment you have with what they were designed to do.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspoutn1k%2Funspacked-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspoutn1k%2Funspacked-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspoutn1k%2Funspacked-rs/lists"}