From 6d115af11ae44b4598abb6aac32b676ec17aa40a Mon Sep 17 00:00:00 2001 From: Anton-4 <17049058+Anton-4@users.noreply.github.com> Date: Mon, 23 Jan 2023 20:11:32 +0100 Subject: [PATCH 1/2] update tutorial basic-cli release --- crates/linker/src/metadata.rs | 15 ++++++++++++++- www/generate_tutorial/src/input/tutorial.md | 12 ++++++------ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/crates/linker/src/metadata.rs b/crates/linker/src/metadata.rs index a8f19d28fc..a2125543fb 100644 --- a/crates/linker/src/metadata.rs +++ b/crates/linker/src/metadata.rs @@ -56,7 +56,20 @@ impl Metadata { pub fn read_from_file(metadata_filename: &Path) -> Self { let input = - std::fs::File::open(metadata_filename).unwrap_or_else(|e| internal_error!("{}", e)); + std::fs::File::open(metadata_filename) + .unwrap_or_else( + |e| internal_error!(r#" + + Error: + {} + + > This may occur when using a release of roc that relies on a specific metadata format like 'rm2' and the imported platform only has an older metadata format available, like rm1. + The platform you are using can be found in the header of your main.roc: `packages {{ pf: }}`. + You should check if a more recent version of the platform is available. + If not, you should notify the author of the platform about this issue. + +"#, e) + ); match deserialize_from(BufReader::new(input)) { Ok(data) => data, diff --git a/www/generate_tutorial/src/input/tutorial.md b/www/generate_tutorial/src/input/tutorial.md index e4b0302e23..488f01b0a2 100644 --- a/www/generate_tutorial/src/input/tutorial.md +++ b/www/generate_tutorial/src/input/tutorial.md @@ -127,7 +127,7 @@ Let's move out of the REPL and create our first Roc application! Make a file named `main.roc` and put this in it:
app "hello"
-    packages { pf: "https://github.com/roc-lang/basic-cli/releases/download/0.1.3/5SXwdW7rH8QAOnD71IkHcFxCmBEPtFSLAIkclPEgjHQ.tar.br" }
+    packages { pf: "https://github.com/roc-lang/basic-cli/releases/download/0.2.0/8tCohJeXMBUnjo_zdMq0jSaqdYoCWJkWazBd4wa8cQU.tar.br" }
     imports [pf.Stdout]
     provides [main] to pf
 
@@ -1191,7 +1191,7 @@ Besides being built into the compiler, the builtin modules are different from ot
 Let's take a closer look at the part of `main.roc` above the `main` def:
 
 
app "hello"
-    packages { pf : "https://github.com/roc-lang/basic-cli/releases/download/0.1.3/5SXwdW7rH8QAOnD71IkHcFxCmBEPtFSLAIkclPEgjHQ.tar.br" }
+    packages { pf : "https://github.com/roc-lang/basic-cli/releases/download/0.2.0/8tCohJeXMBUnjo_zdMq0jSaqdYoCWJkWazBd4wa8cQU.tar.br" }
     imports [pf.Stdout]
     provides main to pf
 
@@ -1202,7 +1202,7 @@ The line `app "hello"` states that this module defines a Roc application, and th The remaining lines all involve the [platform](https://github.com/roc-lang/roc/wiki/Roc-concepts-explained#platform) this application is built on: -
packages { pf : "https://github.com/roc-lang/basic-cli/releases/download/0.1.3/5SXwdW7rH8QAOnD71IkHcFxCmBEPtFSLAIkclPEgjHQ.tar.br" }
+
packages { pf : "https://github.com/roc-lang/basic-cli/releases/download/0.2.0/8tCohJeXMBUnjo_zdMq0jSaqdYoCWJkWazBd4wa8cQU.tar.br" }
 imports [pf.Stdout]
 provides [main] to pf
 
@@ -1247,7 +1247,7 @@ We'll use these four operations to learn about tasks. Let's start with a basic "Hello World" program.
app "cli-tutorial"
-    packages { pf : "https://github.com/roc-lang/basic-cli/releases/download/0.1.3/5SXwdW7rH8QAOnD71IkHcFxCmBEPtFSLAIkclPEgjHQ.tar.br" }
+    packages { pf : "https://github.com/roc-lang/basic-cli/releases/download/0.2.0/8tCohJeXMBUnjo_zdMq0jSaqdYoCWJkWazBd4wa8cQU.tar.br" }
     imports [pf.Stdout]
     provides [main] to pf
 
@@ -1274,7 +1274,7 @@ In contrast, `Stdin.line` produces a `Str` when it finishes reading from [standa
 Let's change `main` to read a line from `stdin`, and then print it back out again:
 
 
app "cli-tutorial"
-    packages { pf : "https://github.com/roc-lang/basic-cli/releases/download/0.1.3/5SXwdW7rH8QAOnD71IkHcFxCmBEPtFSLAIkclPEgjHQ.tar.br" }
+    packages { pf : "https://github.com/roc-lang/basic-cli/releases/download/0.2.0/8tCohJeXMBUnjo_zdMq0jSaqdYoCWJkWazBd4wa8cQU.tar.br" }
     imports [pf.Stdout, pf.Stdin, pf.Task]
     provides [main] to pf
 
@@ -1311,7 +1311,7 @@ For example, we can print a prompt before we pause to read from `stdin`, so it n
 This works, but we can make it a little nicer to read. Let's change it to the following:
 
 
app "cli-tutorial"
-    packages { pf: "https://github.com/roc-lang/basic-cli/releases/download/0.1.3/5SXwdW7rH8QAOnD71IkHcFxCmBEPtFSLAIkclPEgjHQ.tar.br" }
+    packages { pf: "https://github.com/roc-lang/basic-cli/releases/download/0.2.0/8tCohJeXMBUnjo_zdMq0jSaqdYoCWJkWazBd4wa8cQU.tar.br" }
     imports [pf.Stdout, pf.Stdin, pf.Task.{ await }]
     provides [main] to pf
 

From 8e756d59d5d474e6ecfced907412fafa8f072e58 Mon Sep 17 00:00:00 2001
From: Anton-4 <17049058+Anton-4@users.noreply.github.com>
Date: Mon, 23 Jan 2023 20:14:38 +0100
Subject: [PATCH 2/2] excepetion for cli docs link

---
 mlc_config.json | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mlc_config.json b/mlc_config.json
index 2e9660d18b..ddbc08184f 100644
--- a/mlc_config.json
+++ b/mlc_config.json
@@ -32,6 +32,9 @@
         },
         {
             "pattern": "https://www.10xeditor.com/"
+        },
+        {
+            "pattern": "https://www.roc-lang.org/packages/basic-cli/Stdout#line"
         }
     ]
 }