<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
      <title>Cogs &amp; Squigs</title>
      <link>https://cogsandsquigs.dev</link>
      <description>My little slice of the blogosphere</description>
      <generator>Zola</generator>
      <language>en</language>
      <atom:link href="https://cogsandsquigs.dev/rss.xml" rel="self" type="application/rss+xml"/>
      <lastBuildDate>Fri, 24 Jan 2025 00:00:00 +0000</lastBuildDate>
      <item>
          <title>Internet Standards and Fascism</title>
          <pubDate>Fri, 24 Jan 2025 00:00:00 +0000</pubDate>
          <author>Ian Pratt &lt;ianjdpratt@gmail.com&gt;</author>
          <link>https://cogsandsquigs.dev/blog/internet-standards-and-fascism/</link>
          <guid>https://cogsandsquigs.dev/blog/internet-standards-and-fascism/</guid>
          <description xml:base="https://cogsandsquigs.dev/blog/internet-standards-and-fascism/">&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.iana.org&#x2F;&quot;&gt;IANA&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.icann.org&#x2F;en&#x2F;beginners&quot;&gt;ICANN&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;home.unicode.org&#x2F;&quot;&gt;The Unicode Consortium&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.w3.org&quot;&gt;W3C&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.ietf.org&#x2F;&quot;&gt;IETF&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;openjsf.org&#x2F;&quot;&gt;OpenJS Foundation&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;What do all of these things have in common? Well, they’re all crucial, important pieces of how we
communicate today — without them, we wouldn’t even be able to text, email, or even just go online.
They set the standards, organizations, and utilities we use to make sure that, for example:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;I can create this website using web standards (W3C, IETF, OpenJS Foundation)&lt;&#x2F;li&gt;
&lt;li&gt;This website can be published under the name &lt;code&gt;cogsandsquigs.dev&lt;&#x2F;code&gt; (IANA, ICANN)&lt;&#x2F;li&gt;
&lt;li&gt;Your computer knows how to get from &lt;code&gt;cogsandsquigs.dev&lt;&#x2F;code&gt; to it’s IP address (IANA, ICANN, IETF)&lt;&#x2F;li&gt;
&lt;li&gt;Your computer can route it’s packets from itself to &lt;code&gt;cogsandsquigs.dev&lt;&#x2F;code&gt;’s IP (IETF)&lt;&#x2F;li&gt;
&lt;li&gt;Your computer can decode the packets it receives from &lt;code&gt;cogsandsquig.dev&lt;&#x2F;code&gt; (IETF)&lt;&#x2F;li&gt;
&lt;li&gt;Your browser can understand the decoded files — HTML, CSS, JS (W3C, Unicode)&lt;&#x2F;li&gt;
&lt;li&gt;Your browser can display the decoded files (W3C, Unicode)&lt;&#x2F;li&gt;
&lt;li&gt;Your browser (and consequently, computer) understand &lt;em&gt;when&lt;&#x2F;em&gt; I published this page (IANA,
specifically &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.iana.org&#x2F;time-zones&quot;&gt;TZDB&lt;&#x2F;a&gt;)&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Any one of these things going offline would result in massive catastrophe across the internet, and
subsequently would probably lead to the shuttering of many necessary and important services we use
day-to-day (think: email communication, texting, digital maps, etc.).&lt;&#x2F;p&gt;
&lt;p&gt;And yet, here they are. In the US of A. Which is currently suffering under a fascist regime (and if
you don’t think that, I just hope you read a history book one day).&lt;&#x2F;p&gt;
&lt;p&gt;If Trump (or, let’s be honest, Musk) decides to target any one of these organizations, we’re
basically done for. No more communication &lt;em&gt;globally&lt;&#x2F;em&gt;, at all. Zip. Zilch. Nada. It’s not gonna be
another Great Firewall (a la China). Instead, &lt;em&gt;all of the internet will be at stake&lt;&#x2F;em&gt;. People in
unrelated countries, with unrelated politics and unrelated gripes will suffer. We all will.&lt;&#x2F;p&gt;
&lt;p&gt;I pray that hopefully, this doesn’t happen. Hopefully, I’m wrong. Hopefully, we can trust these
organizations.&lt;&#x2F;p&gt;
&lt;p&gt;We will see.&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Dotbak</title>
          <pubDate>Tue, 18 Jul 2023 05:00:00 +0000</pubDate>
          <author>Ian Pratt &lt;ianjdpratt@gmail.com&gt;</author>
          <link>https://cogsandsquigs.dev/projects/dotbak/</link>
          <guid>https://cogsandsquigs.dev/projects/dotbak/</guid>
          <description xml:base="https://cogsandsquigs.dev/projects/dotbak/">&lt;p&gt;When I made this, I was facing an issue: how do I synchronize my shared environments, my laptop,
desktop, and even (home)server? How can I make it as easy as possible to share my dotfiles?&lt;&#x2F;p&gt;
&lt;p&gt;The current methods were always too tedious and time-consuming to update my dotfiles: I needed to go
to the locations where they’re stored (not where they exist in my filesystem), update them there,
run a command to update the files across my computer, and finally back them up.&lt;&#x2F;p&gt;
&lt;p&gt;With &lt;code&gt;dotbak&lt;&#x2F;code&gt;, I can run a single command, &lt;code&gt;dotbak sync&lt;&#x2F;code&gt;, to update my dotfiles &lt;em&gt;right where they
are in the filesystem!&lt;&#x2F;em&gt; I don’t need to run
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.chezmoi.io&#x2F;quick-start&#x2F;#start-using-chezmoi-on-your-current-machine&quot;&gt;something like&lt;&#x2F;a&gt;
&lt;code&gt;chezmoi cd &amp;amp;&amp;amp; git add . &amp;amp;&amp;amp; git commit -m &quot;Dotfile update&quot;&lt;&#x2F;code&gt;. Instead, It’s just one command.&lt;&#x2F;p&gt;
&lt;p&gt;You might wonder why I would go through making my solution when there are probably other solutions
that would work. After all, why reinvent the wheel?&lt;br &#x2F;&gt;
&lt;br &#x2F;&gt;
For one, I want to get experience making something that would impact people, even if that person is
just me. The process of creating is always something that I can learn from, and I don’t want to just
use a solution that I don’t learn anything from.&lt;&#x2F;p&gt;
&lt;p&gt;This brings me to my second point, which is that I want to &lt;em&gt;understand&lt;&#x2F;em&gt; the solution I’m given. If I
don’t understand how something works, then why use it? What if it breaks, or ruins my system, or is
feature-incomplete (for me, at least)? With a home-grown solution, I can make all the features I
need, and patch all the fixes I want when I want.&lt;&#x2F;p&gt;
&lt;p&gt;Right now, this project is mostly complete. In the future, I may add more features like automatic
synchronization in the background (using some kind of daemon), but that’s only if I have the time,
energy, and need for it. Otherwise, this is mostly done!&lt;&#x2F;p&gt;
&lt;p&gt;If you’re interested in using &lt;code&gt;dotbak&lt;&#x2F;code&gt;, give it a try! If there’s anything you want me to fix or
add, you can make an issue or pull request, and I’ll try to incorporate it as best I can. However,
remember that I’m just one person, and I kinda have a lot of other things on my plate right now, so
please be patient and kind!&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>(Actually) Binding Rust to Swift</title>
          <pubDate>Sun, 16 Jul 2023 05:00:00 +0000</pubDate>
          <author>Ian Pratt &lt;ianjdpratt@gmail.com&gt;</author>
          <link>https://cogsandsquigs.dev/blog/actually-binding-rust-to-swift/</link>
          <guid>https://cogsandsquigs.dev/blog/actually-binding-rust-to-swift/</guid>
          <description xml:base="https://cogsandsquigs.dev/blog/actually-binding-rust-to-swift/">&lt;p&gt;So, about Rust.&lt;&#x2F;p&gt;
