Closed
Description
For dart-lang/native#1962 (comment), I'd need dart pub deps --json
to additionally output a git hash/ref:
{
"packages": [
{
"name": "webcrypto",
"version": "0.5.7",
"kind": "direct",
"source": "git",
"ref": "...",
"dependencies": [
"ffi",
"meta",
"flutter_web_plugins",
"flutter"
],
"directDependencies": [
"ffi",
"meta",
"flutter_web_plugins",
"flutter"
]
},
]
}
Alternatively, we could reverse engineer it from the path in the .package_config.json
, but that means relying on pub internals, which sounds like a bad idea.
Activity
jonasfj commentedon Feb 20, 2025
Why don't you just hardcode the git ref in the pubspec.yaml or even in the
dependencies_override
section.sigurdm commentedon Feb 20, 2025
Also this information is already available in
pubspec.lock
.dcharkes commentedon Feb 20, 2025
It's not me defining the git dependency, it is our users.
However, @jonasfj and I had a long discussion 2 weeks where the conclusion was that we probably want something more declarative for prebuilt binaries, rather than a general system-shared directory to be used arbitrarily in hooks (dart-lang/native#1962 (comment)). And then we wouldn't need the git hash.
We could use the git hash to shortcut hashing all files, but @sigurdm mentioned he'd rather provide an
immutable
bool than exposing whether something ispublished
,git
, orroot
.So, I believe I have no current use cases. Let me close this issue, and reopen it if I come up with one.