From b8c7b59d31911b4811aca056b7755765b2c1a9be Mon Sep 17 00:00:00 2001 From: Fijxu Date: Thu, 6 Aug 2026 15:39:44 -0400 Subject: [PATCH 01/19] feat: show message for unsupported Crystal versions at compile time --- src/invidious.cr | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/invidious.cr b/src/invidious.cr index 09fbb6244..c77904bb0 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -50,6 +50,15 @@ require "./invidious/routes/**" require "./invidious/jobs/base_job" require "./invidious/jobs/*" +# Show a nice message for unsupported versions of the Crystal compiler, +# encouraging the user compiling Invidiou, to update it's Crystal compiler +# version. +{% if compare_versions(Crystal::VERSION, "1.12.0") < 0 %} + {{ raise "Crystal version 1.12.0 or newer is required to build Invidious, \ + you currently have Crystal version #{Crystal::VERSION}, \ + update it to a new version to be able to build Invidious." }} +{% end %} + # Declare the base namespace for invidious module Invidious end From 477a1a088df784f1e686aee2582ef2ef33a51fbf Mon Sep 17 00:00:00 2001 From: Fijxu Date: Thu, 6 Aug 2026 15:43:56 -0400 Subject: [PATCH 02/19] typo --- src/invidious.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/invidious.cr b/src/invidious.cr index c77904bb0..adc4952eb 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -51,7 +51,7 @@ require "./invidious/jobs/base_job" require "./invidious/jobs/*" # Show a nice message for unsupported versions of the Crystal compiler, -# encouraging the user compiling Invidiou, to update it's Crystal compiler +# encouraging the user compiling Invidious, to update it's Crystal compiler # version. {% if compare_versions(Crystal::VERSION, "1.12.0") < 0 %} {{ raise "Crystal version 1.12.0 or newer is required to build Invidious, \ From 2052acfe0d3837f5ed24bb04e1b5db96ca84ba92 Mon Sep 17 00:00:00 2001 From: Fijxu Date: Thu, 6 Aug 2026 15:45:39 -0400 Subject: [PATCH 03/19] better message --- src/invidious.cr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/invidious.cr b/src/invidious.cr index adc4952eb..ff378d308 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -56,7 +56,8 @@ require "./invidious/jobs/*" {% if compare_versions(Crystal::VERSION, "1.12.0") < 0 %} {{ raise "Crystal version 1.12.0 or newer is required to build Invidious, \ you currently have Crystal version #{Crystal::VERSION}, \ - update it to a new version to be able to build Invidious." }} + update it to a new version to be able to build Invidious. \ + For more information, visit the official Crystal compiler website: https://crystal-lang.org/install/" }} {% end %} # Declare the base namespace for invidious From f4b65a3fac08efc2dc92ef82f0ff250116e57751 Mon Sep 17 00:00:00 2001 From: Fijxu Date: Thu, 6 Aug 2026 15:46:11 -0400 Subject: [PATCH 04/19] Change minimum version to 1.14.1 --- src/invidious.cr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/invidious.cr b/src/invidious.cr index ff378d308..5498c9b30 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -53,8 +53,8 @@ require "./invidious/jobs/*" # Show a nice message for unsupported versions of the Crystal compiler, # encouraging the user compiling Invidious, to update it's Crystal compiler # version. -{% if compare_versions(Crystal::VERSION, "1.12.0") < 0 %} - {{ raise "Crystal version 1.12.0 or newer is required to build Invidious, \ +{% if compare_versions(Crystal::VERSION, "1.14.1") < 0 %} + {{ raise "Crystal version 1.14.1 or newer is required to build Invidious, \ you currently have Crystal version #{Crystal::VERSION}, \ update it to a new version to be able to build Invidious. \ For more information, visit the official Crystal compiler website: https://crystal-lang.org/install/" }} From 400bb308036793727cb853c5de85d47b8a9aecad Mon Sep 17 00:00:00 2001 From: Fijxu Date: Thu, 6 Aug 2026 18:13:46 -0400 Subject: [PATCH 05/19] Update src/invidious.cr Co-authored-by: TheFrenchGhosty <47571719+TheFrenchGhosty@users.noreply.github.com> --- src/invidious.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/invidious.cr b/src/invidious.cr index 5498c9b30..7aa68eacf 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -54,7 +54,7 @@ require "./invidious/jobs/*" # encouraging the user compiling Invidious, to update it's Crystal compiler # version. {% if compare_versions(Crystal::VERSION, "1.14.1") < 0 %} - {{ raise "Crystal version 1.14.1 or newer is required to build Invidious, \ + {{ raise "Crystal version 1.14.1 or newer is required to build Invidious. \ you currently have Crystal version #{Crystal::VERSION}, \ update it to a new version to be able to build Invidious. \ For more information, visit the official Crystal compiler website: https://crystal-lang.org/install/" }} From 086763c67c0cd0c100a466590d89185d0dca48d8 Mon Sep 17 00:00:00 2001 From: Fijxu Date: Thu, 6 Aug 2026 18:14:01 -0400 Subject: [PATCH 06/19] Update src/invidious.cr Co-authored-by: TheFrenchGhosty <47571719+TheFrenchGhosty@users.noreply.github.com> --- src/invidious.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/invidious.cr b/src/invidious.cr index 7aa68eacf..7c25da3bb 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -55,7 +55,7 @@ require "./invidious/jobs/*" # version. {% if compare_versions(Crystal::VERSION, "1.14.1") < 0 %} {{ raise "Crystal version 1.14.1 or newer is required to build Invidious. \ - you currently have Crystal version #{Crystal::VERSION}, \ + You currently have Crystal version #{Crystal::VERSION} installed. \ update it to a new version to be able to build Invidious. \ For more information, visit the official Crystal compiler website: https://crystal-lang.org/install/" }} {% end %} From 182521f0770c4864219262d0bee4e193bc01f4fd Mon Sep 17 00:00:00 2001 From: Fijxu Date: Thu, 6 Aug 2026 18:14:15 -0400 Subject: [PATCH 07/19] Update src/invidious.cr Co-authored-by: TheFrenchGhosty <47571719+TheFrenchGhosty@users.noreply.github.com> --- src/invidious.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/invidious.cr b/src/invidious.cr index 7c25da3bb..70bc31cec 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -57,7 +57,7 @@ require "./invidious/jobs/*" {{ raise "Crystal version 1.14.1 or newer is required to build Invidious. \ You currently have Crystal version #{Crystal::VERSION} installed. \ update it to a new version to be able to build Invidious. \ - For more information, visit the official Crystal compiler website: https://crystal-lang.org/install/" }} + We recommend that you install it following the way that the Crystal compiler itself recommend for your OS, see: https://crystal-lang.org/install/" }} {% end %} # Declare the base namespace for invidious From 047a128622beab0fcdadb48a784022c28001b92d Mon Sep 17 00:00:00 2001 From: Fijxu Date: Thu, 6 Aug 2026 18:14:30 -0400 Subject: [PATCH 08/19] Update src/invidious.cr Co-authored-by: TheFrenchGhosty <47571719+TheFrenchGhosty@users.noreply.github.com> --- src/invidious.cr | 1 - 1 file changed, 1 deletion(-) diff --git a/src/invidious.cr b/src/invidious.cr index 70bc31cec..7c4096f46 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -56,7 +56,6 @@ require "./invidious/jobs/*" {% if compare_versions(Crystal::VERSION, "1.14.1") < 0 %} {{ raise "Crystal version 1.14.1 or newer is required to build Invidious. \ You currently have Crystal version #{Crystal::VERSION} installed. \ - update it to a new version to be able to build Invidious. \ We recommend that you install it following the way that the Crystal compiler itself recommend for your OS, see: https://crystal-lang.org/install/" }} {% end %} From 143077be070a6809e2be3afd4fb4797815bad311 Mon Sep 17 00:00:00 2001 From: Fijxu Date: Thu, 6 Aug 2026 20:48:55 -0400 Subject: [PATCH 09/19] set min version in a variable --- src/invidious.cr | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/invidious.cr b/src/invidious.cr index 7c4096f46..7ae1406cb 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -53,10 +53,13 @@ require "./invidious/jobs/*" # Show a nice message for unsupported versions of the Crystal compiler, # encouraging the user compiling Invidious, to update it's Crystal compiler # version. -{% if compare_versions(Crystal::VERSION, "1.14.1") < 0 %} - {{ raise "Crystal version 1.14.1 or newer is required to build Invidious. \ - You currently have Crystal version #{Crystal::VERSION} installed. \ - We recommend that you install it following the way that the Crystal compiler itself recommend for your OS, see: https://crystal-lang.org/install/" }} +{% begin %} + {% minimum_version = "1.14.1" %} + {% if compare_versions(Crystal::VERSION, minimum_version) < 0 %} + {{ raise "Crystal version #{minimum_version} or newer is required to build Invidious. \ + You currently have Crystal version #{Crystal::VERSION} installed. \ + We recommend that you install it following the way that the Crystal compiler itself recommend for your OS, see: https://crystal-lang.org/install/" }} + {% end %} {% end %} # Declare the base namespace for invidious From 22e269ba99c232d288be944cf9d6018550c1a629 Mon Sep 17 00:00:00 2001 From: Fijxu Date: Mon, 17 Aug 2026 01:39:45 -0400 Subject: [PATCH 10/19] Improve minimum version by using shards.yml `crystal` attribute --- shard.yml | 4 ++-- src/invidious.cr | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/shard.yml b/shard.yml index 779a25699..d1c9be305 100644 --- a/shard.yml +++ b/shard.yml @@ -10,7 +10,7 @@ targets: main: src/invidious.cr description: | - Invidious is an alternative front-end to YouTube + Invidious is an alternative front-end to YouTube dependencies: pg: @@ -40,7 +40,7 @@ development_dependencies: github: crystal-ameba/ameba version: ~> 1.6.1 -crystal: ">= 1.10.0, < 2.0.0" +crystal: ">= 1.20.0, < 2.0.0" license: AGPL-3.0-only diff --git a/src/invidious.cr b/src/invidious.cr index 7ae1406cb..4744ab2ac 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -54,11 +54,18 @@ require "./invidious/jobs/*" # encouraging the user compiling Invidious, to update it's Crystal compiler # version. {% begin %} - {% minimum_version = "1.14.1" %} - {% if compare_versions(Crystal::VERSION, minimum_version) < 0 %} - {{ raise "Crystal version #{minimum_version} or newer is required to build Invidious. \ - You currently have Crystal version #{Crystal::VERSION} installed. \ - We recommend that you install it following the way that the Crystal compiler itself recommend for your OS, see: https://crystal-lang.org/install/" }} + # `-Dskip_version_check` compile-time flag, for development purposes + # or weird installations that lack the `shard.yml` file when compiling + # Invidious. + {% if !flag?(:skip_version_check) %} + {% shard_yml = read_file("shard.yml") %} + {% crystal_constraint = shard_yml.split('\n').find { |line| line.starts_with?("crystal:") } %} + {% minimum_version = crystal_constraint.split('"')[1].split(",").first.split(">=").last.strip %} + {% if compare_versions(Crystal::VERSION, minimum_version) < 0 %} + {{ raise "Crystal version #{minimum_version} or newer is required to build Invidious. \ + You currently have Crystal version #{Crystal::VERSION} installed. \ + We recommend that you install it following the way that the Crystal compiler itself recommend for your OS, see: https://crystal-lang.org/install/" }} + {% end %} {% end %} {% end %} From 121ac8f81e6fce3db3565ddde45c176fbedd86e6 Mon Sep 17 00:00:00 2001 From: Fijxu Date: Mon, 17 Aug 2026 01:41:30 -0400 Subject: [PATCH 11/19] correct version --- shard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shard.yml b/shard.yml index d1c9be305..3c5797912 100644 --- a/shard.yml +++ b/shard.yml @@ -40,7 +40,7 @@ development_dependencies: github: crystal-ameba/ameba version: ~> 1.6.1 -crystal: ">= 1.20.0, < 2.0.0" +crystal: ">= 1.14.0, < 2.0.0" license: AGPL-3.0-only From 0b2f2aa36e97230a3aab444258c49bdd63e71dd4 Mon Sep 17 00:00:00 2001 From: Fijxu Date: Mon, 17 Aug 2026 01:43:57 -0400 Subject: [PATCH 12/19] Add SKIP_VERISON_CHECK to Makefile --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 96599dc18..adb979cc5 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ RELEASE := 1 STATIC := 0 NO_DBG_SYMBOLS := 0 +SKIP_VERSION_CHECK := 0 FLAGS ?= @@ -27,6 +28,9 @@ ifeq ($(API_ONLY), 1) FLAGS += -Dapi_only endif +ifeq ($(SKIP_VERSION_CHECK), 1) + FLAGS += -Dskip_version_check +endif # ----------------------- # Main From a5d303db00eaf0180e5c04196d98f3a3380c879e Mon Sep 17 00:00:00 2001 From: Fijxu Date: Mon, 17 Aug 2026 01:45:49 -0400 Subject: [PATCH 13/19] forgot to modify the help target :p --- Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index adb979cc5..f7f015276 100644 --- a/Makefile +++ b/Makefile @@ -107,11 +107,12 @@ help: @echo "" @echo "Build options available for this Makefile:" @echo "" - @echo " RELEASE Make a release build (Default: 1)" - @echo " STATIC Link libraries statically (Default: 0)" + @echo " RELEASE Make a release build (Default: 1)" + @echo " STATIC Link libraries statically (Default: 0)" @echo "" - @echo " API_ONLY Build invidious without a GUI (Default: 0)" - @echo " NO_DBG_SYMBOLS Strip debug symbols (Default: 0)" + @echo " API_ONLY Build invidious without a GUI (Default: 0)" + @echo " NO_DBG_SYMBOLS Strip debug symbols (Default: 0)" + @echo " SKIP_VERSION_CHECK Skips the Crystal compiler version check (Default: 0)" From d2bc3e6a6dac91a646389285b7faaf60b982d95c Mon Sep 17 00:00:00 2001 From: Fijxu Date: Mon, 17 Aug 2026 01:47:44 -0400 Subject: [PATCH 14/19] apply ameba suggestion --- src/invidious.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/invidious.cr b/src/invidious.cr index 4744ab2ac..22d4ee7d8 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -59,7 +59,7 @@ require "./invidious/jobs/*" # Invidious. {% if !flag?(:skip_version_check) %} {% shard_yml = read_file("shard.yml") %} - {% crystal_constraint = shard_yml.split('\n').find { |line| line.starts_with?("crystal:") } %} + {% crystal_constraint = shard_yml.split('\n').find(&.starts_with?("crystal:")) %} {% minimum_version = crystal_constraint.split('"')[1].split(",").first.split(">=").last.strip %} {% if compare_versions(Crystal::VERSION, minimum_version) < 0 %} {{ raise "Crystal version #{minimum_version} or newer is required to build Invidious. \ From 7cf755d7164358798cab34b7e9b2fac946faaec8 Mon Sep 17 00:00:00 2001 From: Fijxu Date: Mon, 17 Aug 2026 04:32:15 -0400 Subject: [PATCH 15/19] Update src/invidious.cr Co-authored-by: TheFrenchGhosty <47571719+TheFrenchGhosty@users.noreply.github.com> --- src/invidious.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/invidious.cr b/src/invidious.cr index 22d4ee7d8..4aa8b1fac 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -64,7 +64,7 @@ require "./invidious/jobs/*" {% if compare_versions(Crystal::VERSION, minimum_version) < 0 %} {{ raise "Crystal version #{minimum_version} or newer is required to build Invidious. \ You currently have Crystal version #{Crystal::VERSION} installed. \ - We recommend that you install it following the way that the Crystal compiler itself recommend for your OS, see: https://crystal-lang.org/install/" }} + We recommend that you install it following the way that the team behind the Crystal compiler itself recommend for your OS, see: https://crystal-lang.org/install/" }} {% end %} {% end %} {% end %} From 2b3210eeec63c294aa541fd99839f5fb8fc39afc Mon Sep 17 00:00:00 2001 From: Fijxu Date: Mon, 17 Aug 2026 04:32:31 -0400 Subject: [PATCH 16/19] Update src/invidious.cr Co-authored-by: TheFrenchGhosty <47571719+TheFrenchGhosty@users.noreply.github.com> --- src/invidious.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/invidious.cr b/src/invidious.cr index 4aa8b1fac..c63f9ebb1 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -51,7 +51,7 @@ require "./invidious/jobs/base_job" require "./invidious/jobs/*" # Show a nice message for unsupported versions of the Crystal compiler, -# encouraging the user compiling Invidious, to update it's Crystal compiler +# encouraging the user compiling Invidious to update it``` # version. {% begin %} # `-Dskip_version_check` compile-time flag, for development purposes From 789858486b9b8ee355b22cc3e8bfa56ce7dac78d Mon Sep 17 00:00:00 2001 From: Fijxu Date: Fri, 21 Aug 2026 22:13:22 -0400 Subject: [PATCH 17/19] Update src/invidious.cr Co-authored-by: TheFrenchGhosty <47571719+TheFrenchGhosty@users.noreply.github.com> --- src/invidious.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/invidious.cr b/src/invidious.cr index c63f9ebb1..94d92442d 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -50,7 +50,7 @@ require "./invidious/routes/**" require "./invidious/jobs/base_job" require "./invidious/jobs/*" -# Show a nice message for unsupported versions of the Crystal compiler, +# Show a nice message in case the current Crystal compiler version is unsupoported``` # encouraging the user compiling Invidious to update it``` # version. {% begin %} From 7e70ba2d74b06dc086f2e780c64f868330734633 Mon Sep 17 00:00:00 2001 From: Fijxu Date: Fri, 21 Aug 2026 22:14:08 -0400 Subject: [PATCH 18/19] set min version to 1.14.1 instead --- shard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shard.yml b/shard.yml index 3c5797912..0e62f6f6d 100644 --- a/shard.yml +++ b/shard.yml @@ -40,7 +40,7 @@ development_dependencies: github: crystal-ameba/ameba version: ~> 1.6.1 -crystal: ">= 1.14.0, < 2.0.0" +crystal: ">= 1.14.1, < 2.0.0" license: AGPL-3.0-only From 59dd9c919162402aacf46eeef34d9c4c97bb63be Mon Sep 17 00:00:00 2001 From: Fijxu Date: Fri, 21 Aug 2026 22:21:11 -0400 Subject: [PATCH 19/19] skip version checking if shard.yml file is missing --- src/invidious.cr | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/invidious.cr b/src/invidious.cr index 94d92442d..cc65dde0e 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -58,13 +58,15 @@ require "./invidious/jobs/*" # or weird installations that lack the `shard.yml` file when compiling # Invidious. {% if !flag?(:skip_version_check) %} - {% shard_yml = read_file("shard.yml") %} - {% crystal_constraint = shard_yml.split('\n').find(&.starts_with?("crystal:")) %} - {% minimum_version = crystal_constraint.split('"')[1].split(",").first.split(">=").last.strip %} - {% if compare_versions(Crystal::VERSION, minimum_version) < 0 %} - {{ raise "Crystal version #{minimum_version} or newer is required to build Invidious. \ - You currently have Crystal version #{Crystal::VERSION} installed. \ - We recommend that you install it following the way that the team behind the Crystal compiler itself recommend for your OS, see: https://crystal-lang.org/install/" }} + {% if file_exists?("#{__DIR__}/../shard.yml") %} + {% shard_yml = read_file("#{__DIR__}/../shard.yml") %} + {% crystal_constraint = shard_yml.split('\n').find(&.starts_with?("crystal:")) %} + {% minimum_version = crystal_constraint.split('"')[1].split(",").first.split(">=").last.strip %} + {% if compare_versions(Crystal::VERSION, minimum_version) < 0 %} + {{ raise "Crystal version #{minimum_version} or newer is required to build Invidious. \ + You currently have Crystal version #{Crystal::VERSION} installed. \ + We recommend that you install it following the way that the team behind the Crystal compiler itself recommend for your OS, see: https://crystal-lang.org/install/" }} + {% end %} {% end %} {% end %} {% end %}