&lt;p&gt;It’s great and all, but unfortunately, not &lt;em&gt;every&lt;&#x2F;em&gt; company supports using Rust directly on their
platform (boo! boo Apple!). In my case, it’s (surprise, surprise) Apple that doesn’t support Rust
instead of Swift. &lt;em&gt;However&lt;&#x2F;em&gt;, other people have had this problem in the past, and they’ve created
solutions to work around this.&lt;&#x2F;p&gt;
&lt;p&gt;Why am I writing about binding Swift to Rust in the first place? Because for my work, I needed to
create an &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;cogsandsquigs&#x2F;nand7400&quot;&gt;assembler for a custom CPU&lt;&#x2F;a&gt; (called
&lt;code&gt;nand7400&lt;&#x2F;code&gt;) that’s programmed via an iOS&#x2F;MacOS app. Besides, bindings are a (theoretically) fun
adventure into more low-level concepts, something I wanted to (quote-unquote) enjoy more often.&lt;&#x2F;p&gt;
&lt;p&gt;My poison of choice for this project is &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;mozilla.github.io&#x2F;uniffi-rs&#x2F;&quot;&gt;UniFFI&lt;&#x2F;a&gt;. This library
allows Swift to bind and call to Rust, without much hassle (remember the “much”). You should go read
the docs, but in essence:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;mozilla.github.io&#x2F;uniffi-rs&#x2F;tutorial&#x2F;udl_file.html&quot;&gt;Define a .udl file&lt;&#x2F;a&gt; which
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;mozilla.github.io&#x2F;uniffi-rs&#x2F;udl_file_spec.html&quot;&gt;specifies&lt;&#x2F;a&gt; the exposed APIs.&lt;&#x2F;li&gt;
&lt;li&gt;Include some
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;mozilla.github.io&#x2F;uniffi-rs&#x2F;tutorial&#x2F;Rust_scaffolding.html&quot;&gt;magic mumbo jumbo&lt;&#x2F;a&gt; in your
library to expose the symbols (This step is VERY important! It won’t generate any warnings if
it’s skipped, but doing so will lead to undefined symbol errors down the line in Xcode or
whatever).&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;mozilla.github.io&#x2F;uniffi-rs&#x2F;tutorial&#x2F;foreign_language_bindings.html&quot;&gt;Create and export code&lt;&#x2F;a&gt;
in your language of choice via an
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;mozilla.github.io&#x2F;uniffi-rs&#x2F;tutorial&#x2F;foreign_language_bindings.html#creating-the-bindgen-binary&quot;&gt;associated binary&lt;&#x2F;a&gt;.
You can also use
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;mozilla&#x2F;uniffi-rs&#x2F;#third-party-foreign-language-bindings&quot;&gt;custom back-ends&lt;&#x2F;a&gt;
for unofficially supported languages!&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;That’s it! The documentation pretty much ends there, and expects you to package everything nice and
neat like the good little developer you are. Funnily enough, there’s not a lot of documentation
online on how to do this, even on Apple’s part. Fortunately, some guy has a
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;rhonabwy.com&#x2F;2023&#x2F;02&#x2F;10&#x2F;creating-an-xcframework&#x2F;&quot;&gt;guide&lt;&#x2F;a&gt; on how to package Rust
applications into an &lt;code&gt;XCFramework&lt;&#x2F;code&gt;, which is a special type of binary that can be used on Apple
platforms. There’s also a &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;y-crdt&#x2F;yswift&quot;&gt;rust library&lt;&#x2F;a&gt; that demonstrates
compiling to an &lt;code&gt;XCFramework&lt;&#x2F;code&gt;, which that guy worked on!&lt;&#x2F;p&gt;
&lt;p&gt;To get everything up and running, follow
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;rhonabwy.com&#x2F;2023&#x2F;02&#x2F;10&#x2F;creating-an-xcframework&#x2F;&quot;&gt;that guide&lt;&#x2F;a&gt; to set up your dev
environment for creating an &lt;code&gt;XCFramework&lt;&#x2F;code&gt;. You can use
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;cogsandsquigs&#x2F;nand7400&#x2F;blob&#x2F;main&#x2F;Makefile&quot;&gt;my own makefile&lt;&#x2F;a&gt; to set up and
compile everything, too, which is shown below. In my case, I have the main Rust library in
&lt;code&gt;nand7400&lt;&#x2F;code&gt;, the Swift-binding Rust scaffolding code in &lt;code&gt;nand7400-ffi&lt;&#x2F;code&gt;, and export the Swift code to
&lt;code&gt;nand7400-ffi-bindings&#x2F;swift&lt;&#x2F;code&gt; (I used the YSwift repository’s
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;y-crdt&#x2F;yswift&#x2F;blob&#x2F;main&#x2F;scripts&#x2F;build-xcframework.sh&quot;&gt;build script&lt;&#x2F;a&gt; to start
this &lt;code&gt;Makefile&lt;&#x2F;code&gt;, then tweaked it to my liking and specific setup).&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;make&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8B949E;&quot;&gt;# This makefile is used to build the Nand7400 framework for iOS, macOS and Mac Catalyst. To use it, run `make package` in&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8B949E;&quot;&gt;# the root of the repository.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8B949E;&quot;&gt;# Rust-specific configuration&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;PACKAGE_NAME=nand7400-ffi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;LIB_NAME=libnand7400_ffi.a&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;CARGO_FLAGS= --package &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;PACKAGE_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt; --lib --locked --release&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8B949E;&quot;&gt;# General binding configuration&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;UNIFFI_CMD=cargo run -p nand7400-ffi --features=cli --bin uniffi --&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;UNIFFI_UDL_FILE=src&#x2F;ffi.udl&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8B949E;&quot;&gt;# General build configuration&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;BUILD_FOLDER=target&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ARTIFACTS_FOLDER=target&#x2F;uniffi-artifacts&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;BINDINGS_FOLDER=nand7400-ffi-bindings&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8B949E;&quot;&gt;# Testing&#x2F;fuzzing stuff&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;FUZZ_TARGET=nand7400-fuzz&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8B949E;&quot;&gt;# Additional flags for AFL besides the input, output and target binary&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;AFL_FLAGS=-d -D&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8B949E;&quot;&gt;# Swift-specific stuff&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;FRAMEWORK_NAME=Nand7400FFI&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;XCFRAMEWORK_FOLDER=target&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;FRAMEWORK_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;.xcframework&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8B949E;&quot;&gt;# Install all the necessary build targets to build for Mac, iOS and Mac Catalyst.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A8FF;&quot;&gt;setup-build&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;echo &amp;quot;▸ Installing toolchains...&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8B949E;&quot;&gt;# 	iOS Simulator (Intel)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;rustup target add x86_64-apple-ios&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8B949E;&quot;&gt;#	iOS Simulator (M1)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;rustup target add aarch64-apple-ios-sim&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8B949E;&quot;&gt;#	iOS Device&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;rustup target add aarch64-apple-ios&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8B949E;&quot;&gt;#	macOS ARM&#x2F;M1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;rustup target add aarch64-apple-darwin&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8B949E;&quot;&gt;#	macOS Intel&#x2F;x86&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;rustup target add x86_64-apple-darwin&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A8FF;&quot;&gt;clean&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;echo ▸ Cleaning build...&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;rm -rf &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;ARTIFACTS_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;rm -rf &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;XCFRAMEWORK_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;rm -rf &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;BINDINGS_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;mkdir -p &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;ARTIFACTS_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;mkdir -p &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;BINDINGS_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A8FF;&quot;&gt;bind&lt;&#x2F;span&gt;&lt;span&gt;: setup-build clean&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;echo &amp;quot;▸ Generating Swift scaffolding code...&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;	${&lt;&#x2F;span&gt;&lt;span&gt;UNIFFI_CMD&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt; generate &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;PACKAGE_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;UNIFFI_UDL_FILE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt; --language swift --out-dir &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;BINDINGS_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;swift&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A8FF;&quot;&gt;build-swift&lt;&#x2F;span&gt;&lt;span&gt;: bind&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;echo &amp;quot;▸ Building for x86_64-apple-ios...&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;CFLAGS_x86_64_apple_ios=&amp;quot;-target x86_64-apple-ios&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;\&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;	cargo build --target x86_64-apple-ios &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;CARGO_FLAGS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;echo &amp;quot;▸ Building for aarch64-apple-ios-sim...&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;CFLAGS_aarch64_apple_ios=&amp;quot;-target aarch64-apple-ios-sim&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;\&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;	cargo build --target aarch64-apple-ios-sim &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;CARGO_FLAGS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;echo &amp;quot;▸ Building for aarch64-apple-ios...&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;CFLAGS_aarch64_apple_ios=&amp;quot;-target aarch64-apple-ios&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;\&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;	cargo build --target aarch64-apple-ios &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;CARGO_FLAGS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;echo &amp;quot;▸ Building for aarch64-apple-darwin...&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;CFLAGS_aarch64_apple_darwin=&amp;quot;-target aarch64-apple-darwin&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;\&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;	cargo build --target aarch64-apple-darwin &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;CARGO_FLAGS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;echo &amp;quot;▸ Building for x86_64-apple-darwin...&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;CFLAGS_x86_64_apple_darwin=&amp;quot;-target x86_64-apple-darwin&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;\&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;	cargo build --target x86_64-apple-darwin &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;CARGO_FLAGS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;echo &amp;quot;▸ Building for x86_64-apple-ios-macabi...&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;CFLAGS_x86_64_apple_ios=&amp;quot;-target x86_64-apple-ios-macabi&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;\&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;	cargo +nightly build -Z build-std --target x86_64-apple-ios-macabi &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;CARGO_FLAGS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;echo &amp;quot;▸ Building for aarch64-apple-ios-macabi...&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;CFLAGS_aarch64_apple_ios=&amp;quot;-target aarch64-apple-ios-macabi&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;\&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;	cargo +nightly build -Z build-std --target aarch64-apple-ios-macabi &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;CARGO_FLAGS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;echo &amp;quot;▸ Consolidating the headers and modulemaps for XCFramework generation...&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;mkdir -p &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;ARTIFACTS_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;includes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;cp &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;BINDINGS_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;swift&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;FRAMEWORK_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;.h &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;ARTIFACTS_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;includes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;cp &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;BINDINGS_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;swift&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;FRAMEWORK_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;.modulemap &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;ARTIFACTS_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;includes&#x2F;module.modulemap&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;echo &amp;quot;▸ Merging x86 and arm iOS simulator static libraries into a fat static binary...&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;mkdir -p &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;ARTIFACTS_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;ios-simulator&#x2F;release&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;lipo -create &lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;\&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		.&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;BUILD_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;x86_64-apple-ios&#x2F;release&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;LIB_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		.&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;BUILD_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;aarch64-apple-ios-sim&#x2F;release&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;LIB_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		-output &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;ARTIFACTS_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;ios-simulator&#x2F;release&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;LIB_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;echo &amp;quot;▸ Merging x86 and arm macOS static libraries into a fat static binary...&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;mkdir -p &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;ARTIFACTS_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;apple-darwin&#x2F;release&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;lipo -create &lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;\&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		.&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;BUILD_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;x86_64-apple-darwin&#x2F;release&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;LIB_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		.&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;BUILD_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;aarch64-apple-darwin&#x2F;release&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;LIB_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		-output &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;ARTIFACTS_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;apple-darwin&#x2F;release&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;LIB_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;echo &amp;quot;▸ Merging x86 and arm macOS Catalyst static libraries into a fat static binary...&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;mkdir -p &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;ARTIFACTS_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;mac-catalyst&#x2F;release&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;lipo -create &lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;\&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		.&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;BUILD_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;x86_64-apple-ios-macabi&#x2F;release&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;LIB_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		.&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;BUILD_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;aarch64-apple-ios-macabi&#x2F;release&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;LIB_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		-output &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;ARTIFACTS_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;mac-catalyst&#x2F;release&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;LIB_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A8FF;&quot;&gt;package-swift&lt;&#x2F;span&gt;&lt;span&gt;: build-swift&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;echo &amp;quot;▸ Creating XCFramework...&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8B949E;&quot;&gt;#	what docs there are:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8B949E;&quot;&gt;#	xcodebuild -create-xcframework -help&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8B949E;&quot;&gt;#	https:&#x2F;&#x2F;developer.apple.com&#x2F;documentation&#x2F;xcode&#x2F;creating-a-multi-platform-binary-framework-bundle&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;BUILD_LIBRARY_FOR_DISTRIBUTION=YES &lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;\&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;	xcodebuild -create-xcframework &lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;\&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		-library .&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;BUILD_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;aarch64-apple-ios&#x2F;release&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;LIB_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		-headers .&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;ARTIFACTS_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;includes &lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;\&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		-library .&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;ARTIFACTS_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;ios-simulator&#x2F;release&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;LIB_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		-headers .&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;ARTIFACTS_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;includes &lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;\&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		-library .&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;ARTIFACTS_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;apple-darwin&#x2F;release&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;LIB_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		-headers .&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;ARTIFACTS_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;includes &lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;\&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		-library .&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;ARTIFACTS_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;mac-catalyst&#x2F;release&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;LIB_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		-headers .&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;ARTIFACTS_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;includes &lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;\&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		-output .&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;XCFRAMEWORK_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8B949E;&quot;&gt;#	Move modulemaps to the right place, so that the XCFramework can be used directly in Swift Package Manager&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;mkdir -p &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;XCFRAMEWORK_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;ios-arm64&#x2F;Modules&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;mkdir -p &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;XCFRAMEWORK_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;ios-x86_64-simulator&#x2F;Modules&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;mkdir -p &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;XCFRAMEWORK_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;ios-arm64_x86_64-simulator&#x2F;Modules&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;mkdir -p &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;XCFRAMEWORK_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;ios-arm64_x86_64-maccatalyst&#x2F;Modules&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;mkdir -p &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;XCFRAMEWORK_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;macos-arm64_x86_64&#x2F;Modules&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;cp &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;BINDINGS_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;swift&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;FRAMEWORK_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;.modulemap &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;XCFRAMEWORK_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;ios-arm64&#x2F;Modules&#x2F;module.modulemap&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;cp &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;BINDINGS_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;swift&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;FRAMEWORK_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;.modulemap &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;XCFRAMEWORK_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;ios-x86_64-simulator&#x2F;Modules&#x2F;module.modulemap&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;cp &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;BINDINGS_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;swift&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;FRAMEWORK_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;.modulemap &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;XCFRAMEWORK_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;ios-arm64_x86_64-simulator&#x2F;Modules&#x2F;module.modulemap&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;cp &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;BINDINGS_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;swift&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;FRAMEWORK_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;.modulemap &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;XCFRAMEWORK_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;ios-arm64_x86_64-maccatalyst&#x2F;Modules&#x2F;module.modulemap&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;cp &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;BINDINGS_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;swift&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;FRAMEWORK_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;.modulemap &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;XCFRAMEWORK_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;macos-arm64_x86_64&#x2F;Modules&#x2F;module.modulemap&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;echo &amp;quot;▸ Compressing XCFramework...&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;ditto -c -k --sequesterRsrc --keepParent &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;XCFRAMEWORK_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;} ${&lt;&#x2F;span&gt;&lt;span&gt;XCFRAMEWORK_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;.zip&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;echo &amp;quot;▸ Computing checksum...&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;swift package compute-checksum &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;XCFRAMEWORK_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;.zip &amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span&gt;XCFRAMEWORK_FOLDER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;.zip.sha256&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;echo &amp;quot;▸ Finished Swift bindings!&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8B949E;&quot;&gt;# Convenience target to build and package everything&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A8FF;&quot;&gt;package&lt;&#x2F;span&gt;&lt;span&gt;: package-swift&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	@&lt;&#x2F;span&gt;&lt;span&gt;echo &amp;quot;▸ Done!&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We’re not done, however. We also need to define a &lt;code&gt;Package.swift&lt;&#x2F;code&gt; that tells Xcode how to install
the swift binary. This is mostly also copied from the above repo, and is shown below:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;swift&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8B949E;&quot;&gt;&#x2F;&#x2F; swift-tools-version:5.8&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;import&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFA657;&quot;&gt; Foundation&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;import&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFA657;&quot;&gt; PackageDescription&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; FFIbinaryTarget: PackageDescription.Target&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;let package =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt; Package&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;	name&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt; &amp;quot;Nand7400&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;	platforms&lt;&#x2F;span&gt;&lt;span&gt;: [.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;iOS&lt;&#x2F;span&gt;&lt;span&gt;(.v13), .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;macOS&lt;&#x2F;span&gt;&lt;span&gt;(.v10_15)],&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;	products&lt;&#x2F;span&gt;&lt;span&gt;: [&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;library&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;			name&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt; &amp;quot;Nand7400&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;			targets&lt;&#x2F;span&gt;&lt;span&gt;: [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;&amp;quot;Nand7400&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;	],&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;	dependencies&lt;&#x2F;span&gt;&lt;span&gt;: [],&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;	targets&lt;&#x2F;span&gt;&lt;span&gt;: [&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;target&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;			name&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt; &amp;quot;Nand7400&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;			dependencies&lt;&#x2F;span&gt;&lt;span&gt;: [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;&amp;quot;Nand7400FFI&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;],&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;			path&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt; &amp;quot;nand7400-ffi-bindings&#x2F;swift&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;binaryTarget&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;			name&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt; &amp;quot;Nand7400FFI&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;			url&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt; &amp;quot;https:&#x2F;&#x2F;github.com&#x2F;cogsandsquigs&#x2F;nand7400&#x2F;releases&#x2F;download&#x2F;v0.3.1&#x2F;Nand7400FFI.xcframework.zip&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;			checksum&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt; &amp;quot;3bcdfb390e55cd7f940a5fabb1944f8bb2fbf85791a3b8c55fbd1492d1c18428&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;	]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We define a &lt;code&gt;.target&lt;&#x2F;code&gt; to export to, and also a &lt;code&gt;.binaryTarget&lt;&#x2F;code&gt; which the &lt;code&gt;.target&lt;&#x2F;code&gt; depends on
(that’s where the bindings live). I also specify a path to the swift bindings in &lt;code&gt;.target&lt;&#x2F;code&gt;, because
the default is &lt;code&gt;Sources&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Once everything’s done and set up, you should be good to go! If you’re running my makefile, run
&lt;code&gt;make package&lt;&#x2F;code&gt; to package everything up into an &lt;code&gt;XCFramework&lt;&#x2F;code&gt;, then export that somewhere and put
the link (as well as the &lt;code&gt;sha256&lt;&#x2F;code&gt;) in the &lt;code&gt;Package.swift&lt;&#x2F;code&gt; file.&lt;&#x2F;p&gt;
&lt;p&gt;Happy binding!&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Flash Portenta H7 with Nucleo on-board STLink</title>
          <pubDate>Wed, 14 Jun 2023 05:00:00 +0000</pubDate>
          <author>Ian Pratt &lt;ianjdpratt@gmail.com&gt;</author>
          <link>https://cogsandsquigs.dev/blog/flash-portenta-h7-with-nucleo-on-board-stlink/</link>
          <guid>https://cogsandsquigs.dev/blog/flash-portenta-h7-with-nucleo-on-board-stlink/</guid>
          <description xml:base="https://cogsandsquigs.dev/blog/flash-portenta-h7-with-nucleo-on-board-stlink/">&lt;p&gt;This post comes from an issue I had at work, that I spent hours trying to debug and fix. Now, you
can avoid my terrible fate!&lt;&#x2F;p&gt;
&lt;p&gt;Sometimes, after messing around with things for a while, you’ll cause your Arduino Portenta H7 to
brick itself by scrambling the bootloader. This leads to:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The leftmost orange LED staying on permanently, or with occasional flickering.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;The Portenta no longer responds over USB, and thus cannot be programmed the usual way.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;To fix this issue, you’ll need to flash the Portenta’s bootloader with an external JTAG&#x2F;SWD debugger
of your choice. In my case, I had an STLink-V3PWR to flash with, but that kept failing for some
unknown reason. So, I decided to use a Nucleo-64 on-board STLink-V2 debugger to flash. This is how I
did it.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;materials&quot;&gt;

&lt;a
    class=&quot;anchor-link&quot;
    href=&quot;materials&quot;
&gt;
    🔗
&lt;&#x2F;a&gt;
Materials&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;1 &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;store-usa.arduino.cc&#x2F;products&#x2F;portenta-h7&quot;&gt;Portenta H7&lt;&#x2F;a&gt; board, bricked or otherwise.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;1 &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;store-usa.arduino.cc&#x2F;products&#x2F;arduino-portenta-breakout&quot;&gt;Portenta Breakout&lt;&#x2F;a&gt; board.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;1 &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.st.com&#x2F;en&#x2F;evaluation-tools&#x2F;nucleo-f072rb.html&quot;&gt;Nucleo&lt;&#x2F;a&gt; board with built-in STLink
debugger. I used a Nucleo-F072RB, but similar boards may work. The documentation for Nucleo-F072RB
boards is
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.st.com&#x2F;resource&#x2F;en&#x2F;user_manual&#x2F;um1724-stm32-nucleo64-boards-mb1136-stmicroelectronics.pdf&quot;&gt;here&lt;&#x2F;a&gt;,
and a list of documentation for all Nucleo boards is
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.st.com&#x2F;en&#x2F;evaluation-tools&#x2F;stm32-nucleo-boards&#x2F;documentation.html&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;5 strands of thin wire that can wrap around the JTAG pins on the Portenta breakout. I used
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;usd.saleae.com&#x2F;collections&#x2F;accessories&#x2F;products&#x2F;wire-harness-94&quot;&gt;Saleae Test Leads&lt;&#x2F;a&gt; with
their &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;usd.saleae.com&#x2F;collections&#x2F;accessories&#x2F;products&#x2F;test-clips-93&quot;&gt;Saleae Test Clips&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;1 USB-C cable (for the portenta).&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;1 Mini-USB cable (for the Nucleo).&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;procedure&quot;&gt;

&lt;a
    class=&quot;anchor-link&quot;
    href=&quot;procedure&quot;
&gt;
    🔗
&lt;&#x2F;a&gt;
Procedure&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Connect the Portenta to the Portenta breakout board. If desired, break off the Nucleo debugger
(it is the smaller portion attached by 3 bridges to the main board).&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Remove the &lt;strong&gt;CN2&lt;&#x2F;strong&gt; jumpers off of the Nucleo debugger. This section may change, so refer to your
board’s documentation on using the on-board debugger to debug external chips.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Connect jumper wires to the &lt;strong&gt;SWD&lt;&#x2F;strong&gt; section (also labeled &lt;strong&gt;CM4&lt;&#x2F;strong&gt;) of the Nucleo debugger. Refer
to your board’s documentation for more information on where to place these. A picture of the
wires are shown below.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;cogsandsquigs.dev&#x2F;blog&#x2F;flash-portenta-h7-with-nucleo-on-board-stlink&#x2F;nucleo_stlink_swd_wiring.jpeg&quot; alt=&quot;&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Connect the Nucleo debugger to the Portenta. This step is non-trivial, so pay attention! The
diagrams below show the respective pinouts of important areas for the two boards.&lt;&#x2F;p&gt;
&lt;p&gt;Nucleo debugger:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;cogsandsquigs.dev&#x2F;blog&#x2F;flash-portenta-h7-with-nucleo-on-board-stlink&#x2F;nucleo_stlink_pinout_diagram.png&quot; alt=&quot;&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Portenta breakout JTAG connector:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;cogsandsquigs.dev&#x2F;blog&#x2F;flash-portenta-h7-with-nucleo-on-board-stlink&#x2F;portenta_breakout_pinout_diagram.png&quot; alt=&quot;&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;In the following order, use the 5 wires to connect these 5 pins from the Nucleo debugger to the
Portenta JTAG pins:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;VDD_TARGET&lt;&#x2F;strong&gt; (pin 1) to &lt;strong&gt;+3V3&lt;&#x2F;strong&gt; (pin 1)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;SWCLK&lt;&#x2F;strong&gt; (pin 2) to &lt;strong&gt;TCK&#x2F;SWCLK&lt;&#x2F;strong&gt; (pin 4)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;GND&lt;&#x2F;strong&gt; (pin 3) to &lt;strong&gt;GND&lt;&#x2F;strong&gt; (pin 3, 5, or 9)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;SWDIO&lt;&#x2F;strong&gt; (pin 4) to &lt;strong&gt;TMS&#x2F;SWDIO&lt;&#x2F;strong&gt; (pin 2)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;NRST&lt;&#x2F;strong&gt; (pin 5) to &lt;strong&gt;RESET&lt;&#x2F;strong&gt; (pin 10)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;A picture of the setup is shown below:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;cogsandsquigs.dev&#x2F;blog&#x2F;flash-portenta-h7-with-nucleo-on-board-stlink&#x2F;portenta_breakout_swd_wiring.jpeg&quot; alt=&quot;&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Connect &lt;strong&gt;both&lt;&#x2F;strong&gt; the Nucleo debugger and the Portenta to power. Make sure that each cable can
transfer data to and from their respective ports.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;In the Arduino IDE, go to &lt;strong&gt;Tools &amp;gt; Port&lt;&#x2F;strong&gt; and set the port to the Nucleo debugger (it should
show up as a long string of numbers). Go to &lt;strong&gt;Tools &amp;gt; Programmer&lt;&#x2F;strong&gt; and set it to
&lt;strong&gt;STMicroelectronics STLINK&lt;&#x2F;strong&gt;. Make sure that the board type is set to &lt;strong&gt;Portenta H7&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Go to &lt;strong&gt;Tools &amp;gt; Burn bootloader&lt;&#x2F;strong&gt;. The bootloader should now be burned onto the Portenta!&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;And now, the issue should be resolved. The orange LED should no longer stay on permanently, and you
can now flash any program you like onto the Portenta.&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Hematite</title>
          <pubDate>Tue, 07 Feb 2023 05:00:00 +0000</pubDate>
          <author>Ian Pratt &lt;ianjdpratt@gmail.com&gt;</author>
          <link>https://cogsandsquigs.dev/projects/hematite/</link>
          <guid>https://cogsandsquigs.dev/projects/hematite/</guid>
          <description xml:base="https://cogsandsquigs.dev/projects/hematite/">&lt;p&gt;This is a &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;play.battlesnake.com&#x2F;&quot;&gt;Battlesnake&lt;&#x2F;a&gt; that I made a a while ago, which I still run
on &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;fly.io&#x2F;&quot;&gt;fly.io&lt;&#x2F;a&gt; to this day. Occasionally, I may try to improve it, although I have a
few other things going on right now, so it’s not top priority.&lt;&#x2F;p&gt;
&lt;p&gt;Currently, it uses a heuristic approach combined with a Monte-Carlo tree search. However, that lead
to worse performance both in time and in ability, so my next steps are to either roll it back to
plain heuristics or to improve upon the search.&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Flying high</title>
          <pubDate>Sun, 27 Nov 2022 18:00:00 +0000</pubDate>
          <author>Ian Pratt &lt;ianjdpratt@gmail.com&gt;</author>
          <link>https://cogsandsquigs.dev/writings/flying-high/</link>
          <guid>https://cogsandsquigs.dev/writings/flying-high/</guid>
          <description xml:base="https://cogsandsquigs.dev/writings/flying-high/">&lt;p&gt;Flying high, I see the skies that cradle the ground below, with its shifting hues casting an
iridescent delight to those below and above. Clouds roll by, forming an unbeknownst land of
night-dark ocean and puffy-white ground. Shifting and changing, it renews itself, creating worlds in
the air that only exist for a moment.&lt;&#x2F;p&gt;
&lt;p&gt;I wonder if these worlds have people. Would they be perturbed by their ever-changing domain? Would
they have adapted, becoming one with their kingdom in the sky? Endless questions drift by,
entertaining thoughts and ideas for a while.&lt;&#x2F;p&gt;
&lt;p&gt;Passing through the clouds, I see a grid of lit houses, their lights flickering as endless minuscule
shapes flash by. Almost like it’s living, the light moves and waves and dances in the night, a sight
to behold from above. Scurrying like ants, vehicles cast their presence across the roads, twisting
and turning into their homes for tonight.&lt;&#x2F;p&gt;
&lt;p&gt;The last thing I see before landing is the vestiges of the sky and land connected on the horizon,
with the shadows of structures standing prominently in-between, an inescapable presence.&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Jarfe</title>
          <pubDate>Fri, 14 Oct 2022 05:00:00 +0000</pubDate>
          <author>Ian Pratt &lt;ianjdpratt@gmail.com&gt;</author>
          <link>https://cogsandsquigs.dev/projects/jarfe/</link>
          <guid>https://cogsandsquigs.dev/projects/jarfe/</guid>
          <description xml:base="https://cogsandsquigs.dev/projects/jarfe/">&lt;p&gt;This was just a silly side-project to make a &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;jsfuck.com&#x2F;&quot;&gt;JSFuck&lt;&#x2F;a&gt; compiler, in Rust of
course! I just wanted something to do, so why not this?&lt;&#x2F;p&gt;
&lt;p&gt;It was fun making this, and while it serves no practical purpose, it was at least a nice distraction
from boredom. Maybe you’ll find it useful? (I doubt it)&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Slaving away so you don’t have to</title>
          <pubDate>Fri, 05 Aug 2022 00:00:00 +0000</pubDate>
          <author>Ian Pratt &lt;ianjdpratt@gmail.com&gt;</author>
          <link>https://cogsandsquigs.dev/blog/slaving-away-so-you-dont-have-to/</link>
          <guid>https://cogsandsquigs.dev/blog/slaving-away-so-you-dont-have-to/</guid>
          <description xml:base="https://cogsandsquigs.dev/blog/slaving-away-so-you-dont-have-to/">&lt;p&gt;Sooo… where was I?&lt;&#x2F;p&gt;
&lt;p&gt;Mostly just doing my own thing, building stuff, breaking stuff, etc., etc. Living the dream, as some
might say.&lt;&#x2F;p&gt;
&lt;p&gt;Part of what I was doing was taking the long, winding road to creating
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;cogsandsquigs&#x2F;twiboot&quot;&gt;cogsandsquigs&#x2F;twiboot&lt;&#x2F;a&gt; (not to be confused with
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;orempel&#x2F;twiboot&quot;&gt;orempel&#x2F;twiboot&lt;&#x2F;a&gt;, but that’ll be explained later). How I got
here was long, tiring, and frankly too exhausting. So that’s where two (of the many previous) weeks
of my life went!&lt;&#x2F;p&gt;
&lt;p&gt;Flashback to 2 weeks prior: I was sitting around, minding my own buisness, when my boss and I were
having a discussion about what to do about our problem: The chips we were using for our internal
project didn’t support OTA updates. They’re just tiny little ATmega328s, which we could possibly
ship with buggy or outright broken code! Fortunately, these guys were controlled by a Particle
Argon, which could connect to WiFi and &lt;em&gt;did&lt;&#x2F;em&gt; support OTA updates.&lt;&#x2F;p&gt;
&lt;p&gt;The question was, how do we get the ATmegas to be updated by the Argon? The answer was a
&lt;strong&gt;bootloader&lt;&#x2F;strong&gt;, of course! A custom bootloader which could be controlled (for a split second) by the
Argon, which could send it new firmware through a communication protocol (I2C&#x2F;TWI was the one we
were gonna use), and bam! updates! How hard could it be? Not worse than coding in C for the Argon
and Arduino Uno (basically an ATmega + nice libraries + nice hardware), right?&lt;&#x2F;p&gt;
&lt;p&gt;As it turns out, it was awfully hard. Like, really, really, really hard. Low level programming with
C is not for everyone (and definitely not for me!). Because I don’t want to provide too much detail,
being a lazy blogger, here’s a step-by-step of what happened:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Research.&lt;&#x2F;li&gt;
&lt;li&gt;Start with low-level programming.&lt;&#x2F;li&gt;
&lt;li&gt;Get a simple blink example to work on an ATmega328.&lt;&#x2F;li&gt;
&lt;li&gt;Great, that works! Try doing stuff over UART&#x2F;Serial.&lt;&#x2F;li&gt;
&lt;li&gt;Very difficult, but manageable. Try I2C&#x2F;TWI now?.&lt;&#x2F;li&gt;
&lt;li&gt;Wow, that was awful, and it doesn’t work!.&lt;&#x2F;li&gt;
&lt;li&gt;Repeat steps 1-6 a few more times.&lt;&#x2F;li&gt;
&lt;li&gt;Stumble across &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;orempel&#x2F;twiboot&quot;&gt;orempel&#x2F;twiboot&lt;&#x2F;a&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;Try to get that to work.&lt;&#x2F;li&gt;
&lt;li&gt;Suprise! It doesn’t :(.&lt;&#x2F;li&gt;
&lt;li&gt;Repeat steps 1-6.&lt;&#x2F;li&gt;
&lt;li&gt;Try to make just a bootloader, see if that can work.&lt;&#x2F;li&gt;
&lt;li&gt;It works, just not for what we need.&lt;&#x2F;li&gt;
&lt;li&gt;Repeat steps 1-6.&lt;&#x2F;li&gt;
&lt;li&gt;Try twiboot in desperation again.&lt;&#x2F;li&gt;
&lt;li&gt;Suprise! It works now. (I needed to send 128 bytes of flash per page at a time, nothing more or
less. Silly me, just read the docs!)&lt;&#x2F;li&gt;
&lt;li&gt;Make a particle library for it.&lt;&#x2F;li&gt;
&lt;li&gt;Done! Eazy-peezy lemon-squeezy.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Yeah… those were an awful two weeks. But I’m done now, and you can find the library at the link
above. Don’t confuse it for orempel’s library, though. That’s the &lt;em&gt;actual&lt;&#x2F;em&gt; bootloader.&lt;&#x2F;p&gt;
&lt;p&gt;So if you’re ever in my position, and need something to help you, maybe my work can make your life
easier. Maybe. Or it could make it hell, I dunno how many bugs are in there (but I tried to squash
them all, don’t worry :P).&lt;&#x2F;p&gt;
&lt;p&gt;So I guess the moral of the story is that you should do things the easier way, especially if someone
has done them before, because otherwise you end up wasting weeks of your time and energy getting
nearly nothing done, only for you to find out that someone else did what you tried to do better than
you ever could.&lt;&#x2F;p&gt;
&lt;p&gt;See ya!&lt;&#x2F;p&gt;
</description>
      </item>
    </channel>
</rss>
