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

Don't block user interaction while fetching the image size #1415

Merged

Conversation

debarshiray
Copy link
Member

It takes skopeo inspect a few seconds to fetch the image size from the
remote registry, and while that happens the user can't interact with the
image download prompt:

  $ toolbox create
  Image required to create toolbox container.
  <wait for a few seconds>
  Download registry.fedoraproject.org/fedora-toolbox:39 (359.8MB)? [y/N]:

This feels awkward because it's not clear to the user what's going on
during those few seconds. Moreover, while knowing the image size can be
convenient at times, for example when disk space and network bandwidth
are limited, it's not always important.

It will be better if skopeo inspect ran in the background, while
waiting for the user to respond to the image download prompt, and once
the image size has been fetched, the prompt can be updated to include
it.

So, initially:

  $ toolbox create
  Image required to create toolbox container.
  Download registry.fedoraproject.org/fedora-toolbox:39 (...)? [y/N]:

... and then once the size is available:

  $ toolbox create
  Image required to create toolbox container.
  Download registry.fedoraproject.org/fedora-toolbox:39 (359.8MB)? [y/N]:

If skopeo(1) is missing or too old, then the prompt can continue without
the size, as it did before:

  $ toolbox create
  Image required to create toolbox container.
  Download registry.fedoraproject.org/fedora-toolbox:39 [y/N]:

#752
#1263

Copy link

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/beacc41e9c884763bfb5191cbfe7b2b8

✔️ unit-test SUCCESS in 9m 33s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 4m 43s
✔️ unit-test-restricted SUCCESS in 8m 14s
✔️ system-test-fedora-rawhide SUCCESS in 35m 25s
✔️ system-test-fedora-39 SUCCESS in 34m 05s
✔️ system-test-fedora-38 SUCCESS in 34m 08s
✔️ system-test-fedora-37 SUCCESS in 34m 26s

@HarryMichal HarryMichal added 3. Enhancement Improvement to an existing feature 2. CLI Issue is related to the command line interface 2. Host Realm The issue is related to what happens on the host machine where Toolbox is executed 2. Under The Hood Multiple areas of the app are influenced by this ticket 7. Needs tests The work needs new test cases added labels Dec 6, 2023
@debarshiray debarshiray force-pushed the wip/rishi/skopeo-inspect-async branch from 52b9c19 to 902e945 Compare December 6, 2023 20:25
debarshiray added a commit to debarshiray/toolbox that referenced this pull request Dec 6, 2023
This makes it easier to spot the beginning of functions with long lists
of parameters and return values.

containers#1415
Copy link

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/5e710241cfd34b118b37e94150204d40

✔️ unit-test SUCCESS in 8m 38s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 58s
✔️ unit-test-restricted SUCCESS in 8m 09s
✔️ system-test-fedora-rawhide SUCCESS in 31m 52s
✔️ system-test-fedora-39 SUCCESS in 30m 14s
✔️ system-test-fedora-38 SUCCESS in 30m 30s
✔️ system-test-fedora-37 SUCCESS in 30m 36s

@debarshiray debarshiray force-pushed the wip/rishi/skopeo-inspect-async branch from 902e945 to aa48a0c Compare December 7, 2023 14:41
@debarshiray
Copy link
Member Author

debarshiray commented Dec 7, 2023

We need a newer Go (at least 1.20, to be precise) on Ubuntu 22.04:

...
The following additional packages will be installed:
  fish-common golang-1.18 golang-1.18-doc golang-1.18-go golang-1.18-src
  golang-doc golang-go golang-src xsel
...
...
...
[11/14] /home/runner/work/toolbox/toolbox/containers/toolbox/src/go-build-wrapper /home/runner/work/toolbox/toolbox/containers/toolbox/src /home/runner/work/toolbox/toolbox/containers/toolbox/builddir src/toolbox 0.0.99.4 cc /lib64/ld-linux-x86-64.so.2 false
FAILED: src/toolbox 
/home/runner/work/toolbox/toolbox/containers/toolbox/src/go-build-wrapper /home/runner/work/toolbox/toolbox/containers/toolbox/src /home/runner/work/toolbox/toolbox/containers/toolbox/builddir src/toolbox 0.0.99.4 cc /lib64/ld-linux-x86-64.so.2 false
# github.com/containers/toolbox/cmd
cmd/create.go:770:31: undefined: context.WithCancelCause
cmd/create.go:775:43: undefined: context.WithCancelCause
cmd/create.go:802:20: undefined: context.Cause
cmd/create.go:823:19: undefined: context.Cause
cmd/create.go:879:41: undefined: context.WithCancelCause
ninja: build stopped: subcommand failed.
Error: Process completed with exit code 1.
...

@debarshiray debarshiray force-pushed the wip/rishi/skopeo-inspect-async branch from aa48a0c to 556b8f0 Compare December 7, 2023 14:47
Copy link

Build failed.
https://softwarefactory-project.io/zuul/t/local/buildset/c92cdca4d5a349f6b5f56ba2af8b90fb

unit-test FAILURE in 6m 30s
unit-test-migration-path-for-coreos-toolbox FAILURE in 2m 08s
unit-test-restricted FAILURE in 5m 36s
system-test-fedora-rawhide FAILURE in 6m 40s
system-test-fedora-39 FAILURE in 6m 41s
system-test-fedora-38 FAILURE in 6m 31s
system-test-fedora-37 FAILURE in 6m 24s

@debarshiray debarshiray force-pushed the wip/rishi/skopeo-inspect-async branch 5 times, most recently from 194044a to 6af107a Compare December 7, 2023 17:22
Copy link

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/91e009f7daad4969add8aed49c2e3f44

✔️ unit-test SUCCESS in 7m 14s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 23s
✔️ unit-test-restricted SUCCESS in 6m 07s
✔️ system-test-fedora-rawhide SUCCESS in 30m 27s
✔️ system-test-fedora-39 SUCCESS in 29m 11s
✔️ system-test-fedora-38 SUCCESS in 29m 40s
✔️ system-test-fedora-37 SUCCESS in 29m 29s

@debarshiray debarshiray force-pushed the wip/rishi/skopeo-inspect-async branch from 6af107a to 4de06b3 Compare December 7, 2023 18:00
Copy link

Build failed.
https://softwarefactory-project.io/zuul/t/local/buildset/a335e348aa214dbe9b2e5b888808c3cf

✔️ unit-test SUCCESS in 11m 33s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 4m 12s
✔️ unit-test-restricted SUCCESS in 7m 57s
✔️ system-test-fedora-rawhide SUCCESS in 54m 33s
system-test-fedora-39 TIMED_OUT in 50m 27s
system-test-fedora-38 TIMED_OUT in 50m 22s
system-test-fedora-37 TIMED_OUT in 50m 25s

@debarshiray
Copy link
Member Author

recheck

Copy link

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/447c22c026da4980ad91f9ae8c2068e2

✔️ unit-test SUCCESS in 8m 52s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 4m 16s
✔️ unit-test-restricted SUCCESS in 7m 36s
✔️ system-test-fedora-rawhide SUCCESS in 34m 24s
✔️ system-test-fedora-39 SUCCESS in 32m 13s
✔️ system-test-fedora-38 SUCCESS in 32m 56s
✔️ system-test-fedora-37 SUCCESS in 33m 03s

Copy link

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/64ca6c3f05f54b0092a642a508390721

✔️ unit-test SUCCESS in 8m 25s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 6m 42s
✔️ unit-test-restricted SUCCESS in 7m 17s
✔️ system-test-fedora-rawhide SUCCESS in 31m 21s
✔️ system-test-fedora-39 SUCCESS in 30m 03s
✔️ system-test-fedora-38 SUCCESS in 30m 33s
✔️ system-test-fedora-37 SUCCESS in 30m 17s

debarshiray added a commit to debarshiray/toolbox that referenced this pull request Dec 7, 2023
This makes it easier to spot the beginning of functions with long lists
of parameters and return values.

containers#1415
@debarshiray debarshiray force-pushed the wip/rishi/skopeo-inspect-async branch from 9da3b7f to cfa65cd Compare December 7, 2023 23:04
Copy link

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/7ecbc797552d46359066dc202598330e

✔️ unit-test SUCCESS in 7m 20s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 16s
✔️ unit-test-restricted SUCCESS in 6m 35s
✔️ system-test-fedora-rawhide SUCCESS in 28m 02s
✔️ system-test-fedora-39 SUCCESS in 26m 43s
✔️ system-test-fedora-38 SUCCESS in 27m 38s
✔️ system-test-fedora-37 SUCCESS in 27m 43s

Copy link

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/d74a4150d8d24df09918e74de9537a47

✔️ unit-test SUCCESS in 8m 29s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 38s
✔️ unit-test-restricted SUCCESS in 7m 37s
✔️ system-test-fedora-rawhide SUCCESS in 43m 04s
✔️ system-test-fedora-39 SUCCESS in 27m 37s
✔️ system-test-fedora-38 SUCCESS in 32m 47s
✔️ system-test-fedora-37 SUCCESS in 38m 45s

debarshiray added a commit to debarshiray/toolbox that referenced this pull request Dec 13, 2023
This makes it easier to spot the beginning of functions with long lists
of parameters and return values.

containers#1415
Copy link

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/fb2d5084c40949ebac047098b2251093

✔️ unit-test SUCCESS in 9m 27s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 4m 29s
✔️ unit-test-restricted SUCCESS in 8m 12s
✔️ system-test-fedora-rawhide SUCCESS in 38m 36s
✔️ system-test-fedora-39 SUCCESS in 34m 24s
✔️ system-test-fedora-38 SUCCESS in 35m 37s

Copy link

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/82970e48ef8a45298b5926199222d112

✔️ unit-test SUCCESS in 8m 25s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 17s
✔️ unit-test-restricted SUCCESS in 7m 26s
✔️ system-test-fedora-rawhide SUCCESS in 30m 36s
✔️ system-test-fedora-39 SUCCESS in 28m 47s
✔️ system-test-fedora-38 SUCCESS in 29m 03s

@debarshiray debarshiray force-pushed the wip/rishi/skopeo-inspect-async branch from 99963a8 to ddcd28c Compare December 13, 2023 17:28
Copy link

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/c748a116879a45e0861842d64afdf07d

✔️ unit-test SUCCESS in 8m 51s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 4m 16s
✔️ unit-test-restricted SUCCESS in 7m 53s
✔️ system-test-fedora-rawhide SUCCESS in 34m 03s
✔️ system-test-fedora-39 SUCCESS in 32m 52s
✔️ system-test-fedora-38 SUCCESS in 32m 50s

Copy link

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/7e198fc0e6d844afaae01b988732a488

✔️ unit-test SUCCESS in 9m 26s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 4m 14s
✔️ unit-test-restricted SUCCESS in 8m 34s
✔️ system-test-fedora-rawhide SUCCESS in 37m 50s
✔️ system-test-fedora-39 SUCCESS in 34m 33s
✔️ system-test-fedora-38 SUCCESS in 35m 13s

Copy link

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/0a03e3c49cc94f8abe250ba6b2277fc4

✔️ unit-test SUCCESS in 9m 07s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 4m 33s
✔️ unit-test-restricted SUCCESS in 8m 08s
✔️ system-test-fedora-rawhide SUCCESS in 33m 58s
✔️ system-test-fedora-39 SUCCESS in 29m 05s
✔️ system-test-fedora-38 SUCCESS in 31m 58s

Copy link

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/731bd84204bc4af885abcb6b5d98f747

✔️ unit-test SUCCESS in 8m 55s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 24s
✔️ unit-test-restricted SUCCESS in 8m 16s
✔️ system-test-fedora-rawhide SUCCESS in 36m 36s
✔️ system-test-fedora-39 SUCCESS in 33m 14s
✔️ system-test-fedora-38 SUCCESS in 32m 59s

@debarshiray debarshiray force-pushed the wip/rishi/skopeo-inspect-async branch from d0968a8 to c154123 Compare December 14, 2023 14:33
@debarshiray
Copy link
Member Author

debarshiray commented Dec 14, 2023

Other than removing and installing skopeo(1) on my host, I have been instrumenting the code with something like this to test some of the races and possibilities:

diff --git a/src/cmd/create.go b/src/cmd/create.go
index a9643bf62a22..ca5d4ca876f1 100644
--- a/src/cmd/create.go
+++ b/src/cmd/create.go
@@ -597,6 +597,7 @@ func getImageSizeFromRegistry(ctx context.Context, imageFull string) (string, er
                }
        }
 
+       //imageSizeFloat = 1
        imageSizeHuman := units.HumanSize(imageSizeFloat)
        return imageSizeHuman, nil
 }
@@ -872,6 +873,7 @@ func showPromptForDownloadSecond(imageFull string, errFirst *promptForDownloadEr
        }
 
        fmt.Printf("\r")
+       shell.Run("sleep", nil, nil, nil, "2")
 
        askCtx, askCancel := context.WithCancelCause(parentCtx)
        defer askCancel(errors.New("clean-up"))
@@ -925,6 +927,7 @@ func showPromptForDownloadSecond(imageFull string, errFirst *promptForDownloadEr
                fmt.Printf("\033[K")
 
                fmt.Printf("...\n")
+               shell.Run("sleep", nil, nil, nil, "2")
                return errContinue
        }
 
@@ -945,12 +948,15 @@ func showPromptForDownloadSecond(imageFull string, errFirst *promptForDownloadEr
 
 func showPromptForDownload(imageFull string) bool {
        fmt.Println("Image required to create toolbox container.")
+       shell.Run("sleep", nil, nil, nil, "2")
 
        shouldPullImage, err := showPromptForDownloadFirst(imageFull)
        if err == nil {
                return shouldPullImage
        }
 
+       shell.Run("sleep", nil, nil, nil, "2")
+
        var errPromptForDownload *promptForDownloadError
        if !errors.As(err, &errPromptForDownload) {
                panicMsg := fmt.Sprintf("unexpected %T: %s", err, err)

ie., image sizes of different lengths, skopeo(1) being present or absent, the user's typing racing with our updates to the prompt, etc..

Copy link

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/fceb2e56454d49f1b14c503a701dff80

✔️ unit-test SUCCESS in 7m 02s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 33s
✔️ unit-test-restricted SUCCESS in 6m 14s
✔️ system-test-fedora-rawhide SUCCESS in 29m 44s
✔️ system-test-fedora-39 SUCCESS in 28m 05s
✔️ system-test-fedora-38 SUCCESS in 30m 19s

This makes it easier to spot the beginning of functions with long lists
of parameters and return values.

containers#1415
@debarshiray debarshiray force-pushed the wip/rishi/skopeo-inspect-async branch from c154123 to 7d50dcf Compare December 15, 2023 13:04
Copy link

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/7ce2156fcbe942d3908c62afb2562fed

✔️ unit-test SUCCESS in 6m 59s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 33s
✔️ unit-test-restricted SUCCESS in 5m 52s
✔️ system-test-fedora-rawhide SUCCESS in 28m 20s
✔️ system-test-fedora-39 SUCCESS in 29m 18s
✔️ system-test-fedora-38 SUCCESS in 27m 00s

@debarshiray debarshiray force-pushed the wip/rishi/skopeo-inspect-async branch from 7d50dcf to 540947f Compare December 16, 2023 12:33
A subsequent commit will use this to ensure that the user can still
interact with the image download prompt while 'skopeo inspect' fetches
the image size from the remote registry.  Initially, the prompt will be
shown without the image size.  Once the size has been fetched, the older
prompt will be cancelled and a new one will be shown that includes the
size.

Even though this code is only expected to be used to read from the
standard input stream when it's connected to a terminal device, the use
of poll(2) here was tested with FIFOs or named pipes and regular files
as well, in case they might be necessary in future.

An eventfd(2) file descriptor expects a 8-byte or 64-bit integer value
to be given to write(2) to increase its counter by that amount [1].  In
C, it could be phrased as:
  uint64_t one = 1;
  write (eventfd, &one, sizeof (one));

However, Go's wrapper for write(2) expects a sequence of bytes (ie.,
[]byte), and not an arbitrary memory address [2].  Therefore, the
'encoding/binary' package [3] is used to encode the integer into a byte
sequence as a varint.

Even though a varint-encoded 64-bit integer takes a maximum of 10
bytes, as defined by binary.MaxVarintLen64, 1 byte is enough to encode
the number 1 as an unsigned 64-bit integer [4].  That's enough to fit
into a byte sequence of length 8 to satisfy what an eventfd(2) file
descriptor expects.  Ultimately, it doesn't matter exactly what value
the receiving end assigns to the number given to write(2), as long as
it's not zero.

[1] https://man7.org/linux/man-pages/man2/eventfd.2.html

[2] https://pkg.go.dev/golang.org/x/sys/unix#Write

[3] https://pkg.go.dev/encoding/binary

[4] https://protobuf.dev/programming-guides/encoding/

containers#752
containers#1263
This is meant to avoid duplicating the code that shows the prompt, and
reads and parses the user's input.

containers#752
containers#1263
A subsequent commit will use this to ensure that the user can still
interact with the image download prompt while 'skopeo inspect' fetches
the image size from the remote registry.

Initially, the prompt will be shown without the image size.  Once the
size has been fetched, the older prompt will be cancelled and a new one
will be shown that includes the size.  While the prompt is getting
updated, the terminal device will be put into non-canonical mode input
and the echoing of input characters will be disabled to retain full
control of the cursor position.  Once the new prompt is in place, the
previous state of the terminal will be restored.  However, anything that
was typed in the interim will be discarded to avoid surprising the user
with invisible input.

Even though this code is only expected to be used to read from the
standard input stream when it's connected to a terminal device, the use
of poll(2) here was tested with FIFOs or named pipes and regular files
as well, in case they might be necessary in future.

containers#752
containers#1263
Copy link

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/6f7bd937d6f24a0186a8cab9e978fee9

✔️ unit-test SUCCESS in 6m 55s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 12s
✔️ unit-test-restricted SUCCESS in 5m 55s
✔️ system-test-fedora-rawhide SUCCESS in 31m 06s
✔️ system-test-fedora-39 SUCCESS in 26m 03s
✔️ system-test-fedora-38 SUCCESS in 26m 19s

A subsequent commit will use this to ensure that the user can still
interact with the image download prompt while 'skopeo inspect' fetches
the image size from the remote registry.

To do this, at some point, the terminal device will be put into
non-canonical mode input and the echoing of input characters will be
disabled to retain full control of the cursor position.  Unfortunately,
this will require access to the full termios(3) struct that isn't given
by golang.org/x/term, and, hence, the code needs to be written using the
underlying termios(3) API.

This future code will have enough overlap with the IsTerminal API from
golang.org/x/term that it doesn't make sense to use a separate module
(ie., golang.org/x/term) for it.

containers#752
containers#1263
A subsequent commit will use this to ensure that the user can still
interact with the image download prompt while 'skopeo inspect' fetches
the image size from the remote registry.  To do this, at some point, the
terminal device will be put into non-canonical mode input and the
echoing of input characters will be disabled to retain full control of
the cursor position.

containers#752
containers#1263
A subsequent commit will use this to ensure that the user can still
interact with the image download prompt while 'skopeo inspect' fetches
the image size from the remote registry.  Initially, the prompt will be
shown without the image size.  If the user responds before the size is
fetched, then the pending 'skopeo inspect' will be cancelled.

containers#752
containers#1263
A subsequent commit will use this to ensure that the user can still
interact with the image download prompt while 'skopeo inspect' fetches
the image size from the remote registry.  Initially, the prompt will be
shown without the image size.  If the user responds before the size is
fetched, then the pending 'skopeo inspect' will be cancelled.

containers#752
containers#1263
It takes 'skopeo inspect' a few seconds to fetch the image size from the
remote registry, and while that happens the user can't interact with the
image download prompt:
  $ toolbox create
  Image required to create toolbox container.
  <wait for a few seconds>
  Download registry.fedoraproject.org/fedora-toolbox:39 (359.8MB)? [y/N]:

This feels awkward because it's not clear to the user what's going on
during those few seconds.  Moreover, while knowing the image size can be
convenient at times, for example when disk space and network bandwidth
are limited, it's not always important.

It will be better if 'skopeo inspect' ran in the background, while
waiting for the user to respond to the image download prompt, and once
the image size has been fetched, the image download prompt can be
updated to include it.

So, initially:
  $ toolbox create
  Image required to create toolbox container.
  Download registry.fedoraproject.org/fedora-toolbox:39 ( ... MB)? [y/N]:

... and then once the size is available:
  $ toolbox create
  Image required to create toolbox container.
  Download registry.fedoraproject.org/fedora-toolbox:39 (359.8MB)? [y/N]:

If skopeo(1) is missing or too old, then the prompt can continue without
the size, as it did before:
  $ toolbox create
  Image required to create toolbox container.
  Download registry.fedoraproject.org/fedora-toolbox:39 [y/N]:

The placeholder for the missing image size (ie., ' ... MB') was chosen
to have seven characters, so that it matches the most common sizes.  The
human-readable representation of the image size is capped at four valid
numbers [1].  Unless it's a perfect round number like 1KB or 1.2MB, it
will likely use all four numbers and the decimal point, which is five
characters.  Then two more for the unit, because it's very unlikely that
there will be an image that's less than 1KB in size and will be shown in
bytes with a B.  That makes it seven characters in total.

Updating the image download prompt with the results of 'skopeo inspect'
is vulnerable to races.  At the same time as the terminal's cursor is
being moved to the beginning of the current line to overwrite the
earlier prompt with the new one, the user can keep typing and keep
moving the cursor forward.  This competition over the cursor can lead to
awkward outcomes.

For example, the prompt can overwrite the characters typed in by the
user, leaving characters in the terminal's input buffer waiting for the
user to hit ENTER, even though they are not visible on the screen.
Another example is that hitting BACKSPACE can end up deleting parts of
the prompt, instead of stopping at the edge.

This is solved by putting the terminal device into non-canonical mode
input and disabling the echoing of input characters, while the prompt is
being updated.  This prevents input from moving the terminal's cursor
forward, and from accumulating in the terminal's input buffer even if
it might not be visible.  Any input during this interim period is
discarded and replaced by '...', and a fresh new prompt is shown in the
following line.

In practice, this race shouldn't be too common.  It can only happen if
the user is typing right when the prompt is being updated, which is
unlikely because it's only supposed to be a short 'yes' or 'no' input.

The use of the context.Cause and context.WithCancelCause functions [2]
requires Go >= 1.20.  Bumping the Go version in src/go.mod then requires
a 'go mod tidy'.  Otherwise, it leads to:
  $ meson compile -C builddir --verbose
  ...
  /home/rishi/devel/containers/git/toolbox/src/go-build-wrapper
    /home/rishi/devel/containers/git/toolbox/src
    /home/rishi/devel/containers/git/toolbox/builddir src/toolbox
    0.0.99.4 cc /lib64/ld-linux-x86-64.so.2 false
  go: updates to go.mod needed; to update it:
          go mod tidy
  ninja: build stopped: subcommand failed.

[1] https://pkg.go.dev/github.com/docker/go-units#HumanSize

[2] https://pkg.go.dev/context

containers#752
containers#1263
@debarshiray debarshiray force-pushed the wip/rishi/skopeo-inspect-async branch from 540947f to 5784754 Compare December 16, 2023 18:24
Copy link

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/39e9225fa5914a9abc585589c90bc171

✔️ unit-test SUCCESS in 7m 07s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 10s
✔️ unit-test-restricted SUCCESS in 6m 13s
✔️ system-test-fedora-rawhide SUCCESS in 28m 49s
✔️ system-test-fedora-39 SUCCESS in 26m 28s
✔️ system-test-fedora-38 SUCCESS in 26m 37s

@debarshiray debarshiray merged commit 5784754 into containers:main Dec 16, 2023
3 checks passed
@debarshiray debarshiray deleted the wip/rishi/skopeo-inspect-async branch December 16, 2023 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. CLI Issue is related to the command line interface 2. Host Realm The issue is related to what happens on the host machine where Toolbox is executed 2. Under The Hood Multiple areas of the app are influenced by this ticket 3. Enhancement Improvement to an existing feature 7. Needs tests The work needs new test cases added
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants