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

Buildbot uploads R1/beta1 repositories to master S3 bucket #43

Closed
waddlesplash opened this issue Mar 4, 2019 · 12 comments
Closed

Buildbot uploads R1/beta1 repositories to master S3 bucket #43

waddlesplash opened this issue Mar 4, 2019 · 12 comments
Assignees
Labels

Comments

@waddlesplash
Copy link
Member

See last step of: https://build.haiku-os.org/buildbot/#/builders/28/builds/333

This was a R1/beta1 repo build, but it got shoved into the "master" S3 bucket.

@waddlesplash
Copy link
Member Author

Manually moved the directories so the updates are now in place, anyway.

@kallisti5
Copy link
Contributor

This is likely due to:
c1f121d#diff-d3c5ee9e6be39d2b99a1af34e4c0a2d9

Adding another codebase, we reference "branch" during the built. Previously there was one codebase in the scheduler with one branch... now we get two branches in two codebases. I think we're grabbing the new codebase (last item in array).

This can be seen in the debug output for the build referenced above...

1

@kallisti5
Copy link
Contributor

Raised a bug to buildbot here:
buildbot/buildbot#4831

It looks as though introducing another codebase silently unsets the 'branch' property. We then use the default which is 'master'.

Asking the buildbot folks how you're supposed to determine the branch in a multi-codebase build.

@kallisti5
Copy link
Contributor

kallisti5 commented Jun 13, 2019

Pushed potential fix via 39b70a6.

Github now "assumes" a bug is fixed and closed the issue if it sees "assumed fixed in ..." wth

@kallisti5 kallisti5 reopened this Jun 13, 2019
@kallisti5 kallisti5 reopened this Jun 13, 2019
@kallisti5
Copy link
Contributor

kallisti5 commented Jun 13, 2019

ok.. So when you have multiple codebases, buildbot expects you to leverage "Interpolate"
After much struggling, "Interpolate" is pretty much an attempt to hack futures into python. (something defined, that is set at execution)

The issue is we lose access to the Interpolated data pretty quickly... and when it fails to execute it spams invalid output everywhere instead of raising an error.

Here's an example of trying to leverage Interpolate:

branch = Interpolate("%(src:buildtools:branch)s")
crossDir = "../cross-tools-%s-%s" % (branch, targetArch)

In the example above, crossDir is set to "../cross-tools-Interpolate('%(src:buildtools:branch)s')-x86"

This is because the Interpolate value is only set on execution of the job.

In another example:

branch = Interpolate("%(src:buildtools:branch)s")
if branch == "master":
  blah

this also doesn't work, since branch is "Interpolate("%(src:buildtools:branch)s")" until execution.
The whole Interpolate model isn't well suited for all the business logic we need in Python. I got pretty close replacing everything that uses an Interpolated value with something like this:

crossToolsDir = Interpolate("../cross-tools-%%(src:buildtools:branch)s-%s" % targetArch)
gccPath = Interpolate("../cross-tools-%%(src:buildtools:branch)s-%s/cross-tools-%s/bin/gcc-%s" % (targetArch, targetArch, machineTriplet))

That code smells pretty bad however, and it doesn't address the lack of "if brach" within the codebase.

@kallisti5
Copy link
Contributor

honestly... at this point I think the "correct" solution is to revert this:
c1f121d

While that commit is "correct", the buildbot Interpolate crap adds a lot of headaches and makes some pretty hard to follow code.

@waddlesplash
Copy link
Member Author

Can't we just use shell wizardry to get the branch from Git directly, instead of from buildbot vars, when uploading to Minio?

@kallisti5
Copy link
Contributor

Damn you and your good ideas.

@kallisti5
Copy link
Contributor

errr.. a LOT of magic logic depends on the branch name within the python code. Pretty much all of our build profile choices are formed in the python code based on the current branch. (none of this is my doing btw :-) )

Maybe the real solution to this is finishing my work using concourse.ci :-D

@kallisti5
Copy link
Contributor

Here's the most complex code path that needs updated:

Since fixing this will require a massive refactor of our buildbot code... i'd rather just revert the (correct, but massively incomplete) c1f121d

@kallisti5
Copy link
Contributor

there is one alternative... we move the scripts to build releases into our git repository.

The script will get all the important bits (or read them from BuildConfig), and then produce a release based on the inputs.

buildHaikuRelease arm
buildHaikuRepository arm

We could also roll the hacked UEFI scripts for r1beta1 into these scripts as well.

@kallisti5
Copy link
Contributor

buildbot is no more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants