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

Import arch file as a package #77

Closed
DrDeano opened this issue Sep 11, 2019 · 4 comments · Fixed by #324
Closed

Import arch file as a package #77

DrDeano opened this issue Sep 11, 2019 · 4 comments · Fixed by #324
Labels
arch: none Affects common code across architectures arch: x86 Affects the x86 port blocked Blocked on an external issue building Relates to building the kernel code quality An issue of source code quality enhancement New feature or request good first issue Good for newcomers

Comments

@DrDeano
Copy link
Member

DrDeano commented Sep 11, 2019

Instead of the existing system of importing the arch.zig file, have the architecture arch.zig file be added as a package in the build script. This will remove the kernel level arch.zig file. This will also help with the testing.

Is blocked by:
ziglang/zig#855

We can't do this as we have the kernel as a package and as the kernel will import the arch package and arch will import the kernel package, will need to wait for this.

@DrDeano DrDeano added enhancement New feature or request good first issue Good for newcomers arch: x86 Affects the x86 port arch: none Affects common code across architectures code quality An issue of source code quality building Relates to building the kernel blocked Blocked on an external issue labels Sep 11, 2019
@Dawid33
Copy link
Contributor

Dawid33 commented Jun 13, 2022

I gave this a go, got the system building by putting all the kernel files into a package that just re-exports them, then kmain.zig imports that and the arch package. This works for just building and running the kernel but running the tests requires a bit more work.

Pluto depends on the arch package in a few places when it can't do that. Right now I'm thinking of stripping all the kernel code that depends on arch.zig and putting it in a package like arch-common, that way the dependencies will be kmain.zig -> pluto.zig & arch.zig -> arch-common.zig

I'm new to zig and contributing to oss in general so please let me know if I get something wrong :).

@SamTebbs33
Copy link
Collaborator

SamTebbs33 commented Jun 13, 2022

Thanks @Dawid33, with a few adjustments I think we could merge that in! If you open a pull request (short guide here if you haven't done that before) we'll give it a review.

@Dawid33
Copy link
Contributor

Dawid33 commented Jun 13, 2022

@SamTebbs33 Okay, I'll submit the pull request but zig build testisn't working yet, it still needs a good bit of work. Thank you for the fast reply.

@SamTebbs33
Copy link
Collaborator

Awesome, thanks. No problem that it's failing to test, we can get some review done in the meantime.

@SamTebbs33 SamTebbs33 linked a pull request Jun 15, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch: none Affects common code across architectures arch: x86 Affects the x86 port blocked Blocked on an external issue building Relates to building the kernel code quality An issue of source code quality enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants