{
    "componentChunkName": "component---src-templates-note-note-js",
    "path": "/notes/hermeticity",
    "result": {"data":{"mdx":{"body":"var _excluded = [\"components\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n/* @jsxRuntime classic */\n/* @jsx mdx */\n\nvar _frontmatter = {};\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n    props = _objectWithoutProperties(_ref, _excluded);\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"p\", null, \"Hermeticity in programming languages and build systems refers to the concept of creating isolated and reproducible environments for building and running software. Here are the key aspects of hermetic builds and systems:\"), mdx(\"h2\", null, \"Isolation\"), mdx(\"p\", null, \"Hermetic builds aim to isolate the build process from the host system:\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"They use specific versions of build tools and dependencies, rather than relying on what's installed on the local machine\", \"[1]\", \".\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"The build environment is self-contained and doesn't depend on external services or libraries outside the defined build context\", \"[1]\", \".\")), mdx(\"h2\", null, \"Reproducibility\"), mdx(\"p\", null, \"A core principle of hermetic builds is reproducibility:\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Given the same input source code and configuration, a hermetic build system should always produce the same output\", \"[1]\", \".\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"This makes builds more predictable and easier to debug across different environments.\")), mdx(\"h2\", null, \"Benefits\"), mdx(\"p\", null, \"Hermetic builds offer several advantages:\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Speed\"), \": Outputs can be cached, avoiding unnecessary rebuilds\", \"[1]\", \".\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Parallel execution\"), \": The build system can efficiently parallelize tasks based on a well-defined action graph\", \"[1]\", \".\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Multiple builds\"), \": Different builds with varying tool versions can coexist on the same machine\", \"[1]\", \".\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Troubleshooting\"), \": Reproducibility aids in identifying and fixing issues\", \"[1]\", \".\")), mdx(\"h2\", null, \"Implementation\"), mdx(\"p\", null, \"To achieve hermeticity, build systems often employ techniques such as:\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Treating tools as source code, managing their versions within the build environment\", \"[1]\", \".\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Using unique identifiers (like Git hashes) to ensure consistency of inputs\", \"[1]\", \".\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Sandboxing build actions to prevent interference between steps\", \"[1]\", \".\")), mdx(\"h2\", null, \"Challenges\"), mdx(\"p\", null, \"Achieving perfect hermeticity can be difficult:\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Some common sources of non-hermeticity include arbitrary processing in build scripts, non-deterministic file creation, and reliance on system binaries\", \"[1]\", \".\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Developers may need to actively identify and eliminate sources of non-hermetic behavior in their build processes\", \"[1]\", \".\")), mdx(\"h2\", null, \"Tools and Languages\"), mdx(\"p\", null, \"While hermeticity is a concept that can be applied to various programming languages and build systems, some tools are designed with hermeticity in mind:\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\", mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"/notes/Bazel\",\n    \"title\": \"Bazel\"\n  }, \"Bazel\"), \": A build system that emphasizes hermetic and reproducible builds\", \"[1]\", \".\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"\", mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"/notes/Buck\",\n    \"title\": \"Buck\"\n  }, \"Buck\"), \": Another build system focused on hermetic builds, used by companies like Facebook\", \"[4]\", \".\")), mdx(\"p\", null, \"By embracing hermetic principles, developers can create more reliable, reproducible, and maintainable build processes across different environments and team members.\"), mdx(\"p\", null, \"Citations:\\n\", \"[1]\", \" \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://bazel.build/basics/hermeticity\"\n  }, \"https://bazel.build/basics/hermeticity\"), \"\\n\", \"[2]\", \" \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://subscription.packtpub.com/book/programming/9781783982707/3/ch03lvl1sec24/the-hermetic-test-pattern\"\n  }, \"https://subscription.packtpub.com/book/programming/9781783982707/3/ch03lvl1sec24/the-hermetic-test-pattern\"), \"\\n\", \"[3]\", \" \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://www.reddit.com/r/java/comments/14hwust/hermetic_java_self_contained_executable_images/\"\n  }, \"https://www.reddit.com/r/java/comments/14hwust/hermetic_java_self_contained_executable_images/\"), \"\\n\", \"[4]\", \" \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://pepicrft.me/blog/2018/01/28/xcode-rigidity-hermeticism\"\n  }, \"https://pepicrft.me/blog/2018/01/28/xcode-rigidity-hermeticism\"), \"\\n\", \"[5]\", \" \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://en.wikipedia.org/wiki/Hermes_%28programming_language%29\"\n  }, \"https://en.wikipedia.org/wiki/Hermes_%28programming_language%29\"), \"\\n\", \"[6]\", \" \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://digitalambler.com/2012/03/02/hermetically-computeristic-computationally-hermetic/\"\n  }, \"https://digitalambler.com/2012/03/02/hermetically-computeristic-computationally-hermetic/\"), \"\\n\", \"[7]\", \" \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://news.ycombinator.com/item?id=19610869\"\n  }, \"https://news.ycombinator.com/item?id=19610869\")), mdx(\"p\", null, \"\", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"/notes/perplexity-created\",\n    \"title\": \"perplexity-created\"\n  }, \"perplexity-created\"), \"\"));\n}\n;\nMDXContent.isMDXComponent = true;","inboundReferences":[]}},"pageContext":{"slug":"hermeticity","node":{"childMdx":{"slug":"hermeticity"}}}},
    "staticQueryHashes": []}