Skip to content
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

Running tests on unregisterised/no-SMP builds #59

Open
matoro opened this issue Oct 27, 2022 · 10 comments
Open

Running tests on unregisterised/no-SMP builds #59

matoro opened this issue Oct 27, 2022 · 10 comments

Comments

@matoro
Copy link

matoro commented Oct 27, 2022

Hi, when attempting to run the test suite on no-SMP builds of GHC, it errors out with unknown RTS option: -N due to the hardcoded -with-rtsopts=-N. Currently, unregisterised builds of GHC imply no-SMP, which means the test suite cannot be run on platforms where only unregisterised GHC is supported.

Could passing this option to the test suite be made conditional on a GHC build with SMP support?

@tomjaguarpaw
Copy link
Collaborator

Sounds plausible. Is it convenient for you to come up with a PR so I can see what it would look like?

@matoro
Copy link
Author

matoro commented Oct 28, 2022

Sounds plausible. Is it convenient for you to come up with a PR so I can see what it would look like?

I wish, sorry. Unfortunately I don't know any Haskell - this is just from the perspective of a distro maintainer trying to build this package on unregisterised platforms.

@tomjaguarpaw
Copy link
Collaborator

I see. Well, I will add it to my TODO list, but unfortunately that list is very long. Please do come back and complain again if it continues to cause you pain. Perhaps in the meantime some other kind volunteer can help.

hololeap added a commit to hololeap/typed-process that referenced this issue Oct 28, 2022
This flag will toggle the use of `ghc-options` in the
`typed-process-test` test suite. It is set to `default: True`.

This is needed for tests to run on some GHC builds which do not support
a threaded runtime.

Closes: fpco#59
Signed-off-by: hololeap <[email protected]>
hololeap added a commit to hololeap/typed-process that referenced this issue Oct 28, 2022
This flag will toggle the use of `ghc-options` in the
`typed-process-test` test suite. It is set to `default: True`.

This is needed for tests to run on some GHC builds which do not support
a threaded runtime.

Closes: fpco#59
Signed-off-by: hololeap <[email protected]>
hololeap added a commit to hololeap/typed-process that referenced this issue Oct 28, 2022
This flag will toggle the use of `ghc-options` in the
`typed-process-test` test suite. It is set to `default: True`.

This is needed for tests to run on some GHC builds which do not support
a threaded runtime.

Closes: fpco#59
Signed-off-by: hololeap <[email protected]>
@hololeap
Copy link

Sorry for the force-push spam.

@tomjaguarpaw
Copy link
Collaborator

Thanks! @hololeap can you tell us what the commands are for running the test suite with and without the smp flag? I don't use stack so I'm not familiar with how that would work.

@hololeap
Copy link

hololeap commented Oct 28, 2022

I don't use stack either, but you can generate a .cabal file with hpack. Then you would just run

cabal configure --enable-tests --flag=-smp

to turn off the smp flag before building/testing.

@hololeap
Copy link

hololeap commented Oct 28, 2022

It looks like with stack, you would use

stack build --flag typed-process:-smp

@tomjaguarpaw
Copy link
Collaborator

Great. @matoro, can you confirm this does the job for you?

@hololeap
Copy link

For an ebuild (gentoo), you could do something like

src_configure() {
	if ghc-supports-smp; then
		local smp_flag=smp
	else
		local smp_flag=-smp
	fi
	
	haskell-cabal_src_configure \
		--flag="${smp_flag}"
}

@hololeap
Copy link

@matoro here is a patch that you can plug into dev-haskell/typed-process/files/:
https://gist.github.com/hololeap/c4316ab07cdf836ddc604ba8736159c3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants