Comments (4)
Not sure what exactly happen, but this change did solve the transitive dependency issue at least in my project
gleam-lang/mix_gleam#39
from gleam.
So, I have never written a line of Rust in my life, but I'm trying to follow what exactly causes this to happen, and think in general terms of a solution.
analyse::record_imported_items_for_use_detection
emits the warning if !direct_dependencies.contains_key(&module_info.package)
(and other conditions). I presume that if dependencies from mix.exs
make their way into this direct_dependencies
HashMap argument, the issue will be solved; I would like y'all's opinion on whether this is indeed the case and a desirable solution.
I tried to figure out how the dependencies from gleam.toml
make their way to this direct_dependencies
thingy. Here's the path of function calls I could identify:
- analyse::record_imported_items_for_use_detection
- analyse::infer_module
- package_compiler::analyse (where dev dependencies are included if needed)
- package_config.dependencies_for
- package_compiler.compile
- package_compiler.new (as that creates the config struct with the deps)
Here it branches into two paths, each reaching two very similar functions:
- project_compiler.compile_gleam_package
- project_compiler.compile_gleam_dep_package
- package_config.read
-or-
- compile_package::command
- config::read
Both these read
functions parse TOML. ProjectCompiler also has a compile_mix_dep_package
method, which I don't know if it is related.
So, a few questions:
1 - should there really be these two almost identical read
functions?
2 - how can they be modified to include dependencies from mix.exs
so the transitive deps warning goes away?
3 - is this all anywhere near correct?
from gleam.
As Tynan says the solution is to have the gleam compile-package
API not emit that warning ever, so it just needs to set some extra configuration on the package compiler which is passed to the analyser.
from gleam.
Yeah, that seems more complicated than I can do with zero Rust knowledge.
from gleam.
Related Issues (20)
- gleam add with multiple dependencies HOT 2
- LSP crash in exhaustiveness checker HOT 3
- LSP code action: remove all unused imported types and values
- LSP code action: import module HOT 6
- LSP: rename custom type variant HOT 1
- Allow `gleam add` to take a version specifier HOT 1
- Markdown support in the `@deprecated` message. HOT 1
- `gleam deps why packagename` command to explain requirements for package version HOT 1
- Unable to refetch a release when release is replaced on hex HOT 1
- LSP module auto-import: handle module name collisions
- Convert LS completion tests to use snapshots HOT 2
- LSP: When auto adding import, if it's the first import, a blank line should follow it HOT 2
- Compiler crash when checking exhaustiveness against duplicate type constructors HOT 4
- Surface diagnostic errors for import cycles HOT 7
- Horizontal scrolling in code blocks in built docs for lines 79-80 characters long HOT 2
- `gleam remove` always reports a removal, even if the package did not exist in `gleam.toml` HOT 3
- Add `gleam/set.{map}` HOT 1
- Say "I was not expecting this keyword" in error when there is an unexpected keyword HOT 4
- Bit array int & float options on JavaScript HOT 1
- Compiler panics when a custom type variant doesn't exist HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gleam.