-
Notifications
You must be signed in to change notification settings - Fork 37
Fix dynamic way #4
Comments
It looks like there are a few things that we might lack,
$$($1_$2_$3_LIB) : $$($1_$2_$3_ALL_OBJS) $$(ALL_RTS_LIBS) $$($1_$2_$3_DEPS_LIBS)
ifneq "$$($1_$2_$3_LIB0)" ""
$$(call build-dll,$1,$2,$3,-L$1/$2/build -l$$($1_$2_$3_LIB0_ROOT),$$(filter-out $$($1_$2_dll0_HS_OBJS),$$($1_$2_$3_HS_OBJS)) $$($1_$2_$3_NON_HS_OBJS),$$@)
else
$$(call build-dll,$1,$2,$3,,$$($1_$2_$3_HS_OBJS) $$($1_$2_$3_NON_HS_OBJS),$$@)
endif
ifneq "$$($1_$2_$3_LIB0)" ""
$$($1_$2_$3_LIB) : $$($1_$2_$3_LIB0)
$$($1_$2_$3_LIB0) : $$($1_$2_$3_ALL_OBJS) $$(ALL_RTS_LIBS) $$($1_$2_$3_DEPS_LIBS)
$$(call build-dll,$1,$2,$3,,$$($1_$2_dll0_HS_OBJS) $$($1_$2_$3_NON_HS_OBJS),$$($1_$2_$3_LIB0))
endif and like this otherwise, $$($1_$2_$3_LIB) : $$($1_$2_$3_ALL_OBJS) $$(ALL_RTS_LIBS) $$($1_$2_$3_DEPS_LIBS)
$$(call cmd,$1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) $$($1_$2_$3_GHC_LD_OPTS) $$($1_$2_$3_ALL_OBJS) \
-shared -dynamic -dynload deploy \
$$(addprefix -l,$$($1_$2_EXTRA_LIBRARIES)) $$(addprefix -L,$$($1_$2_EXTRA_LIBDIRS)) \
-no-auto-link-packages \
-o $$@ |
I am copying an issue reported by @kgardas (#198) here:
|
Just curious: It seems that there was no previous code on this issue, so I wonder if hadrian is ever shipped with this functionality before (since "fixing" .... I mean). Also, I can't find the |
@izgzhen The dynamic way was never implemented. The "fixing" refers to it being broken :-) This is the equivalent of https://github.com/snowleopard/hadrian/blob/master/src/Rules.hs#L46-L72 (Apologies for the slow responses, I'm currently travelling.) |
@snowleopard @jmct Yes, I am interested in looking into that issue. I have tried to capture the need for dynamic libs (when dyn is on) with this inserted in
However, I don't quite get where does the |
@izgzhen The top-level https://github.com/snowleopard/hadrian/blob/master/src/Rules.hs#L27-L44 The path to the library file is computed by calling the https://github.com/snowleopard/hadrian/blob/master/src/Settings/Path.hs#L78-L83 I think this code should do what you want, but you need to enable the dynamic way, by uncommenting these lines: https://github.com/snowleopard/hadrian/blob/master/src/Settings/Default.hs#L156-L157 Let me know if this works for you! |
Hey @izgzhen, it’s awesome that you want to help out on this! I’m not sure of your schedule but perhaps we can get on chat and coordinate a plan sometime soon. Work has meant that I haven’t been able to tackle this issue completely but I do have some work in progress. |
@snowleopard Yes, this is exactly what I am finding! Thanks a lot @jmct Great, what is the status of your work? |
I need to get the |
@izgzhen Yes, I expected this could be a problem. A pragmatic solution is to create a build rule that matches a predefined set of extensions ( P.S.: In fact, each dynamic extension will probably have a different build rule anyway. So, all we need is to |
Well, just found that we need I still don't get why we can't use these information in |
Oops -- maybe I can just relax the match pattern |
@izgzhen I don't understand. Why can't you add |
Is now the time to close this since I opened another issue #248? |
@izgzhen What about dynamic way on Windows? We could perhaps open a new Windows-specific issue. |
Oh, right. I almost forget this. I think it is a good idea, since I might not be able to track this platform closely in near term, so a fresh place for us to discuss the specifics sounds appealing. |
Sounds good. I'll create a new issue. |
Dynamic way is currently broken (another relevant issue: #3).
Most infrastructure is already there, but one needs to identify the missing bits, find the relevant parts in the the old build system, and translate them into the new build system.
Feel free to pick this up if you'd like to contribute.
The text was updated successfully, but these errors were encountered: