Closed maxdeviant closed 3 months ago
I built the compiler from source at 6f9ffa3c0f03c6ff16ed52eb2e508a11bfc0228d with this patch applied:
diff --git a/compiler-cli/src/panic.rs b/compiler-cli/src/panic.rs
index 020ed2bf..9a5bc270 100644
--- a/compiler-cli/src/panic.rs
+++ b/compiler-cli/src/panic.rs
@@ -2,9 +2,9 @@
use std::panic::PanicInfo;
pub fn add_handler() {
- std::panic::set_hook(Box::new(move |info: &PanicInfo<'_>| {
- print_compiler_bug_message(info)
- }));
+ // std::panic::set_hook(Box::new(move |info: &PanicInfo<'_>| {
+ // print_compiler_bug_message(info)
+ // }));
}
fn print_compiler_bug_message(info: &PanicInfo<'_>) {
Running that build of the compiler against my reproduction project using RUST_BACKTRACE=1
produces the following backtrace:
λ RUST_BACKTRACE=1 ~/projects/gleam/target/debug/gleam add wisp
Resolving versions
thread 'main' panicked at /Users/maxdeviant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pubgrub-0.2.1/src/internal/partial_solution.rs:131:25:
add_derivation should not be called after a decision
stack backtrace:
0: std::panicking::begin_panic
at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:686:12
1: pubgrub::internal::partial_solution::PartialSolution<P,V>::add_derivation
at /Users/maxdeviant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pubgrub-0.2.1/src/internal/partial_solution.rs:131:25
2: pubgrub::internal::core::State<P,V>::unit_propagation
at /Users/maxdeviant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pubgrub-0.2.1/src/internal/core.rs:124:25
3: pubgrub::solver::resolve
at /Users/maxdeviant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pubgrub-0.2.1/src/solver.rs:95:9
4: gleam_core::dependency::resolve_versions
at /Users/maxdeviant/projects/gleam/compiler-core/src/dependency.rs:56:20
5: gleam::dependencies::resolve_versions
at /Users/maxdeviant/projects/gleam/compiler-cli/src/dependencies.rs:709:20
6: gleam::dependencies::get_manifest
at /Users/maxdeviant/projects/gleam/compiler-cli/src/dependencies.rs:520:24
7: gleam::dependencies::download
at /Users/maxdeviant/projects/gleam/compiler-cli/src/dependencies.rs:164:40
8: gleam::add::command
at /Users/maxdeviant/projects/gleam/compiler-cli/src/add.rs:15:20
9: gleam::main
at /Users/maxdeviant/projects/gleam/compiler-cli/src/main.rs:495:43
10: core::ops::function::FnOnce::call_once
at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
I was able to reproduce the issue in a standalone Rust project using pubgrub
directly and have opened an issue with them: https://github.com/pubgrub-rs/pubgrub/issues/222.
My reproduction is available here.
I am able to consistently reproduce a fatal compiler bug when using
gleam add
in certain projects:I have an example project that reproduces this issue.
Reproduction Steps
This is the minimal set of steps I've found to reproduce the issue in a brand new project:
gleam new my_project
gleam remove gleeunit
gleam add --dev startest
gleam add wisp
💥I was initially seeing this in Gleam v1.1.0, but I am also able to reproduce on the latest
main
(6f9ffa3c0f03c6ff16ed52eb2e508a11bfc0228d).Related Issues
It's very possible these might all be the same issue.