-
Notifications
You must be signed in to change notification settings - Fork 81
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
Add -main-is argument to _build_haskell_module. #1740
Conversation
Thanks for the PR, One issue (that should not be too hard to fix) is that the Other than that, the fix works on this example that uses the However I am not familiar with the module system. @facundominguez, is there a better way to address this maybe ? |
Pushed a fix for the failure. |
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.
Thanks @pranaysashank! Looks like a reasonable way to fix it. There is still some disagreement to fix with the documentation. Also, could we have a test added for this?
I added a test for this custom main_function usage, and I am getting strange errors. This is how I am running the test
and I'm getting the error
Am I missing something or is this another bug? |
It looks to me like a bug, or a yet unsupported feature. No test in |
So there are at least two bugs here:
Still investigating |
Upon further inspection, the following assumption is currently made (and not documented as far as I can tell):
|
I think it would be fair to just document this and say "if you're building with modules, you must write the fully qualified name of the main function in |
If we want to support a specifying |
If we change to always require a fully qualified main_function, do we try to get a module name for usages like this https://github.com/tweag/rules_haskell/pull/1740/files#diff-500f449c248c36e74ead8385c8dd2b98bb9244e21fafd0be214b0eb927c99abbR157 or is it okay to just pass |
where do you see that assumption? |
BTW, in my project where I needed to use this, this fix does work. It's only in the test case above that it doesn't |
|
Is this the current behaviour for haskell_binary? Without this PR, fully qualifying main_function still doesn't work because we don't pass Edit: |
f0af918
to
4e7954d
Compare
|
The buildifier test has failed ( EDIT: fixed this |
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!
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!
I created #1806 to deal with main_file
.
when we have
modules
attr inhaskell_binary
,main_function
is not respected which results in linking error when we try to build