Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gleam export package-interface produces empty modules object #2898

Open
bcpeinhardt opened this issue Apr 5, 2024 · 7 comments · May be fixed by #3669
Open

gleam export package-interface produces empty modules object #2898

bcpeinhardt opened this issue Apr 5, 2024 · 7 comments · May be fixed by #3669
Labels
bug Something isn't working help wanted Contributions encouraged priority:high

Comments

@bcpeinhardt
Copy link
Contributor

When I run gleam export package-interface --out <some_path>.json on any of my packages (tested with simplifile and gsv),
the file produced has an empty object for the modules field as though they were empty packages.

{"name":"gsv","version":"1.4.0","gleam-version-constraint":">= 0.32.0","modules":{}}

I checked the package-interface.json in the build directory and it's being correctly produced, so the module info get's lost somehow exporting the file.

I'm on an M2 Mac running the main branch of Gleam. The logs from after the compile stage are pretty sparse

Compiled in 0.01s
TRACE writing_file path="/Users/benjaminpeinhardt/Development/Projects/gsv/./file.json"
INFO Successfully completed

I'll try and look into this as I bet it's something small or I'm doing something wrong, but if someone beats me to it I won't be upset haha.

@bcpeinhardt bcpeinhardt added the bug Something isn't working label Apr 5, 2024
@PgBiel
Copy link
Contributor

PgBiel commented Apr 6, 2024

Running gleam clean before the export seems to restore the correct behavior for me (once, but not for subsequent runs). It appears to only work if something was compiled.

@lpil
Copy link
Member

lpil commented Apr 6, 2024

@giacomocavalieri am I right in thinking you fixed this? Or did I make that up?

@giacomocavalieri
Copy link
Member

No I haven't (or at least not knowingly)! I should check whether this happens on the main branch as well

@lpil lpil added help wanted Contributions encouraged priority:high labels Apr 6, 2024
@PgBiel
Copy link
Contributor

PgBiel commented Apr 7, 2024

I think it's this TODO here:

/// Compile the package.
/// Returns a list of modules that were compiled. Any modules that were read
/// from the cache will not be returned.
// TODO: return the cached modules.
pub fn compile(

@TanklesXL
Copy link
Contributor

hmmm this was closed as completed but I'm still able to replicate this behaviour on gleam 1.4 🤔 should we reopen this issue?

@TanklesXL
Copy link
Contributor

@lpil sorry to bug you. Just wanted to follow up on what was discussed in discord. This issue is confirmed to be unresolved and should be reopened 😃

@lpil lpil reopened this Aug 14, 2024
@lpil
Copy link
Member

lpil commented Aug 14, 2024

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Contributions encouraged priority:high
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants