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

twoliter: Create a test project #106

Merged
merged 1 commit into from
Oct 30, 2023

Conversation

ecpullen
Copy link
Contributor

Issue number:

Closes #72

Description of changes:

Adds a new test project for OOTB. There are 2 packages included, one written in rust and the other in go.

Testing done:

This has been tested with #96

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

Comment on lines +1 to +9
use std::process::{exit, Command};

fn main() -> Result<(), std::io::Error> {
let ret = Command::new("buildsys").arg("build-package").status()?;
if !ret.success() {
exit(1);
}
Ok(())
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we inject these files via twoliter? It'd be somewhat magical but would cut down on boilerplate.

Copy link
Contributor

@webern webern Oct 12, 2023

Choose a reason for hiding this comment

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

I don't love the idea because someone might want to augment this code for their own purposes (pulling from a cache or generating some code, for example). On the other hand, without controlling this code, it is hard to update the calling pattern without breaking everyone.

One idea might be to vend a crates.io project that simplifies this down to:

fn main() -> Result<(), Error> {
    buildsys::run()
}

This would also eliminate the need to vend buildsys as a binary. But, there would be a strict calling convention based on environment variables and some sort of version check to make sure the customer isn't using a too-old version of buildsys for Twoliter's expectations.

So Twoliter might pass BUILDSYS_REQUIRED_VERSION=v0.22 and buidsys might error Buildsys version v0.10.0 is not compatible with the current version of Twoliter, please update to version v0.22.0.

Comment on lines +1 to +5
/.git
/.gomodcache
/build/*
!/build/rpms/
/build/rpms/*
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't love copying this file around but I'll clean it up in #102 assuming this merges first.

@ecpullen ecpullen merged commit 74c77b3 into bottlerocket-os:develop Oct 30, 2023
1 check passed
@ecpullen ecpullen deleted the alpha-project branch October 30, 2023 19:17
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.

kits: create a test project
4 participants