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

DRAFT: Staged scheduler #1026

Closed
wants to merge 1 commit into from
Closed

DRAFT: Staged scheduler #1026

wants to merge 1 commit into from

Conversation

cg-jl
Copy link
Contributor

@cg-jl cg-jl commented Aug 2, 2022

This is an attempt to remove the run-one.sh script by integrating the
different stages of compiling a test binary into the Jakttest scheduler.

EDIT: Managed to work around #1025. Now scheduler doesn't work correctly, but at least I can compile it.

Note that this commit is huge and it will be split before a review is
requested.

public function init(fd: i32) throws -> CollectedReader {
// NOTE: mut so codegen does not declare it as const u8 *
mut raw_buffer = libc::malloc(size: 4096)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this feels very awkward. does Jakt runtime not have AK::ByteBuffer?

Copy link
Contributor Author

@cg-jl cg-jl Aug 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably it's there but I just didn't know of it. Anyway, this is nowhere near finished. The scheduler gets stuck after the first chunk of jobs finishes, panics sometimes (maybe it's the queue implementation, I don't know), fails to properly collect stdout/stderr over the pipes (thus marking tests as failed because it couldn't find the error). Plus, the fork()/dup2()/exec() has to be replaced with an API that implements the needed posix_spawn* functions, since the Windows approach goes through a 'builder pattern' in a similar way that posix_spawn functions are meant to be used.

Copy link
Contributor Author

@cg-jl cg-jl Aug 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to start by throwing out the pipes and just create the .err/.out/.cpp files directly and redirect the output to them, saving just their handle through Jakt::File. This will just need a little add-on to File to get fileno functionality, and will remove the polling of buffers that is not even working properly.

@cg-jl cg-jl closed this by deleting the head repository Oct 22, 2022
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

Successfully merging this pull request may close these issues.

2 participants