gleam
gleam copied to clipboard
Show a helpful error when manifest.toml has been edited to be invalid
I'm doing some merging of branches and got this. I got a merge conflict in the manifest file and just took one branches with the hope of being able to run gleam add.
$ (cd eyg; GLEAM_LOG=trace gleam add glexer)
DEBUG download_deps: locking_build_directory path="/home/peter/Projects/project_wisdom/eyg/build/packages"
TRACE download_deps: reading_file path="/home/peter/Projects/project_wisdom/eyg/gleam.toml"
DEBUG download_deps: reading_manifest_toml
TRACE download_deps: reading_file path="/home/peter/Projects/project_wisdom/eyg/manifest.toml"
DEBUG download_deps: manifest_outdated
Resolving versions
error: Fatal compiler bug!
This is a bug in the Gleam compiler, sorry!
Please report this crash to https://github.com/gleam-lang/gleam/issues/new
and include this error message with your report.
Panic: compiler-core/src/config.rs:276
Package fresh but not in manifest
Gleam version: 1.0.0
Operating system: linux
If you can also share your code and say what file you were editing or any
steps to reproduce the crash that would be a great help.
You may also want to try again with the `GLEAM_LOG=trace` environment
variable set.
p.s. running gleam update first fixed the issue. but I still though worth reporting as the compiler told me too.
Thank you. Let's raise some more useful error message when the manifest has been edited to be invalid.
i can find the location where the code panics but i can't recreate the bug. Can @CrowdHailer pls give the minimal steps on how to recreate the bug in a new project?
unfortunately I'm not able to recreate in a new project.
@CrowdHailer
Can you paste the contents of the manifest.toml and gleam.toml when the error occurs?
He doesn't have them any more and doesn't know how to make it happen again.
You could try removing some of the entries from the manifest perhaps
ok, i'm able to recreate the bug. will make a PR soon.
@lpil here is the PR https://github.com/gleam-lang/gleam/pull/2913