tinygo icon indicating copy to clipboard operation
tinygo copied to clipboard

os/StartProcess

Open leongross opened this issue 1 year ago • 8 comments
trafficstars

This is a rework of https://github.com/tinygo-org/tinygo/pull/4323 (based on that branch) to move the Execve and Fork wrappers to the os package to circumvent the goroot overrides.

leongross avatar Aug 02 '24 11:08 leongross

main_test.go:394: /home/runner/work/tinygo/tinygo/src/os/osexec.go:14:23: undefined: syscall.Syscall

ci fails with undefined syscall.Syscall. I thought since it is just a package the compiler would pick that up when building it. @aykevl

EDIT: it looks like this is only happening on architectures that the createRawSyscall function does not target, which makes sense, namely EmulatedCortexM3 : cortex-m-qemu and EmulatedRISCV : riscv-qemu. Anyways, this should not happen. https://github.com/tinygo-org/tinygo/blob/dev/main_test.go#L522

Anyhow the smoke tests fail without any further information of what went wrong on linux, windows and mac. the smoke test cannot be removed, it is not clear though why it wasn't build in the first place

rm: cannot remove 'smoke.test': No such file or directory

leongross avatar Aug 05 '24 15:08 leongross

Not sure if something like https://github.com/tinygo-org/tinygo/pull/4398 would fix this? @aykevl

leongross avatar Aug 08 '24 11:08 leongross

Not sure if something like #4398 would fix this? @aykevl

No, that's the wrong approach. If syscall.Syscall fails on baremetal systems, then the solution is not to implement these syscalls (because they're baremetal, so there is no OS to call into), but rather to figure out why these calls are made.

aykevl avatar Aug 08 '24 12:08 aykevl

@deadprogram @dgryski @aykevl build and tests finally succeed, would appreciate another review.

leongross avatar Aug 22 '24 12:08 leongross

@aykevl @deadprogram @dgryski would someone mind reviewing?

leongross avatar Aug 29 '24 16:08 leongross

@leongross still are some CI failures from this PR is would appear.

deadprogram avatar Sep 17 '24 15:09 deadprogram

I figured out the error here: there is no fork syscall on arm64 1. The original golang implementation abstracts this better and does not do raw syscalls as my implementation does. So for now, arm64 has to be excluded as a possible target architecture for this.

leongross avatar Oct 04 '24 09:10 leongross

Windows CI fails on, any will investigate.

--- FAIL: TestBuild/Host/go1.21.go (35.61s)

leongross avatar Oct 10 '24 09:10 leongross

I think you need to drop the first commit, now that you've rebased on the dev branch?

The Windows test failures are probably just because the Windows CI tends to be flaky (sometimes, tests don't produce any output and we don't know why) so you can ignore these for now.

aykevl avatar Oct 24 '24 11:10 aykevl

Thanks for the feedback @aykevl. It looks like now just the said windows CI is failing.

leongross avatar Oct 25 '24 04:10 leongross

@aykevl any idea how we can fix the flaky windows CI?

leongross avatar Oct 25 '24 23:10 leongross

The CI seems to have problems finding musl files that are there although. Locally running these commands does not produce errors. @aykevl do you have any idea what is going on there? Only the smoke tests fail, the unit tests seem to work out.

https://github.com/tinygo-org/tinygo/actions/runs/11590162170/job/32267411673?pr=4377#step:10:11 https://github.com/tinygo-org/tinygo/actions/runs/11590162170/job/32267411673?pr=4377#step:9:700

leongross avatar Oct 30 '24 09:10 leongross

@aykevl

leongross avatar Nov 02 '24 00:11 leongross

Thank you! I have merged the PR.

aykevl avatar Nov 07 '24 08:11 aykevl

Thanks for merging and the thorough review @aykevl!

leongross avatar Nov 07 '24 13:11 leongross