Skip to content

Commit

Permalink
Update to Gleam 1.3.1 (#11)
Browse files Browse the repository at this point in the history
* Bump camino from 1.1.6 to 1.1.7

Bumps [camino](https://github.com/camino-rs/camino) from 1.1.6 to 1.1.7.
- [Release notes](https://github.com/camino-rs/camino/releases)
- [Changelog](https://github.com/camino-rs/camino/blob/main/CHANGELOG.md)
- [Commits](camino-rs/camino@camino-1.1.6...camino-1.1.7)

---
updated-dependencies:
- dependency-name: camino
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump petgraph from 0.6.4 to 0.6.5

Bumps [petgraph](https://github.com/petgraph/petgraph) from 0.6.4 to 0.6.5.
- [Changelog](https://github.com/petgraph/petgraph/blob/master/RELEASES.rst)
- [Commits](https://github.com/petgraph/petgraph/compare/[email protected]@v0.6.5)

---
updated-dependencies:
- dependency-name: petgraph
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump regex from 1.10.4 to 1.10.5

Bumps [regex](https://github.com/rust-lang/regex) from 1.10.4 to 1.10.5.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](rust-lang/regex@1.10.4...1.10.5)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

* fix bug with import cycle detection

* rename

* fix

* v1.3.1

* update cargo hash

---------

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ameen Radwan <[email protected]>
Co-authored-by: Louis Pilfold <[email protected]>
  • Loading branch information
4 people authored Jul 28, 2024
1 parent 596dd60 commit a7e8a68
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 13 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@
### Language Server

### Bug Fixes

## v1.3.1 - 2024-07-10

### Bug Fixes

- Fixes a bug with import cycle detection when there is more than 2 imports in the cycle
([Ameen Radwan](https://github.com/Acepie))
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions compiler-core/src/build/package_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,15 +286,17 @@ where
.enumerate()
.map(|(i, module)| {
// cycles are in order of reference so get next in list or loop back to first
let ind = if i == modules.len() - 1 { 0 } else { i + 1 };
let next = modules.get(ind).expect("next module must exist");
let index_of_imported = if i == 0 { modules.len() - 1 } else { i - 1 };
let imported_module = modules
.get(index_of_imported)
.expect("importing module must exist");
let input = dep_location_map.get(module).expect("dependency must exist");
let location = match input {
Input::New(module) => {
let (_, location) = module
.dependencies
.iter()
.find(|d| &d.0 == next)
.find(|d| &d.0 == imported_module)
.expect("import must exist for there to be a cycle");
ImportCycleLocationDetails {
location: *location,
Expand All @@ -306,7 +308,7 @@ where
let (_, location) = cached_module
.dependencies
.iter()
.find(|d| &d.0 == next)
.find(|d| &d.0 == imported_module)
.expect("import must exist for there to be a cycle");
let src = self
.io
Expand Down
2 changes: 1 addition & 1 deletion nix/glistix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ rustPlatform.buildRustPackage {
buildInputs = [ openssl ] ++
lib.optionals stdenv.isDarwin [ Security SystemConfiguration ];

cargoHash = "sha256-I5oYfY4zcuhDe5WsbWzso+CFafqymOYEmxD4DmV/NOo=";
cargoHash = "sha256-rifIMUYfnmVCaS+OaQ3POEaZj00cU3Biaz2ZKj2eFL4=";

meta = with lib; {
description = "A fork of the Gleam compiler with a Nix backend";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import one
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import one
import three
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@ source: test-package-compiler/src/generated_tests.rs
expression: "./cases/import_cycle_multi"
---
error: Import cycle
┌─ src/two.gleam:1:1
┌─ src/three.gleam:1:1
1import one
^ Imported here
┌─ src/two.gleam:1:1
1import three
^ Imported here
┌─ src/one.gleam:1:1
Expand All @@ -16,6 +21,8 @@ error: Import cycle
The import statements for these modules form a cycle:

┌─────┐
three
│ ↓
two
│ ↓
one
Expand Down

0 comments on commit a7e8a68

Please sign in to comment.