[Solved] 31 Build Failure on Debian 9.13

For discussion of topics specific to MythTV on linux
Post Reply
kbocek
Senior
Posts: 201
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

[Solved] 31 Build Failure on Debian 9.13

Post by kbocek »

Trying to compile 31 on Debian 9.13. Running ' ./build-debs.sh fixes/31' yeilds:

Code: Select all

Missing build dependencies for mythtv, will install them now:
./build-debs.sh: line 235: root: unbound variable
The script says it will install dependencies but I've had to do that manually. I just don't know what's required here.
Last edited by kbocek on Thu Jul 23, 2020 4:11 pm, edited 1 time in total.
kbocek
Senior
Posts: 201
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

Re: 31 Build Failure on Debian 9.13

Post by kbocek »

Nothing? Is anyone on Debian? Any way to list dependencies so I can manually install them?
User avatar
bill6502
Developer
Posts: 2323
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: 31 Build Failure on Debian 9.13

Post by bill6502 »

Use Ansible, the buildbots do, although Debian 9 (Stretch) is no longer being built there
(https://wiki.debian.org/LTS).

https://www.mythtv.org/wiki/Build_from_ ... th_Ansible
kbocek
Senior
Posts: 201
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

Re: 31 Build Failure on Debian 9.13

Post by kbocek »

I am unfamiliar with ansible. But following the instruction:
https://github.com/MythTV/ansible

Running the command

Code: Select all

sudo ansible-playbook -i hosts qt5.yml
Yields:

Code: Select all

ERROR! The field 'loop' is supposed to be a string type, however the incoming data structure is a <class 'ansible.parsing.yaml.objects.AnsibleSequence'>

The error appears to have been in '/root/ansible/roles/mythtv-macports/tasks/main.yml': line 114, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name: select the installed version of python
  ^ here
kbocek
Senior
Posts: 201
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

Re: 31 Build Failure on Debian 9.13

Post by kbocek »

I got it to work by commenting out the mythtv-macports line in qt5.yml.
Last edited by kbocek on Thu Jul 23, 2020 3:45 pm, edited 1 time in total.
kbocek
Senior
Posts: 201
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

Re: 31 Build Failure on Debian 9.13

Post by kbocek »

Shoot. Still getting an error in build-debs.sh:

Code: Select all

Missing build dependencies for mythtv, will install them now:
./build-debs.sh: line 235: root: unbound variable
kbocek
Senior
Posts: 201
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

[Solved] 31 Build Failure on Debian 9.13

Post by kbocek »

I fixed it by removing the $root variable from build-debs.sh line 235 and running that script as root. Dependencies were installed. 31 is compiling now.
User avatar
bill6502
Developer
Posts: 2323
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: 31 Build Failure on Debian 9.13

Post by bill6502 »

It's an Ansible version issue. loop: was introduced in 2.5.
with_list: is the 'old' way. Thanks for mentioning that. Fix pushed.

The check for 'sudo' has been around since last August. I don't have
a pure Debian host to test, but do these two work in Stretch?

Code: Select all

$ id -ru ; echo $?
1000
0
$ command -v sudo ; echo $?
/usr/bin/sudo
0
Looks like that code should fail (die) if not run as root and sudo isn't available.
User avatar
pgbennett
Developer
Posts: 504
Joined: Mon Apr 27, 2015 5:41 pm
United States of America

Re: [Solved] 31 Build Failure on Debian 9.13

Post by pgbennett »

Normally an unbound variable silently evaluates to null, unless you have set the '-u' option. I suspect that somewhere you have "set -u", perhaps in .profile or .bashrc.

You could solve that by running "set +u" before building, or removing "set -u" from wherever it is set.

Also it looks like $root is provided to help you if you don't want to run build under root. You could set root to sudo so that only the necessary parts run under root.
export root=sudo
kbocek
Senior
Posts: 201
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

Re: [Solved] 31 Build Failure on Debian 9.13

Post by kbocek »

I was running this as the root user. Looking at /root/.bashrc I don't see any "set -u". However as I said it compiled fine with my fix.
kbocek
Senior
Posts: 201
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

Re: [Solved] 31 Build Failure on Debian 9.13

Post by kbocek »

Bill your two commands give:

Code: Select all

root@myth:~# id -ru ; echo $?
0
0
root@myth:~# command -v sudo ; echo $?
/usr/bin/sudo
0
User avatar
bill6502
Developer
Posts: 2323
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: [Solved] 31 Build Failure on Debian 9.13

Post by bill6502 »

Sounds llike Peter identified the issue: set -e -u is the 2nd line of build-debs.sh

Does setting root just before it's supposed to be set help:

Code: Select all

diff --git a/deb/build-debs.sh b/deb/build-debs.sh
index 7620e86..9680025 100755
--- a/deb/build-debs.sh
+++ b/deb/build-debs.sh
@@ -112,6 +112,8 @@ case "$GIT_BRANCH" in
        ;;
 esac
 
+root=""
+
 if [ "$(id -ru)" -ne 0 ]; then
        if have sudo; then
                root=sudo
Last edited by bill6502 on Thu Jul 23, 2020 7:42 pm, edited 1 time in total.
Reason: Removed spaces from proposed fix, tnx PB
User avatar
pgbennett
Developer
Posts: 504
Joined: Mon Apr 27, 2015 5:41 pm
United States of America

Re: [Solved] 31 Build Failure on Debian 9.13

Post by pgbennett »

You can't have spaces when setting a variable
It will have to be be
root=""
Post Reply