Skip to content

Commit b5a8ab9

Browse files
authored
Fix upgrade command to pull the registry before looking up the latest set (#1214)
1 parent bf83c81 commit b5a8ab9

File tree

5 files changed

+55
-41
lines changed

5 files changed

+55
-41
lines changed

spago.lock

Lines changed: 41 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ workspace:
285285
- contravariant
286286
- control
287287
- datetime
288-
- debug
289288
- distributive
290289
- docs-search-common
291290
- effect
@@ -424,7 +423,6 @@ workspace:
424423
- control
425424
- convertable-options
426425
- datetime
427-
- debug
428426
- distributive
429427
- docs-search-common
430428
- docs-search-index
@@ -571,7 +569,6 @@ workspace:
571569
- control
572570
- convertable-options
573571
- datetime
574-
- debug
575572
- distributive
576573
- docs-search-common
577574
- docs-search-index
@@ -801,8 +798,8 @@ workspace:
801798
- variant
802799
package_set:
803800
address:
804-
registry: 47.9.1
805-
compiler: ">=0.15.13 <0.16.0"
801+
registry: 50.8.0
802+
compiler: ">=0.15.15 <0.16.0"
806803
content:
807804
abc-parser: 2.0.1
808805
ace: 9.1.0
@@ -829,7 +826,7 @@ workspace:
829826
arraybuffer-builder: 3.1.0
830827
arraybuffer-types: 3.0.2
831828
arrays: 7.3.0
832-
arrays-extra: 0.4.4
829+
arrays-extra: 0.6.1
833830
arrays-zipper: 2.0.1
834831
ask: 1.0.0
835832
assert: 6.0.0
@@ -855,6 +852,7 @@ workspace:
855852
chameleon-transformers: 1.0.0
856853
channel: 1.0.0
857854
checked-exceptions: 3.1.1
855+
choku: 1.0.1
858856
classless: 0.1.1
859857
classless-arbitrary: 0.1.1
860858
classless-decode-json: 0.1.1
@@ -895,13 +893,13 @@ workspace:
895893
echarts-simple: 0.0.1
896894
effect: 4.0.0
897895
either: 6.1.0
898-
elmish: 0.10.0
896+
elmish: 0.11.3
899897
elmish-enzyme: 0.1.1
900898
elmish-hooks: 0.10.0
901-
elmish-html: 0.8.1
902-
elmish-testing-library: 0.3.1
899+
elmish-html: 0.8.2
900+
elmish-testing-library: 0.3.2
903901
email-validate: 7.0.0
904-
encoding: 0.0.8
902+
encoding: 0.0.9
905903
enums: 6.0.1
906904
env-names: 0.3.4
907905
error: 2.0.0
@@ -917,6 +915,8 @@ workspace:
917915
fetch-argonaut: 1.0.1
918916
fetch-core: 5.1.0
919917
fetch-yoga-json: 1.1.0
918+
ffi-simple: 0.5.1
919+
fft-js: 0.1.0
920920
filterable: 5.0.0
921921
fix-functor: 0.1.0
922922
fixed-points: 7.0.0
@@ -925,6 +925,7 @@ workspace:
925925
float32: 2.0.0
926926
fmt: 0.2.1
927927
foldable-traversable: 6.0.0
928+
foldable-traversable-extra: 0.0.6
928929
foreign: 7.0.0
929930
foreign-object: 4.1.0
930931
foreign-readwrite: 3.4.0
@@ -946,26 +947,30 @@ workspace:
946947
generic-router: 0.0.1
947948
geojson: 0.0.5
948949
geometry-plane: 1.0.3
950+
gojs: 0.1.1
949951
grain: 3.0.0
950952
grain-router: 3.0.0
951953
grain-virtualized: 3.0.0
952954
graphs: 8.1.0
953955
group: 4.1.1
954956
halogen: 7.0.0
955-
halogen-bootstrap5: 2.3.1
957+
halogen-bootstrap5: 5.3.2
958+
halogen-canvas: 1.0.0
956959
halogen-css: 10.0.0
957960
halogen-echarts-simple: 0.0.4
958961
halogen-formless: 4.0.3
959962
halogen-helix: 1.0.0
960963
halogen-hooks: 0.6.3
961964
halogen-hooks-extra: 0.9.0
965+
halogen-infinite-scroll: 1.1.0
962966
halogen-store: 0.5.4
963967
halogen-storybook: 2.0.0
964968
halogen-subscriptions: 2.0.0
965969
halogen-svg-elems: 8.0.0
966970
halogen-typewriter: 1.0.4
967971
halogen-vdom: 8.0.0
968972
halogen-vdom-string-renderer: 0.5.0
973+
halogen-xterm: 2.0.0
969974
heckin: 2.0.1
970975
heterogeneous: 0.6.0
971976
homogeneous: 0.4.0
@@ -980,6 +985,7 @@ workspace:
980985
int64: 3.0.0
981986
integers: 6.0.0
982987
interpolate: 5.0.2
988+
intersection-observer: 1.0.1
983989
invariant: 6.0.0
984990
jarilo: 1.0.1
985991
jelly: 0.10.0
@@ -1003,10 +1009,12 @@ workspace:
10031009
justifill: 0.5.0
10041010
jwt: 0.0.9
10051011
labeled-data: 0.2.0
1012+
language-cst-parser: 0.14.0
10061013
lazy: 6.0.0
10071014
lazy-joe: 1.0.0
10081015
lcg: 4.0.0
10091016
leibniz: 5.0.0
1017+
leveldb: 1.0.1
10101018
liminal: 1.0.1
10111019
linalg: 6.0.0
10121020
lists: 7.0.0
@@ -1081,7 +1089,7 @@ workspace:
10811089
open-pairing: 6.1.0
10821090
options: 7.0.0
10831091
optparse: 5.0.1
1084-
ordered-collections: 3.1.1
1092+
ordered-collections: 3.2.0
10851093
ordered-set: 0.4.0
10861094
orders: 6.0.0
10871095
owoify: 1.2.0
@@ -1101,15 +1109,17 @@ workspace:
11011109
pointed-list: 0.5.1
11021110
polymorphic-vectors: 4.0.0
11031111
posix-types: 6.0.0
1112+
postgresql: 1.3.0
11041113
precise: 6.0.0
11051114
precise-datetime: 7.0.0
11061115
prelude: 6.0.1
11071116
prettier-printer: 3.0.0
1108-
profunctor: 6.0.0
1117+
profunctor: 6.0.1
11091118
profunctor-lenses: 8.0.0
11101119
protobuf: 4.3.0
11111120
psa-utils: 8.0.0
11121121
psci-support: 6.0.0
1122+
punycode: 1.0.0
11131123
qualified-do: 2.2.0
11141124
quantities: 12.2.0
11151125
quickcheck: 8.0.1
@@ -1130,7 +1140,7 @@ workspace:
11301140
react-basic-storybook: 2.0.0
11311141
react-dom: 8.0.0
11321142
react-halo: 3.0.0
1133-
react-icons: 1.1.2
1143+
react-icons: 1.1.4
11341144
react-markdown: 0.1.0
11351145
react-testing-library: 4.0.1
11361146
react-virtuoso: 1.0.0
@@ -1141,13 +1151,15 @@ workspace:
11411151
record-ptional-fields: 0.1.2
11421152
record-studio: 1.0.4
11431153
refs: 6.0.0
1144-
remotedata: 5.0.0
1154+
remotedata: 5.0.1
1155+
resize-observer: 1.0.0
11451156
resource: 2.0.1
11461157
resourcet: 1.0.0
11471158
result: 1.0.3
11481159
return: 0.2.0
11491160
ring-modules: 5.0.1
11501161
rito: 0.3.4
1162+
rough-notation: 1.0.2
11511163
routing: 11.0.0
11521164
routing-duplex: 0.7.0
11531165
run: 5.0.0
@@ -1169,8 +1181,8 @@ workspace:
11691181
soundfonts: 4.1.0
11701182
sparse-matrices: 1.3.0
11711183
sparse-polynomials: 2.0.5
1172-
spec: 7.5.5
1173-
spec-mocha: 5.0.0
1184+
spec: 7.6.0
1185+
spec-mocha: 5.1.0
11741186
spec-quickcheck: 5.0.0
11751187
splitmix: 2.1.0
11761188
ssrs: 1.0.0
@@ -1216,7 +1228,7 @@ workspace:
12161228
unicode: 6.0.0
12171229
unique: 0.6.1
12181230
unlift: 1.0.1
1219-
unordered-collections: 3.0.1
1231+
unordered-collections: 3.1.0
12201232
unsafe-coerce: 6.0.0
12211233
unsafe-reference: 5.0.0
12221234
untagged-to-tagged: 0.1.4
@@ -1259,12 +1271,14 @@ workspace:
12591271
webextension-polyfill: 0.1.0
12601272
webgpu: 0.0.1
12611273
which: 2.0.0
1274+
xterm: 1.0.0
12621275
yoga-fetch: 1.0.1
12631276
yoga-json: 5.1.0
12641277
yoga-om: 0.1.0
12651278
yoga-postgres: 6.0.0
12661279
yoga-tree: 1.0.0
12671280
z3: 0.0.2
1281+
zipperarray: 2.0.0
12681282
extra_packages:
12691283
dodo-printer:
12701284
git: https://github.com/natefaubion/purescript-dodo-printer.git
@@ -1760,13 +1774,6 @@ packages:
17601774
- partial
17611775
- prelude
17621776
- tuples
1763-
debug:
1764-
type: registry
1765-
version: 6.0.2
1766-
integrity: sha256-vmkYFuXYuELBzeauvgHG6E6Kf/Hp1dAnxwE9ByHfwSg=
1767-
dependencies:
1768-
- functions
1769-
- prelude
17701777
distributive:
17711778
type: registry
17721779
version: 6.0.0
@@ -1829,10 +1836,11 @@ packages:
18291836
- prelude
18301837
encoding:
18311838
type: registry
1832-
version: 0.0.8
1833-
integrity: sha256-n0HhENAax0yr7JFwZXcisx0jJvVf1dFwqd+Q5i2Pr88=
1839+
version: 0.0.9
1840+
integrity: sha256-vtyUO06Jww8pFl4wRekPd1YpJl2XuQXcaNXQgHtG8Tk=
18341841
dependencies:
18351842
- arraybuffer-types
1843+
- effect
18361844
- either
18371845
- exceptions
18381846
- functions
@@ -2679,8 +2687,8 @@ packages:
26792687
- tuples
26802688
ordered-collections:
26812689
type: registry
2682-
version: 3.1.1
2683-
integrity: sha256-boSYHmlz4aSbwsNN4VxiwCStc0t+y1F7BXmBS+1JNtI=
2690+
version: 3.2.0
2691+
integrity: sha256-o9jqsj5rpJmMdoe/zyufWHFjYYFTTsJpgcuCnqCO6PM=
26842692
dependencies:
26852693
- arrays
26862694
- foldable-traversable
@@ -2777,8 +2785,8 @@ packages:
27772785
dependencies: []
27782786
profunctor:
27792787
type: registry
2780-
version: 6.0.0
2781-
integrity: sha256-99NzxFgTr4CGlCSRYG1kShL+JhYbihhHtbOk1/0R5zI=
2788+
version: 6.0.1
2789+
integrity: sha256-E58hSYdJvF2Qjf9dnWLPlJKh2Z2fLfFLkQoYi16vsFk=
27822790
dependencies:
27832791
- control
27842792
- distributive
@@ -3003,8 +3011,8 @@ packages:
30033011
- prelude
30043012
spec:
30053013
type: registry
3006-
version: 7.5.5
3007-
integrity: sha256-HdyBH7Ys1/m2SdTq3u2u9LdQ4cGeaohWeEMYay2mHdU=
3014+
version: 7.6.0
3015+
integrity: sha256-+merGdQbL9zWONbnt8S8J9afGJ59MQqGtS0qSd3yu4I=
30083016
dependencies:
30093017
- aff
30103018
- ansi
@@ -3013,7 +3021,6 @@ packages:
30133021
- bifunctors
30143022
- control
30153023
- datetime
3016-
- debug
30173024
- effect
30183025
- either
30193026
- exceptions

spago.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ package:
6161
- spec
6262
workspace:
6363
packageSet:
64-
registry: 47.9.1
64+
registry: 50.8.0
6565
extraPackages:
6666
registry-lib:
6767
git: https://github.com/purescript/registry-dev.git

src/Spago/Command/Upgrade.purs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@ import Spago.Db as Db
1010

1111
run :: forall a. Spago (FetchEnv a) Unit
1212
run = do
13-
{ workspace, db, purs } <- ask
13+
{ workspace, db, purs, getRegistry, logOptions, git, offline } <- ask
1414
case workspace.workspaceConfig.packageSet of
1515
Just (Core.SetFromRegistry { registry }) -> do
16+
-- We are going to read from the database, but we have no guarantee it's up to date,
17+
-- so we need to pull a fresh registry first - calling the `getRegistry` is enough,
18+
-- since that will populate the db with the missing stuff
19+
_ <- runSpago { logOptions, db, git, purs, offline } getRegistry
1620
maybeLatestPackageSet <- liftEffect $ Db.selectLatestPackageSetByCompiler db purs.version
1721
case maybeLatestPackageSet of
1822
Nothing -> die "No package set found for the current compiler version."

src/Spago/Config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export function addRangesToConfigImpl(doc, rangesMap) {
9797
}
9898

9999
export function setPackageSetVersionInConfigImpl(doc, version) {
100-
doc.setIn(["workspace", "package_set", "registry"], version);
100+
doc.setIn(["workspace", "packageSet", "registry"], version);
101101
}
102102

103103
export function migrateV1ConfigImpl(doc) {

src/Spago/Config.purs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,11 @@ readWorkspace { maybeSelectedPackage, pureBuild, migrateConfig } = do
344344
-- If there's a lockfile we don't attempt to fetch the package set from the registry
345345
-- repo nor from the internet, since we already have the whole set right there
346346
Right lockfile, _ -> do
347-
logDebug "Found lockfile, using the package set from there"
347+
logDebug "Found the lockfile, using the package set from there"
348348
pure lockfile.workspace.package_set
349349

350-
Left _, Just address@(Core.SetFromRegistry { registry: v }) -> do
350+
Left reason, Just address@(Core.SetFromRegistry { registry: v }) -> do
351+
logDebug reason
351352
logDebug "Reading the package set from the Registry repo..."
352353
(Registry.PackageSet.PackageSet registryPackageSet) <- Registry.readPackageSet v
353354
logDebug "Read the package set from the Registry repo"
@@ -357,7 +358,8 @@ readWorkspace { maybeSelectedPackage, pureBuild, migrateConfig } = do
357358
, compiler: Range.caret registryPackageSet.compiler
358359
}
359360

360-
Left _, Just address@(Core.SetFromPath { path }) -> do
361+
Left reason, Just address@(Core.SetFromPath { path }) -> do
362+
logDebug reason
361363
logDebug $ "Reading the package set from local path: " <> path
362364
liftAff (FS.readJsonFile remotePackageSetCodec path) >>= case _ of
363365
Left err -> die $ "Couldn't read the package set: " <> err
@@ -369,10 +371,11 @@ readWorkspace { maybeSelectedPackage, pureBuild, migrateConfig } = do
369371
, compiler: Range.caret localPackageSet.compiler
370372
}
371373

372-
Left _, Just address@(Core.SetFromUrl { url: rawUrl }) -> do
374+
Left reason, Just address@(Core.SetFromUrl { url: rawUrl }) -> do
373375
result <- case offline of
374376
Offline -> die "You are offline, but the package set is not cached locally. Please connect to the internet and try again."
375377
Online -> do
378+
logDebug reason
376379
logDebug $ "Reading the package set from URL: " <> rawUrl
377380
url <- case parseUrl rawUrl of
378381
Left err -> die $ "Could not parse URL for the package set, error: " <> show err

0 commit comments

Comments
 (0)