Skip to content

Add infrastructure for build options#62

Merged
SamTebbs33 merged 1 commit intodevelopfrom
feature/build-options
Sep 1, 2019
Merged

Add infrastructure for build options#62
SamTebbs33 merged 1 commit intodevelopfrom
feature/build-options

Conversation

@SamTebbs33
Copy link
Collaborator

This patch adds the infrastructure for passing build options from build.zig to the source. At the moment the only option added is rt_test which will be used to run extensive runtime tests (#60).

I added the config.zig file to hide the rather ugly build options file import from kmain.zig, much like we did with arch.zig.

Closes #59

@SamTebbs33 SamTebbs33 requested a review from DrDeano August 27, 2019 18:31
Copy link
Member

@DrDeano DrDeano left a comment

Choose a reason for hiding this comment

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

Couple of points

displayName: 'Download qemu'

- script: zig*/zig build test -Drt-test=true -Dzig-path=zig*/zig
- script: |
Copy link
Member

Choose a reason for hiding this comment

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

Surely you would also have a normal build as well, as adding the testing and setting to true would have the OS be in testing mode when released. Then with the build OS with runtime testing enabled, add a command to start the kernel which would trigger the runtime tests

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There is actually a normal build without runtime testing enabled earlier on in the pipeline, check the "Build kernel" step.

@SamTebbs33 SamTebbs33 force-pushed the feature/build-options branch from 9993342 to 533b2f9 Compare August 29, 2019 09:05
Copy link
Member

@DrDeano DrDeano left a comment

Choose a reason for hiding this comment

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

Bam, Just a question for you :)

const log = @import("log.zig");
const serial = @import("serial.zig");
const mem = @import("mem.zig");
const options = @import("build_options");
Copy link
Member

Choose a reason for hiding this comment

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

This is cool, how can you just pass in this string like that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think that it's a hardcoded thing in the compiler and it just finds the right build options file :)

@SamTebbs33 SamTebbs33 force-pushed the feature/build-options branch from f0da252 to 32eb09e Compare September 1, 2019 16:30
@SamTebbs33 SamTebbs33 merged commit 015c096 into develop Sep 1, 2019
@SamTebbs33 SamTebbs33 deleted the feature/build-options branch September 1, 2019 16:33
SamTebbs33 added a commit that referenced this pull request Oct 7, 2019
Add infrastructure for build options
SamTebbs33 added a commit that referenced this pull request Oct 7, 2019
Add infrastructure for build options
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.

Pass options from build.zig to source

2 participants