- let satisfied = toTable[package.PackageReference, syncinstall.SatisfyResult] (pkgInfos.map(p => ((p.name, none(string), none(VersionConstraint)),
(false, p.name, some(p)))))
testtable2 = initTablepackage.PackageReference, syncinstall.SatisfyResult
testtable2 = satisfied
This does not work!!! It didn't work without the 1024 either, I've been trying various random stuff. I don't know much Nim but it looks like it should work. That's basically what the original code does but it gives satisfied to a proc argument of that type instead. Sorry I don't really know how to explain this more concisely as the types and values are part of a larger app, and you need to have an AUR package in need of updating for 'satisfied' to contain a value, but it still fails when empty. It isn't that big really though and builds quickly.
Any ideas for a simple fix? I could possibly make it not be a table and put the info in something like my testing seq [WrapperTuple] but that would mean altering all the other places it gets used too.
The pakku author kitsunyan is (wisely? :) ) AWOL at present. This is the most up to date source: https://github.com/brunomiguel/pakku
$ nim -V Nim Compiler Version 1.0.4 [Linux: amd64] Compiled at 2019-11-27 Copyright (c) 2006-2019 by Andreas Rumpf
active boot switches: -d:release -d:nativeStackTrace
Extract from modified src/feature/syncinstall.nim #[
]
]
]# # let satisfied = pkgInfos.map(p => ((p.name, none(string), none(VersionConstraint)), # (false, p.name, some(p)))).toTable
- let satisfied = toTable[package.PackageReference, syncinstall.SatisfyResult] (pkgInfos.map(p => ((p.name, none(string), none(VersionConstraint)),
- (false, p.name, some(p)))))
let unsatisfied = lc[x | (i <- pkgInfos, x <- i.allDepends), PackageReference].deduplicate
var
#Error: type mismatch: got <Table[tuple of (string, Option[system.string], Option[package.VersionConstraint]), tuple of (bool, string, Option[package.PackageInfo])]>
testnewseq1 = pkgInfos.map(p => ((p.name, none(string), none(VersionConstraint)), (false, p.name, some(p)))) echo "testnewseq1 =n", testnewseq1 echo "satisfied =n", satisfied
#Error: type mismatch: got <seq[tuple of (tuple of (string, Option[system.string], Option[package.VersionConstraint]), tuple of (bool, string, Option[package.PackageInfo]))]> # but expected 'seq[SatisfyResult]'
#[ No it didn't. resolving dependencies... testnewseq1 = @[(packref: subtitleripper, satres: (installed: false, name: "subtitleripper", buildPkgInfo: Some((baseIndex: 0, baseCount: 1, archs: @["x86_64"], url: Some("http://subtitlerippe r.sourceforge.net/"), licenses: @["GPL"], groups: @[], pgpKeys: @[], depends: @[netpbm], makeDepends: @[make, gcc], checkDepends: @[], optional: @[], provides: @[], conflicts: @[ ], replaces: @[], repo: "aur", base: "subtitleripper", name: "subtitleripper", version: "0.5.2-2", description: Some("DVD subtitle to text converter"), maintainer: Some("init"), firstSubmitted: Some(1484683508), lastModified: Some(1574810177), outOfDate: None[int64], votes: 3, popularity: 0.382473, gitUrl: "https://aur.archlinux.org/subtitleripper.git", gitSubdir: None[TaintedString]))))] satisfied = {subtitleripper: (installed: false, name: "subtitleripper", buildPkgInfo: Some((baseIndex: 0, baseCount: 1, archs: @["x86_64"], url: Some("http://subtitleripper.sourceforge.net/" ), licenses: @["GPL"], groups: @[], pgpKeys: @[], depends: @[netpbm], makeDepends: @[make, gcc], checkDepends: @[], optional: @[], provides: @[], conflicts: @[], replaces: @[], r epo: "aur", base: "subtitleripper", name: "subtitleripper", version: "0.5.2-2", description: Some("DVD subtitle to text converter"), maintainer: Some("init"), firstSubmitted: Som e(1484683508), lastModified: Some(1574810177), outOfDate: None[int64], votes: 3, popularity: 0.382473, gitUrl: "https://aur.archlinux.org/subtitleripper.git", gitSubdir: None[Tai ntedString])))} testtable2 assignment
Error: unhandled exception: invalid object assignment [ObjectAssignmentError] ]*
- findDependencies(config, handle, dbs, satisfied, unsatisfied, @[],
- additionalPkgInfos, @[], nodepsCount, assumeInstalled, printMode, noaur)
my diff of brunomiguel's fork to make pakku build OK: https://yadi.sk/d/YShVi29cWcPzqQ
diff of my modified with test code src/feature/syncinstall.nim https://yadi.sk/d/ajv_r4yyLt3CFQ