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

handle build with arch mismatch; support buildfetch --find-build-for-arch #3006

Merged
merged 4 commits into from
Jul 22, 2022

Conversation

dustymabe
Copy link
Member

commit a8896bc193774b2ead347e6ee75c89db187319b4
Author: Dusty Mabe <dusty@dustymabe.com>
Date:   Fri Jul 22 11:56:28 2022 -0400

    cmd-buildfetch: add --find-build-for-arch option
    
    This instructs buildfetch to traverse the builds.json history to
    find the most recent build for the given architecture.

commit 54cd68e0af7e796ac4cc4a30bcd1a43b6c45ac0a
Author: Dusty Mabe <dusty@dustymabe.com>
Date:   Fri Jul 22 11:55:42 2022 -0400

    cmd-buildfetch: bring the ostree ref delete into the loop
    
    There will be a ref per arch so we need to do it on each loop
    iteration.

commit 65e2d8b51c2bcc091803587967448347552aa435
Author: Dusty Mabe <dusty@dustymabe.com>
Date:   Fri Jul 22 11:54:40 2022 -0400

    cmd-buildfetch: continue loop if arch missing
    
    The user could have passed in multiple arches so we should continue
    the loop rather than returning.

commit 62064b21dbea936105efc48dbc95ea30147c8b30
Author: Dusty Mabe <dusty@dustymabe.com>
Date:   Fri Jul 22 11:45:26 2022 -0400

    cosalib/builds: add get_latest_for_arch function; use it in cmd-build
    
    Right now cmd-build will just pick up whatever the latest symlink points
    to and try to get previous build information from that, but what if
    the absolute latest build doesn't have a build for the architecture we
    are targetting? Currently cmd-build will fail with:
    
    ```
    /usr/lib/coreos-assembler/cmd-build: line 163: /srv/builds/36.20220720.20.5/aarch64/meta.json: No such file or directory
    error: failed to execute cmd-build: exit status 1
    ```
    
    What we really need is to get the latest build for the given
    architecture and use that in cmd-build instead.

Right now cmd-build will just pick up whatever the latest symlink points
to and try to get previous build information from that, but what if
the absolute latest build doesn't have a build for the architecture we
are targetting? Currently cmd-build will fail with:

```
/usr/lib/coreos-assembler/cmd-build: line 163: /srv/builds/36.20220720.20.5/aarch64/meta.json: No such file or directory
error: failed to execute cmd-build: exit status 1
```

What we really need is to get the latest build for the given
architecture and use that in cmd-build instead.
The user could have passed in multiple arches so we should continue
the loop rather than returning.
There will be a ref per arch so we need to do it on each loop
iteration.
This instructs buildfetch to traverse the builds.json history to
find the most recent build for the given architecture.
@cgwalters
Copy link
Member

cgwalters commented Jul 22, 2022

Nicely split up changes!

@dustymabe dustymabe enabled auto-merge (rebase) July 22, 2022 19:17
@dustymabe dustymabe merged commit 6864566 into coreos:main Jul 22, 2022
@dustymabe dustymabe deleted the dusty-cmd-buildfetch branch July 22, 2022 20:54
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.

None yet

2 participants