From fa56e0fd4cce1b6d1680234871292705518214c7 Mon Sep 17 00:00:00 2001 From: inoas Date: Wed, 1 May 2024 16:16:25 +0200 Subject: [PATCH 1/4] fix a bug where publishing to hex would fail if the description in gleam.toml had an utf8 symbol --- CHANGELOG.md | 7 +++++-- compiler-cli/src/publish.rs | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52b005bafda..a6505c577c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,5 @@ # Changelog -## Unreleased - ### Build tool - A helpful error message is now shown if the `manifest.toml` file has been @@ -42,6 +40,11 @@ when building them locally. It is still added when publishing to Hex. ([Pi-Cla](https://github.com/Pi-Cla)) +- Fixed a bug where having utf8 symbols in ´gleam.toml´'s description value + would result in an HTTP 500 error when running `gleam publish`. + + ([inoas](https://github.com/inoas)) + ### Compiler - The compiler will now raise a warning for `let assert` assignments where the diff --git a/compiler-cli/src/publish.rs b/compiler-cli/src/publish.rs index 1e47803f8f0..869cae066fb 100644 --- a/compiler-cli/src/publish.rs +++ b/compiler-cli/src/publish.rs @@ -527,7 +527,7 @@ impl<'a> ReleaseMetadata<'a> { r#"{{<<"name">>, <<"{name}">>}}. {{<<"app">>, <<"{name}">>}}. {{<<"version">>, <<"{version}">>}}. -{{<<"description">>, <<"{description}">>}}. +{{<<"description">>, <<"{description}/utf8">>}}. {{<<"licenses">>, [{licenses}]}}. {{<<"build_tools">>, [{build_tools}]}}. {{<<"links">>, [{links} @@ -600,7 +600,7 @@ fn release_metadata_as_erlang() { let meta = ReleaseMetadata { name: "myapp", version: &version, - description: "description goes here", + description: "description goes here 🌈", source_files: &[ Utf8PathBuf::from("gleam.toml"), Utf8PathBuf::from("src/thingy.gleam"), @@ -630,7 +630,7 @@ fn release_metadata_as_erlang() { r#"{<<"name">>, <<"myapp">>}. {<<"app">>, <<"myapp">>}. {<<"version">>, <<"1.2.3">>}. -{<<"description">>, <<"description goes here">>}. +{<<"description">>, <<"description goes here 🌈/utf8">>}. {<<"licenses">>, [<<"MIT">>, <<"MPL-2.0">>]}. {<<"build_tools">>, [<<"gleam">>, <<"rebar3">>]}. {<<"links">>, [ From c1d85537a9ae45f7ee154f5bed293fc073339969 Mon Sep 17 00:00:00 2001 From: inoas Date: Wed, 1 May 2024 16:17:48 +0200 Subject: [PATCH 2/4] readd header --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6505c577c2..65d3d035cc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +## Unreleased + ### Build tool - A helpful error message is now shown if the `manifest.toml` file has been From 0890285044c1e8782528d274a3b03fd080fd3797 Mon Sep 17 00:00:00 2001 From: inoas Date: Wed, 1 May 2024 16:25:45 +0200 Subject: [PATCH 3/4] fix changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65d3d035cc9..34bcb070f16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,7 +42,7 @@ when building them locally. It is still added when publishing to Hex. ([Pi-Cla](https://github.com/Pi-Cla)) -- Fixed a bug where having utf8 symbols in ´gleam.toml´'s description value +- Fixed a bug where having utf8 symbols in `gleam.toml`'s description value would result in an HTTP 500 error when running `gleam publish`. ([inoas](https://github.com/inoas)) From c876385c67eee93183c2705cff424bb75b5be7a2 Mon Sep 17 00:00:00 2001 From: inoas Date: Wed, 1 May 2024 16:27:18 +0200 Subject: [PATCH 4/4] fix impl --- compiler-cli/src/publish.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler-cli/src/publish.rs b/compiler-cli/src/publish.rs index 869cae066fb..52f9a766f28 100644 --- a/compiler-cli/src/publish.rs +++ b/compiler-cli/src/publish.rs @@ -527,7 +527,7 @@ impl<'a> ReleaseMetadata<'a> { r#"{{<<"name">>, <<"{name}">>}}. {{<<"app">>, <<"{name}">>}}. {{<<"version">>, <<"{version}">>}}. -{{<<"description">>, <<"{description}/utf8">>}}. +{{<<"description">>, <<"{description}"/utf8>>}}. {{<<"licenses">>, [{licenses}]}}. {{<<"build_tools">>, [{build_tools}]}}. {{<<"links">>, [{links} @@ -630,7 +630,7 @@ fn release_metadata_as_erlang() { r#"{<<"name">>, <<"myapp">>}. {<<"app">>, <<"myapp">>}. {<<"version">>, <<"1.2.3">>}. -{<<"description">>, <<"description goes here 🌈/utf8">>}. +{<<"description">>, <<"description goes here 🌈"/utf8>>}. {<<"licenses">>, [<<"MIT">>, <<"MPL-2.0">>]}. {<<"build_tools">>, [<<"gleam">>, <<"rebar3">>]}. {<<"links">>, [