Skip to content

fix(bash): Fix bash tests.#24

Merged
marckhouzam merged 1 commit intomarckhouzam:mainfrom
JeffFaer:fix_bash
Nov 4, 2024
Merged

fix(bash): Fix bash tests.#24
marckhouzam merged 1 commit intomarckhouzam:mainfrom
JeffFaer:fix_bash

Conversation

@JeffFaer
Copy link
Copy Markdown
Contributor

testprog was failing with "cannot execute: required file not found". Some Google sleuthing found that it was probably because libc6 was missing.

Redhat has a similar error where it was complaining that glibc v2.32 was missing. ubi8 only seemed to be able to install v2.28, but ubi9 runs testprog without any other tweaks.

@marckhouzam
Copy link
Copy Markdown
Owner

Thanks @JeffFaer .
Can you tell me how to reproduce the problem? On my Mac I don't see any problems when I run make bash

@JeffFaer
Copy link
Copy Markdown
Contributor Author

Oh, interesting. I'm not running on a mac, so that could be it. What container engine are you using? What version of Go do you have installed?

$ uname -a
Linux 6.5.0-17-generic #17~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 16 14:32:32 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
$ docker version
Client:
 Version:           24.0.5
 API version:       1.43
 Go version:        go1.20.3
 Git commit:        24.0.5-0ubuntu1~22.04.1
 Built:             Mon Aug 21 19:50:14 2023
 OS/Arch:           linux/amd64
 Context:           default

Server:
 Engine:
  Version:          24.0.5
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.3
  Git commit:       24.0.5-0ubuntu1~22.04.1
  Built:            Mon Aug 21 19:50:14 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.2
  GitCommit:        
 runc:
  Version:          1.1.7-0ubuntu1~22.04.2
  GitCommit:        
 docker-init:
  Version:          0.19.0
  GitCommit:        
$ go version
go version go1.22.0 linux/amd64

@marckhouzam
Copy link
Copy Markdown
Owner

marckhouzam commented Mar 20, 2024

I tried with go 1.21.8, 1.22.0 and 1.22.1 and it worked each time.

$ uname -a
Darwin REDACTED 23.4.0 Darwin Kernel Version 23.4.0: Wed Feb 21 21:44:43 PST 2024; root:xnu-10063.101.15~2/RELEASE_ARM64_T6000 arm64
$ docker version
Client:
 Cloud integration: v1.0.31
 Version:           20.10.23
 API version:       1.41
 Go version:        go1.18.10
 Git commit:        7155243
 Built:             Thu Jan 19 17:35:19 2023
 OS/Arch:           darwin/arm64
 Context:           desktop-linux
 Experimental:      true

Server: Docker Desktop 4.17.0 (99724)
 Engine:
  Version:          20.10.23
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.18.10
  Git commit:       6051f14
  Built:            Thu Jan 19 17:31:28 2023
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.6.18
  GitCommit:        2456e983eb9e37e47538f59ea18f2043c9a73640
 runc:
  Version:          1.1.4
  GitCommit:        v1.1.4-0-g5fd4c4d
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
$ go version
go version go1.21.8 darwin/arm64

@JeffFaer
Copy link
Copy Markdown
Contributor Author

Sounds like this might be a difference between Mac and Linux then. Do you have any Linux/Ubuntu machines you can try this on?

I did manage to reproduce this on a different, Debian machine.

testprog was failing with "cannot execute: required file not found".
Some Google sleuthing found that it was probably because libc6 was
missing.

Redhat has a similar error where it was complaining that glibc v2.32 was
missing. ubi8 only seemed to be able to install v2.28, but ubi9 runs
testprog without any other tweaks.

Signed-off-by: Jeffrey Faer <jeffrey.faer@gmail.com>
@marckhouzam
Copy link
Copy Markdown
Owner

Can provide the error you are seeing? Actually the commands leading up to the error would also help

@JeffFaer
Copy link
Copy Markdown
Contributor Author

JeffFaer commented Mar 21, 2024

$ cd $(mktemp -d)
$ git clone https://github.com/spf13/cobra.git
$ git clone https://github.com/marckhouzam/cobra-completion-testing.git
$ cd cobra-completion-testing/
$ make bash
<output in https://gist.github.com/JeffFaer/9254a0920c2af16641edefbb4ddf8c6c>

https://gist.github.com/JeffFaer/9254a0920c2af16641edefbb4ddf8c6c

To debug this, I played around with the docker images to see why it didn't seem like anything was happening:

$ ./testprog/bin/testprog help
Usage:
  testprog [flags]
  testprog [command]
...
$ docker run -it --entrypoint /bin/bash comp-test:bash5
2f35045c85f7:/work# ./testprog/bin/testprog help
bash: ./testprog/bin/testprog: cannot execute: required file not found

Copy link
Copy Markdown
Owner

@marckhouzam marckhouzam left a comment

Choose a reason for hiding this comment

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

This doesn't break anything for me, so if it helps in your case, although I wasn't able to reproduce, I'm going to merge it.

@marckhouzam marckhouzam merged commit 7090ba4 into marckhouzam:main Nov 4, 2024
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.

2 participants