<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>examples/crate_universe_local_path/README.md - fork/rules_rust @ main</title>
<meta name="description" content="examples/crate_universe_local_path/README.md in fork/rules_rust at main.">
<meta property="og:title" content="examples/crate_universe_local_path/README.md - fork/rules_rust @ main">
<meta property="og:description" content="examples/crate_universe_local_path/README.md in fork/rules_rust at main.">
<meta property="og:type" content="website">
<meta property="og:site_name" content="git.julia.blue">
<link rel="stylesheet" href="/css/style.css?v=62">
<script type="module" src="/js/main.js?v=62"></script>
</head>
<body>
<main data-ref="main" data-tip="c07cb1b5e1bec3184239c28bdddd6c5a0a97d634">
<noscript>
  <div class="callout">
    <p>
      hey! this is a static git repo viewer. commit diffs, file history,
      older commits and other revisions won't load without javascript.
    </p>
    <p>
      you are still able to view source files on branch/tag tips,
      but the experience is degraded.
    </p>
  </div>
</noscript>
<header class="repo"><div>
<h1>fork/rules_rust</h1>
</div>
<pre class="clone">git clone https://git.julia.blue/fork/rules_rust</pre>
</header>
<p class="snapshot-commit"><span class="commit-author">Daniel Wagner-Hall</span><span class="commit-message" data-commit="7edda6f1b314931725e0a17f70287b21579f4a43">External path dependencies work (#3025)</span><span class="snapshot-sha sha" data-commit="7edda6f1b314931725e0a17f70287b21579f4a43">7edda6f1</span><time datetime="2024-12-05T02:54:34+00:00" title="2024-12-05 02:54:34 +0000">2024-12-05</time></p>
<header class="topbar"><details class="switcher"><summary>main</summary><div class="menu"><strong>branches</strong><a href="/fork/rules_rust/ref/cleanup/">cleanup</a><a href="/fork/rules_rust/ref/gh-pages/">gh-pages</a><a class="current" href="/fork/rules_rust/ref/main/">main</a><a href="/fork/rules_rust/ref/patching/">patching</a><a href="/fork/rules_rust/ref/rust-analyzer/">rust-analyzer</a><strong>tags</strong><a href="/fork/rules_rust/ref/0.10.0/">0.10.0</a><a href="/fork/rules_rust/ref/0.11.0/">0.11.0</a><a href="/fork/rules_rust/ref/0.5.0/">0.5.0</a><a href="/fork/rules_rust/ref/0.6.0/">0.6.0</a><a href="/fork/rules_rust/ref/0.7.0/">0.7.0</a><a href="/fork/rules_rust/ref/0.8.0/">0.8.0</a><a href="/fork/rules_rust/ref/0.8.1/">0.8.1</a><a href="/fork/rules_rust/ref/0.9.0/">0.9.0</a><a class="all" href="/fork/rules_rust/refs">all refs →</a></div></details><nav class="crumbs"><a href="/fork/rules_rust/">rules_rust</a> / <a href="/fork/rules_rust/ref/main/tree/examples/">examples</a> / <a href="/fork/rules_rust/ref/main/tree/examples/crate_universe_local_path/">crate_universe_local_path</a> / <span class="cur">README.md</span></nav>
<span class="view-stats"><span>694 B</span><span>11 lines</span></span><span class="actions"><a class="raw" href="/fork/rules_rust/raw/9b83a746a2a0525d39b96e0bcd724b1b706c00ee/examples/crate_universe_local_path/README.md">raw</a></span></header>
<div class="markdown-view"><input type="radio" name="markdown-view" id="markdown-rendered" checked><label for="markdown-rendered">rendered</label><input type="radio" name="markdown-view" id="markdown-code"><label for="markdown-code">code</label><section class="readme rendered"><h1>crate_universe_local_path</h1>
<p>This example does some slightly weird things. It tests that we can patch upstream crates.</p>
<p>The local crate in this dir depends on lazy_static, and assumes it can access a symbol named VENDORED_BY.</p>
<p>VENDORED_BY does not exist in the real lazy_static crate.</p>
<p>We have checked in a copy of lazy_static. On CI, we make a copy of our checked in copy of lazy_static adding the VENDORED_BY symbol, and update our Cargo.toml file to enable the <code>[patch]</code>.</p>
<p>We then run a test which tries to use the VENDORED_BY symbol. If we weren't successfully patching lazy_static, our test would fail to compile. If we successfully use the patch, the test compiles and everything's fine.</p>
</section><div class="code-panel"><pre class="code src language-markdown"><span class="code-line"><a class="ln" id="L1" href="#L1">1</a><span class="code-text"><a-p>#</a-p> <a-tt>crate_universe_local_path</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L2" href="#L2">2</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L3" href="#L3">3</a><span class="code-text">This example does some slightly weird things. It tests that we can patch upstream crates.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L4" href="#L4">4</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L5" href="#L5">5</a><span class="code-text">The local crate in this dir depends on lazy_static, and assumes it can access a symbol named VENDORED_BY.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L6" href="#L6">6</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L7" href="#L7">7</a><span class="code-text">VENDORED_BY does not exist in the real lazy_static crate.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L8" href="#L8">8</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L9" href="#L9">9</a><span class="code-text">We have checked in a copy of lazy_static. On CI, we make a copy of our checked in copy of lazy_static adding the VENDORED_BY symbol, and update our Cargo.toml file to enable the `[patch]`.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L10" href="#L10">10</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L11" href="#L11">11</a><span class="code-text">We then run a test which tries to use the VENDORED_BY symbol. If we weren&#39;t successfully patching lazy_static, our test would fail to compile. If we successfully use the patch, the test compiles and everything&#39;s fine.</span></span></pre></div></div>
</main>
</body>
</html>
