GithubHelp home page GithubHelp logo

Comments (12)

VovaStelmashchuk avatar VovaStelmashchuk commented on June 19, 2024 1

Yep, I have bash 5 already on my machine. It fixes the issue. Thx.

from custompios.

guysoft avatar guysoft commented on June 19, 2024

Not sure what is going on. Will try and reoroduce.

from custompios.

umlaeute avatar umlaeute commented on June 19, 2024

i cannot reproduce (on Debian/sid).

it might be interesting which bash you are using.

$ which bash
/usr/bin/bash

$ bash --version
GNU bash, version 5.2.15(1)-release (x86_64-pc-linux-gnu)

having said that: the ${MULTIPLE} variable seems to be unused, except for the problematic line

for a in "${MULTIPLE[@]}"; do

so it probably is safe to remove that part of the script

from custompios.

umlaeute avatar umlaeute commented on June 19, 2024

i got hands of a macOS/BigSur machine, and i can now reproduce the problem.

$ which bash
/bin/bash

$ bash --version
GNU bash, version 3.2.57(1)-release (arm64-apple-darwin21)

in the bash changelogs i find

[...]
This document details the changes between this version, bash-5.2-alpha, and
the previous version, bash-5.1-release.
[...]
3. New Features in Bash
[...]
bb. Array references using `@' and `*' that are the value of nameref variables
    (declare -n ref='v[@]' ; echo $ref) no longer cause the shell to exit if
    set -u is enabled and the array (v) is unset.

so maybe this is just requiring a too-new-for-macOS bash version (for something that doesn't get used anyhow...)

OTOH, the incriminated lines where added in 2017, when the current release of bash was bash-4.4.

probably the relevant changelog entry is therefore:

This document details the changes between this version, bash-4.4-rc2, and
the previous version, bash-4.4-beta2.
[...]
3.  New Features in Bash

a.  Using ${a[@]} or ${a[*]} with an array without any assigned elements when
    the nounset option is enabled no longer throws an unbound variable error.

from custompios.

VovaStelmashchuk avatar VovaStelmashchuk commented on June 19, 2024

My current bash 3.2.57, I make a clean setup and attech all my logs here:

➜  hacklab git clone https://github.com/guysoft/CustomPiOS.git
Cloning into 'CustomPiOS'...
remote: Enumerating objects: 4837, done.
remote: Counting objects: 100% (810/810), done.
remote: Compressing objects: 100% (272/272), done.
remote: Total 4837 (delta 590), reused 594 (delta 524), pack-reused 4027
Receiving objects: 100% (4837/4837), 1000.27 KiB | 4.15 MiB/s, done.
Resolving deltas: 100% (2589/2589), done.
➜  hacklab cd CustomPiOS
➜  CustomPiOS git:(devel) which bash
/bin/bash
➜  CustomPiOS git:(devel) bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin23)
Copyright (C) 2007 Free Software Foundation, Inc.
➜  CustomPiOS git:(devel) ./src/make_custom_pi_os -g test
Settings:
making dstro in test
variant: raspios_lite_armhf
./src/make_custom_pi_os: line 36: MULTIPLE[@]: unbound variable
➜  CustomPiOS git:(devel)

from custompios.

VovaStelmashchuk avatar VovaStelmashchuk commented on June 19, 2024

@umlaeute you right, the error throws because i use the old version of bash, currently I update my bash and has the following output. Does the output correct ?

➜  CustomPiOS git:(devel) bash --version
GNU bash, version 5.2.15(1)-release (x86_64-apple-darwin23.0.0)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
➜  CustomPiOS git:(devel) ./src/make_custom_pi_os -g test
Settings:
making dstro in test
variant: raspios_lite_armhf
sed: 1: "config": command c expects \ followed by text
➜  CustomPiOS git:(devel) ✗

from custompios.

umlaeute avatar umlaeute commented on June 19, 2024

hmm, the new failure (assuming that i correctly read your output as a failure), appears to be somewhere in

${SED} -i "s/export DIST_NAME=.*/export DIST_NAME=${DIST_NAME}/g" config
${SED} -i "s/example/${DIST_NAME,,}/g" config

i don't see any obvious invocations of the c command of sed (and the ${DIST_NAME} variable should expand to test, so nothing wrong here either...)

do you have gsed installed? if not, can you also install it (brew install gnu-sed)?

from custompios.

VovaStelmashchuk avatar VovaStelmashchuk commented on June 19, 2024

Thx, the problem fix, after I install gnu-sed.
Now I have problem, with execute sudo ./test/src/build_dist, I have the following error, in build.log

++++ realpath -s /Users/vovastelmashchuk/Desktop/hacklab/CustomPiOS/src/build
realpath: illegal option -- s
usage: realpath [-q] [path ...]
+++ dirname
usage: dirname string [...]
++ BUILD_SCRIPT_PATH=
You have new mail in /var/mail/vovastelmashchuk

It's look like a new issue, can we discuss the issue here or close current discussion and open new github issue ?
Also I think about pull request to project readme with MacOs specific instraction, some think like a pre-condition, min version of bash and gnu-sed

from custompios.

umlaeute avatar umlaeute commented on June 19, 2024

i agree it's probably a new issue.

otoh, it seems that CustomPiOS is probably just not usable on macOS right now.

from custompios.

guysoft avatar guysoft commented on June 19, 2024

Indeed, you could use it via Docker. In general Docker tends to work better if you are on MacOS.

from custompios.

guysoft avatar guysoft commented on June 19, 2024

You could install bash 5 using homebrew.

brew install bash

But then you need to put bash in your path:

/opt/homebrew/bin/bash --version

from custompios.

guysoft avatar guysoft commented on June 19, 2024

Thanks! If you have the time to document or post here in the wiki how to gets stuff working on mac that could help people in the future (or yourself too):
https://github.com/guysoft/CustomPiOS/wiki/Building#building-from-os-x

from custompios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.