Skip to content
Open
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
7fc82a2
Add more context to BuildJobs
drathier May 26, 2022
45d0e40
Second level caching seems to work
drathier May 26, 2022
ea9d863
First level caching works, but we're destroying all SourcePos in the …
drathier May 26, 2022
f2ce6dc
Clean up debug prints
drathier May 26, 2022
390c9f2
Merge branch 'release-0.14.5' into more-aggressive-dirty-module-checking
drathier May 30, 2022
84bd281
Cache imports and exports and compare shapes
drathier Jul 24, 2022
6d038b8
Simplify caching. Remove post-compile caching layer. Clean up unused …
drathier Jul 24, 2022
fa217d2
Remove unused type class instances
drathier Jul 24, 2022
316ad09
Revert SourcePos=0 hack
drathier Jul 24, 2022
74689c8
Drop unused imports
drathier Jul 24, 2022
4680cee
Restore explicit exports for BuildPlan. Clean up.
drathier Jul 24, 2022
8807b61
Clean up.
drathier Jul 24, 2022
b096578
Combine caches into a single ByteString per module. Add the other ext…
drathier Jul 24, 2022
420abd3
Fix warnings.
drathier Jul 25, 2022
6ef5586
Run CI all the time
drathier Jul 25, 2022
39f4a82
Update tests
drathier Jul 25, 2022
e9b1dcb
Update tests; caching works better now
drathier Jul 25, 2022
a97897b
Update tests; caching works better now
drathier Jul 25, 2022
333e9ef
Ignore failed ci; make it build.
drathier Jul 25, 2022
abaf06a
Disable lint ci
drathier Jul 25, 2022
818b5a5
Trigger CI on published release
drathier Jul 25, 2022
8c84d67
Comment out debug prints. Debug print on invalid or missing cbor exte…
drathier Aug 6, 2022
249883f
Don't invalidate cache just because a dependency failed to build; the…
drathier Aug 7, 2022
b604a2b
Make build cache easier to read
drathier Aug 12, 2022
0c41cec
Make build cache easier to read
drathier Aug 12, 2022
28bea69
Transitively track the shapes of all type aliases and data types, so …
drathier Aug 17, 2022
8e02b7e
Clean up
drathier Aug 17, 2022
0650c47
Make tests build
drathier Aug 17, 2022
43c8844
Add empty docs
drathier Aug 17, 2022
41121ba
Remove accidental doc
drathier Aug 17, 2022
cdfca37
Be more careful when figuring out what shapes to expose
drathier Aug 17, 2022
b78a009
Handle re-exports.
drathier Aug 17, 2022
f262fa5
Handle Prim modules in re-exports.
drathier Aug 17, 2022
32c348e
Comment out trace
drathier Aug 17, 2022
8c6cd7a
Merge remote-tracking branch 'upstream/master' into more-aggressive-d…
drathier Oct 3, 2022
8dc25d4
Merge in upstream master
drathier Oct 3, 2022
ac195f6
Try an older haskell docker image on ubuntu
drathier Oct 3, 2022
07e90f4
Move X5 tag
drathier Oct 7, 2022
5454476
Merge remote-tracking branch 'upstream/master' into more-aggressive-d…
drathier Oct 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Be more careful when figuring out what shapes to expose
  • Loading branch information
drathier committed Aug 17, 2022
commit cdfca37909761651f44630c9dee86902df75945a
28 changes: 18 additions & 10 deletions src/Language/PureScript/Externs.hs
Original file line number Diff line number Diff line change
Expand Up @@ -460,30 +460,38 @@ moduleToExternsFile externsMap (Module ss _ mn ds (Just exps)) env renamedIdents
bcDeclarations = M.fromList $ concatMap typeDeclForCache ds
efBuildCache = BuildCacheFile efVersion efModuleName bcCacheBlob bcCacheDecls bcDeclarations bcDeclShapes bcCacheImports

expsTypeNames :: M.Map (ProperName 'TypeName) ()
expsTypeNames :: M.Map (ProperName 'TypeName) Bool
expsTypeNames =
-- ASSUMPTION[drathier]: no exposed constructors? then other modules cannot possibly care about the internal shape of this data type, since cross-module inlining isn't a thing
let
f (TypeClassRef _ _) = []
f (TypeOpRef _ _) = []
-- ASSUMPTION[drathier]: no exposed constructors? then we cannot possibly care about the shape of the data in other modules, since cross-module inlining isn't a thing
-- type synonyms don't have ctors but should still be left in
f (TypeRef _ tn _) | (Just (_, TypeSynonym)) <- Qualified (Just mn) tn `M.lookup` types env = [tn]
-- type synonyms don't have ctors in ast but do effectively have a single exposed ctor, so keep it in
f (TypeRef _ tn _) | (Just (_, TypeSynonym)) <- Qualified (Just mn) tn `M.lookup` types env = [(tn, True)]
-- data types with no public ctors are opaque to all other modules, so no need to expose its internal shapes
f (TypeRef _ _ (Just [])) = []
-- if there are exposed ctors, expose the types shape
f (TypeRef _ tn _) = [tn]
f (TypeRef _ tn (Just [])) = [(tn, False)]
-- if there are any exposed ctors, expose the type shape
f (TypeRef _ tn _) = [(tn, True)]
f (ValueRef _ _) = []
f (ValueOpRef _ _) = []
f (TypeInstanceRef _ _ _) = []
f (ModuleRef _ _) = []
f (ReExportRef _ _ _) = []
in
M.fromList $ (,()) <$> concatMap f exps
M.fromList $ concatMap f exps

bcDeclShapes :: M.Map (ProperName 'TypeName) (CacheShape, CacheTypeDetails)
bcDeclShapes =
M.intersection bcDeclShapesAll expsTypeNames
-- & (\v -> trace ("bcDeclShapes:" <> sShow (mn, exps, v)) v)
M.intersectionWith
(\(cs, ctd) shouldShowInternals ->
if shouldShowInternals then
(cs, ctd)
else
(cs, CacheTypeDetails mempty)
)
bcDeclShapesAll
expsTypeNames
& (\v -> trace ("bcDeclShapes:" <> sShow (mn, exps, v)) v)


bcDeclShapesAll :: M.Map (ProperName 'TypeName) (CacheShape, CacheTypeDetails)
Expand Down