Skip to content
Open
Show file tree
Hide file tree
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
Clean up
  • Loading branch information
drathier committed Aug 17, 2022
commit 8e02b7e2422dd2a7a5c845ed5f36536357fc8faf
26 changes: 8 additions & 18 deletions src/Language/PureScript/Externs.hs
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,8 @@ data ExternCacheKey =

instance Serialise ExternCacheKey

extDeclToCacheKey :: Environment -> M.Map Text ([(Text, Maybe (Type ()))], Type ()) -> ExternsDeclaration -> ExternCacheKey
extDeclToCacheKey env _decls = \case
extDeclToCacheKey :: M.Map Text ([(Text, Maybe (Type ()))], Type ()) -> ExternsDeclaration -> ExternCacheKey
extDeclToCacheKey _decls = \case
EDType
edTypeName -- :: ProperName 'TypeName
edTypeKind -- :: Type ()
Expand Down Expand Up @@ -467,9 +467,9 @@ moduleToExternsFile externsMap (Module ss _ mn ds (Just exps)) env renamedIdents
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 (kind, TypeSynonym)) <- Qualified (Just mn) tn `M.lookup` types env = [tn]
f (TypeRef _ tn _) | (Just (_, TypeSynonym)) <- Qualified (Just mn) tn `M.lookup` types env = [tn]
-- data types with no public ctors are opaque to all other modules, so no need to expose its internal shapes
f (TypeRef _ tn (Just [])) = []
f (TypeRef _ _ (Just [])) = []
-- if there are exposed ctors, expose the types shape
f (TypeRef _ tn _) = [tn]
f (ValueRef _ _) = []
Expand All @@ -483,20 +483,20 @@ moduleToExternsFile externsMap (Module ss _ mn ds (Just exps)) env renamedIdents
bcDeclShapes :: M.Map (ProperName 'TypeName) (CacheShape, CacheTypeDetails)
bcDeclShapes =
M.intersection bcDeclShapesAll expsTypeNames
& (\v -> trace ("bcDeclShapes:" <> sShow (mn, exps, v)) v)
-- & (\v -> trace ("bcDeclShapes:" <> sShow (mn, exps, v)) v)


bcDeclShapesAll :: M.Map (ProperName 'TypeName) (CacheShape, CacheTypeDetails)
bcDeclShapesAll =
ds
& concatMap declToCacheShape
& M.fromList
& M.mapWithKey (\tipe (cs, cts) ->
& M.map (\(cs, cts) ->
( cs
, cts
& M.mapWithKey (\k () ->
case k of
Qualified Nothing tn ->
Qualified Nothing _ ->
internalError "dsCacheShapesWithDetails: missing module name"

Qualified (Just km@(ModuleName kmn)) tn | "Prim" `T.isPrefixOf` kmn -> (PrimType km tn, CacheTypeDetails mempty)
Expand Down Expand Up @@ -525,12 +525,6 @@ moduleToExternsFile externsMap (Module ss _ mn ds (Just exps)) env renamedIdents
bcCacheBlob :: B.ByteString
(bcCacheDecls, bcCacheBlob) =
let
-- !_ = trace (T.unpack $ "declToCacheShape:" <> T.intercalate "\ndeclToCacheShape:" ((\v -> T.pack $ show (v, runState (declToCacheShape v) mempty)) <$> ds)) ()

dsCacheShapes :: M.Map (ProperName 'TypeName) (CacheShape, CacheTypeState)
dsCacheShapes = M.fromList $ concatMap declToCacheShape ds


bshow a = BLU.fromString ("[" <> show a <> "]")

_ = (serialise :: Int -> B.ByteString)
Expand All @@ -540,7 +534,7 @@ moduleToExternsFile externsMap (Module ss _ mn ds (Just exps)) env renamedIdents

cacheDecls :: M.Map DeclarationRef B.ByteString
cacheDecls =
M.fromList $ fmap (\(k,v) -> (k, foldCache (extDeclToCacheKey env bcDeclarations <$> v))) $ filter (\(k, _) -> elem k efExports) bcCacheDeclarationsPre
M.fromList $ fmap (\(k,v) -> (k, foldCache (extDeclToCacheKey bcDeclarations <$> v))) $ filter (\(k, _) -> elem k efExports) bcCacheDeclarationsPre

-- cacheDecls2 =
-- foldr
Expand Down Expand Up @@ -752,10 +746,6 @@ instance Serialise CacheTypeDetails

type CacheTypeState = M.Map (Qualified (ProperName 'TypeName)) ()

typeToCacheType :: Type a -> (Type (), CacheTypeState)
typeToCacheType t =
runState (typeToCacheTypeImpl t) mempty

typeToCacheTypeImpl :: Type a -> State CacheTypeState (Type ())
typeToCacheTypeImpl t = case t of
TUnknown _ a -> pure $ TUnknown () a
Expand Down
2 changes: 1 addition & 1 deletion src/Language/PureScript/Make/Actions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ data ProgressMessage

-- | Render a progress message
renderProgressMessage :: ProgressMessage -> T.Text
renderProgressMessage (CompilingModule mn) = T.append "CompilingX3 " (runModuleName mn)
renderProgressMessage (CompilingModule mn) = T.append "CompilingX4 " (runModuleName mn)

-- | Actions that require implementations when running in "make" mode.
--
Expand Down