-
Notifications
You must be signed in to change notification settings - Fork 697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support asm/cmm/js sources in executable components (#8639) #9061
Conversation
c9816bc
to
d7f2bde
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Could someone review this PR, please? It would be nice to get it backported to 3.10 to avoid this surprising bug for users trying to use the JS backend in 9.8. Thanks! |
@Mergifyio backport 3.10 |
✅ Backports have been created
|
Thanks @Kleidukos ! |
@mergify rebase |
✅ Branch has been successfully rebased |
975153b
to
eba380e
Compare
Fourmolu is failing for an unrelated reason. A fix is in flight. |
* WIP support asm/cmm/js sources in executable components (#8639) * Factorise extra src code for lib/exe and add extra exe src tests * Add extra sources to linking step * lint * lint * Don't build js sources for executables on non-js hosts * Fix cabal.out for CmmSourcesExe test and lint * Update changelog * Slight changes (cherry picked from commit 3350a6c) # Conflicts: # Cabal/src/Distribution/Simple/GHC.hs
@Kleidukos, @hsyl20, @JoshMeredith: It turns out nobody resolved the conflicts in the backport #9130 and so this is not slated for release in cabal 3.10.2.0, but only in cabal 3.12.1.0 (which we optimistically expect to get released just after 3.10.2.0). Is that a problem? Is there a volunteer for an emergency conflict resolution to squeeze this in into 3.10 one minute before midnight? |
It shouldn't be a problem, we'll just recommend 3.12 for the JS backend. |
In this change, why does dynLinkerOpts not have jsObjs? I suppose we cannot dynamically link jsObjects? @@ -1794,14 +1676,14 @@ gbuild verbosity numJobs pkg_descr lbi bm clbi = do
PD.extraFrameworkDirs bnfo
, ghcOptInputFiles =
toNubListR
- [tmpDir </> x | x <- cLikeObjs ++ cxxObjs]
+ [tmpDir </> x | x <- cLikeObjs ++ cxxObjs ++ jsObjs ++ cmmObjs ++ asmObjs]
}
dynLinkerOpts =
mempty
{ ghcOptRPaths = rpaths
, ghcOptInputFiles =
toNubListR
- [tmpDir </> x | x <- cLikeObjs ++ cxxObjs]
+ [tmpDir </> x | x <- cLikeObjs ++ cxxObjs ++ cmmObjs ++ asmObjs]
}
replOpts =
baseOpts |
@JoshMeredith: a humble ping? @hsyl20: do you perhaps know the answer off the top of you head? |
Implementation for #8639
The code for building each of
c
/cpp
/asm
/cmm
/js
is factorised into a local functionbuildExtraSources
. The local function is separate per library/executable building - i.e. no factorisation between these two stages is attempted.Added tests:
cabal-testsuite/PackageTests/CmmSourcesExe
: based on the siblingCmmSources
test, with the source directories and.cmm
file moved into the executable, and the library removed
cabal-testsuite/PackageTests/JS/JsSourcesExe
: as above for the.js
source.Please include the following checklist in your PR:
Bonus points for added automated tests!