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

./.ci/ubuntu/gha-setup.sh does not work on mac #12

Closed
Gsantomaggio opened this issue Jul 3, 2024 · 7 comments · Fixed by #16
Closed

./.ci/ubuntu/gha-setup.sh does not work on mac #12

Gsantomaggio opened this issue Jul 3, 2024 · 7 comments · Fixed by #16
Assignees
Labels
bug Something isn't working

Comments

@Gsantomaggio
Copy link
Member

Describe the bug

The command ./.ci/ubuntu/gha-setup.sh does not work on mac

.

Reproduction steps

+++ dirname ./.ci/ubuntu/gha-setup.sh
++ cd ./.ci/ubuntu
++ pwd
+ script_dir=... rabbitmq-amqp-dotnet-client/.ci/ubuntu
+ readonly script_dir
+ echo '[INFO] script_dir: '\''....rabbitmq-amqp-dotnet-client/.ci/ubuntu'\'''
[INFO] script_dir: '.../rabbitmq-amqp-dotnet-client/.ci/ubuntu'
+ readonly rabbitmq_image=pivotalrabbitmq/rabbitmq:main
+ rabbitmq_image=pivotalrabbitmq/rabbitmq:main
+ readonly docker_name_prefix=rabbitmq-amqp-dotnet-client
+ docker_name_prefix=rabbitmq-amqp-dotnet-client
+ readonly docker_network_name=rabbitmq-amqp-dotnet-client-network
+ docker_network_name=rabbitmq-amqp-dotnet-client-network
./.ci/ubuntu/gha-setup.sh: line 15: conditional binary operator expected

Expected behavior

execute the docker image

Additional context

@lukebakken atm, I can't have a look at it! If you have time, can you please check it?

@Gsantomaggio Gsantomaggio added the bug Something isn't working label Jul 3, 2024
@lukebakken
Copy link
Contributor

lukebakken commented Jul 3, 2024

What version of bash are you using? It's very odd for this line to cause that issue:

if [[ ! -v GITHUB_ACTIONS ]]

UPDATE - your bash is too old - https://stackoverflow.com/questions/63559089/bash-v-xxx-test-failed-in-login-shell

Can you run which -a bash? I suspect I should change the shebang to #!/usr/bin/env bash

@Gsantomaggio
Copy link
Member Author

➜  rabbitmq-amqp-dotnet-client git:(main) ✗ bash --version
GNU bash, version 3.2.57(1)-release (arm64-apple-darwin23)
Copyright (C) 2007 Free Software Foundation, Inc.

Reading around, it seems that Apple doesn't update the bash version due to license problem

I'd want to avoid forcing future users to update the shell. is it possible to make it compatible with 3.x?

@lukebakken
Copy link
Contributor

lukebakken commented Jul 3, 2024

Ugh the current version of bash is 5.2!!! Ubuntu 22 ships with bash version 5.1, for instance.

Here are our options:

  • Require OS X users to install bash via homebrew. My guess is that almost everyone already does this (except you apparently! 😆)
  • Change the scripts to use sh syntax.

@Gsantomaggio
Copy link
Member Author

Will update 😀

@Gsantomaggio
Copy link
Member Author

➜  rabbitmq-amqp-dotnet-client git:(main) ✗ bash --version
GNU bash, versione 5.2.26(1)-release (aarch64-apple-darwin23.2.0)
Copyright (C) 2022 Free Software Foundation, Inc.
Licenza GPLv3+: GNU GPL versione 3 o successiva <http://gnu.org/licenses/gpl.html>

and..

....+ readonly docker_network_name=rabbitmq-amqp-dotnet-client-network
+ docker_network_name=rabbitmq-amqp-dotnet-client-network
+ [[ ! -v GITHUB_ACTIONS ]]
+ GITHUB_ACTIONS=false
+ [[ -d '' ]]
++ readlink --canonicalize-existing /Users/gsantomaggio/git/rabbitmq-pro/rabbitmq-amqp-dotnet-client/.ci/ubuntu/../..
readlink: illegal option -- -
usage: readlink [-fn] [file ...]
+ GITHUB_WORKSPACE=
➜  rabbitmq-amqp-dotnet-client git:(main) ✗

Looking why!

@lukebakken
Copy link
Contributor

lol you are finding all of the issues with OS X today! I'm assuming you don't have readlink, or it is the BSD version. We can change that.

@Gsantomaggio
Copy link
Member Author

With greadlink works.

It would be better if we could remove/change readlink ; then, it should work everywhere!

lukebakken added a commit that referenced this issue Jul 3, 2024
lukebakken added a commit that referenced this issue Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants