-
Notifications
You must be signed in to change notification settings - Fork 37
sdist-ghc is a bit too indiscriminant in copying sources #384
Comments
Aha, left-over object files could perhaps be the reason for you seeing something being built by |
Sounds like it. |
I've been trying to figure out what the Make build system does here, and it appears that it actually cleans the tree first and then simply copies all files. So, Make will also happily copy any files left over after the cleaning. So, I see two approaches:
I've implemented the first approach in the above commit. @bgamari Could you give it a try? Do you think this is a sufficient solution for now? |
@alpmestan @angerman You commented out https://github.com/snowleopard/hadrian/blob/master/src/Rules/SourceDist.hs#L15 Are you sure we no longer need to clean the source tree before creating a source distribution? If yes, I'll simply remove this function (and close this issue). |
I'm not 100% sure. In particular, we probably want to exclude the build root, in case it's somewhere in ghc's source tree (and I quite often do that, I often run hadrian from the root of ghc's source tree, doing something like The "obvious" solution is to instead whitelist top-level files/dirs, hoping that ghc's toplevel structure does not change too often... @snowleopard Maybe I'm overlooking something? |
@alpmestan I'd say that until we are 100% sure, we should keep invoking something like Perhaps the current implementation of |
Hmm, one thing I noticed is that if you have build artifacts in your tree (e.g. from the
make
build system),hadrian
will happily copy these into the source distribution. e.g. a test in a dirty tree that I had laying around gave me this,Ideally we would only take precisely the files that are needed (and never binaries).
The text was updated successfully, but these errors were encountered: