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

template build error: ./functions.sh: line 170: declare: GLOBAL_CACHE: not found #1089

Closed
adrelanos opened this Issue Jul 29, 2015 · 8 comments

Comments

Projects
None yet
3 participants
@adrelanos
Member

adrelanos commented Jul 29, 2015

[user@qubes-build qubes-builder]$ make template                                                                                                              
Exporting indices...                                                                                                                                         
Exporting indices...                                                                                                                                         
Exporting indices...                                                                                                                                         
Exporting indices...                                                                                                                                         
Exporting indices...
Exporting indices...
Exporting indices...
Exporting indices...
Exporting indices...
Exporting indices...
Exporting indices...
Building template: jessie-minimal
+ . ./builder_setup
++ SCRIPTSDIR=/home/user/qubes-builder/qubes-src/builder-debian/template_debian
++ '[' '!' -d /home/user/qubes-builder/qubes-src/builder-debian/template_debian ']'
++ '[' -z /home/user/qubes-builder/cache/jessie ']'
++ export SCRIPTSDIR CACHEDIR
+ . ./umount_kill.sh
++ . ./functions.sh
+++ set -e
+++ VERBOSE=1
+++ DEBUG=1
+++ . ./functions-name.sh
++++ set -e
++++ VERBOSE=1
++++ DEBUG=1
+++ XTRACE=
+++ '[' '!' '' = true ']'
+++ colors
+++ [[ -t 2 ]]
+++ export build_already_defined_colors=true
+++ build_already_defined_colors=true
+++ '[' 1 -ge 2 -o 1 == 1 ']'
+++ output 'INFO: Currently running script: ./prepare_image'
+++ '[' 1 -ge 1 ']'
+++ [[ -z '' ]]
+++ [[ ehB != ehxB ]]
+++ basename ./prepare_image
++ '[' prepare_image == umount_kill.sh -a prepared_images/jessie-minimal.img ']'
+ '[' 1 -eq 1 ']'
+ '[' 1 == 1 ']'
+ export 'YUM_OPTS= -q'
+ YUM_OPTS=' -q'
++ readlink -m mnt
+ export INSTALLDIR=/home/user/qubes-builder/qubes-src/linux-template-builder/mnt
+ INSTALLDIR=/home/user/qubes-builder/qubes-src/linux-template-builder/mnt
+ mkdir -p /home/user/qubes-builder/qubes-src/linux-template-builder/mnt
+ echo '-> Preparing instalation of jessie template...'
-> Preparing instalation of jessie template...
+ /home/user/qubes-builder/qubes-src/builder-debian/template_debian/00_prepare.sh
INFO: Currently running script: /home/user/qubes-builder/qubes-src/builder-debian/template_debian/00_prepare.sh
INFO: /home/user/qubes-builder/qubes-src/builder-debian/template_debian/distribution.sh imported by: /home/user/qubes-builder/qubes-src/builder-debian/template_debian/00_prepare.sh
Attempting to kill any processes still running in '/home/user/qubes-builder/qubes-src/linux-template-builder/mnt' before un-mounting
INFO: Locating buildStep files: 00_prepare.sh suffix: pre
./functions.sh: line 170: declare: GLOBAL_CACHE: not found
Removing stale or incomplete prepared_images/jessie-minimal.img
Attempting to kill any processes still running in '/home/user/qubes-builder/qubes-src/linux-template-builder/mnt' before un-mounting
INFO: umount /home/user/qubes-builder/qubes-src/linux-template-builder/mnt
Attempting to kill any processes still running in '/home/user/qubes-builder/qubes-src/linux-template-builder/mnt' before un-mounting
INFO: Locating buildStep files: 00_prepare.sh suffix: post
./functions.sh: line 170: declare: GLOBAL_CACHE: not found
+ '[' -f prepared_images/jessie-minimal.img ']'
+ echo '-> Initializing empty image...'
-> Initializing empty image...
+ truncate -s 10G prepared_images/jessie-minimal.img
+ echo '-> Creating filesystem...'
-> Creating filesystem...
+ mkfs.ext4 -q -F prepared_images/jessie-minimal.img
+ mount -o loop prepared_images/jessie-minimal.img /home/user/qubes-builder/qubes-src/linux-template-builder/mnt
++ readlink -m /home/user/qubes-builder/qubes-src/linux-template-builder/mnt
+ trap 'umount_kill /home/user/qubes-builder/qubes-src/linux-template-builder/mnt' EXIT
+ /home/user/qubes-builder/qubes-src/builder-debian/template_debian/01_install_core.sh
INFO: Currently running script: /home/user/qubes-builder/qubes-src/builder-debian/template_debian/01_install_core.sh
INFO: /home/user/qubes-builder/qubes-src/builder-debian/template_debian/distribution.sh imported by: /home/user/qubes-builder/qubes-src/builder-debian/template_debian/01_install_core.sh
DEBUG: Installing base system using debootstrap
INFO: Locating buildStep files: 01_install_core.sh suffix: pre
./functions.sh: line 170: declare: GLOBAL_CACHE: not found
INFO: jessie-minimal: Installing base 'debian-jessie' system
/home/user/qubes-builder/qubes-src/builder-debian/template_debian/01_install_core.sh: line 24: debootstrap: command not found
ERROR: Debootstrap failed!
+ umount_kill /home/user/qubes-builder/qubes-src/linux-template-builder/mnt
++ getXtrace
++ [[ hB != hxB ]]
++ echo 0
+ local xtrace=0
+ set +x
Attempting to kill any processes still running in '/home/user/qubes-builder/qubes-src/linux-template-builder/mnt' before un-mounting
INFO: umount /home/user/qubes-builder/qubes-src/linux-template-builder/mnt
Makefile:47: recipe for target 'rootimg-build' failed
make[1]: *** [rootimg-build] Error 1
Makefile:279: recipe for target 'template-local-jessie+minimal+no-recommends' failed
make: *** [template-local-jessie+minimal+no-recommends] Error 1
[user@qubes-build qubes-builder]$
@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jul 29, 2015

Member

@nrgaway can you look at this?

Member

marmarek commented Jul 29, 2015

@nrgaway can you look at this?

@nrgaway

This comment has been minimized.

Show comment
Hide comment
@nrgaway

nrgaway Jul 29, 2015

Yes, never seen that error before; looking into it right now...

nrgaway commented Jul 29, 2015

Yes, never seen that error before; looking into it right now...

@nrgaway

This comment has been minimized.

Show comment
Hide comment
@nrgaway

nrgaway Jul 29, 2015

debootstrap is not installed. Run make install-deps before make qubes-vm; and template.

I do see the GLOBAL_CACHE error which is unrelated I believe.

nrgaway commented Jul 29, 2015

debootstrap is not installed. Run make install-deps before make qubes-vm; and template.

I do see the GLOBAL_CACHE error which is unrelated I believe.

@nrgaway

This comment has been minimized.

Show comment
Hide comment
@nrgaway

nrgaway Jul 29, 2015

I have a fix for the ./functions.sh: line 170: declare: GLOBAL_CACHE: not found error message which just suppressed it (2> /dev/null) if array does not exist which will not effect results as that line just returns the data within the array, which will be nothing if it does not exist globally yet.

I will commit once the rounds of template build testing is complete

nrgaway commented Jul 29, 2015

I have a fix for the ./functions.sh: line 170: declare: GLOBAL_CACHE: not found error message which just suppressed it (2> /dev/null) if array does not exist which will not effect results as that line just returns the data within the array, which will be nothing if it does not exist globally yet.

I will commit once the rounds of template build testing is complete

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jul 29, 2015

Member

Take a look at #1088 - it will still break the build when set -x will be implemented in all the scripts.

Member

marmarek commented Jul 29, 2015

Take a look at #1088 - it will still break the build when set -x will be implemented in all the scripts.

@nrgaway

This comment has been minimized.

Show comment
Hide comment
@nrgaway

nrgaway Jul 29, 2015

Ok, I will test with @adrelanos patch in place

nrgaway commented Jul 29, 2015

Ok, I will test with @adrelanos patch in place

@nrgaway

This comment has been minimized.

Show comment
Hide comment
@nrgaway

nrgaway Jul 29, 2015

It worked with patch in place as functions.sh already sets +e and +x if DEBUG or VERBOSE >= 2, but I still added an additional gaurd (|| true)

The error message ./functions.sh: line 170: declare: GLOBAL_CACHE: not found did not cause build failure; missing depend of debootstrap did.

setArrayAsGlobal() {
    local array="$1"
    local export_as="$2"
    #local code=$(declare -p "$array")  # Original line; now replaced with line below
    local code=$(declare -p "$array" 2> /dev/null || true)  # This was line causing error
    local replaced="${code/$array/$export_as}"
    eval ${replaced/declare -/declare -g}
}

Restarted template re-build tests

nrgaway commented Jul 29, 2015

It worked with patch in place as functions.sh already sets +e and +x if DEBUG or VERBOSE >= 2, but I still added an additional gaurd (|| true)

The error message ./functions.sh: line 170: declare: GLOBAL_CACHE: not found did not cause build failure; missing depend of debootstrap did.

setArrayAsGlobal() {
    local array="$1"
    local export_as="$2"
    #local code=$(declare -p "$array")  # Original line; now replaced with line below
    local code=$(declare -p "$array" 2> /dev/null || true)  # This was line causing error
    local replaced="${code/$array/$export_as}"
    eval ${replaced/declare -/declare -g}
}

Restarted template re-build tests

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Jul 29, 2015

Member

debootstrap is not installed. Run make install-deps before make qubes-vm; and template.

True. Created QubesOS/qubes-builder-debian#1 for it.

Member

adrelanos commented Jul 29, 2015

debootstrap is not installed. Run make install-deps before make qubes-vm; and template.

True. Created QubesOS/qubes-builder-debian#1 for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment