You are not logged in.

#1 2013-03-12 04:08:03

zuargo
Member
From: Concepción, Chile
Registered: 2009-08-20
Posts: 116

[SOLVED]Building in a Clean Chroot error: Build failed, check ~/build

Hello everyone

I am trying to build qt4 and qtwebkit in clean chroot but when I run makechrootpkg (according to DeveloperWiki:Building in a Clean Chroot) I get an error message:

$  sudo makechrootpkg -c -r /home/zuargo/chroot/
==> Creating clean working copy...done
==> ERROR: Build failed, check /home/zuargo/chroot/zuargo/build

As you see chroot directory is contained in my home folder.
I have checked /home/zuargo/chroot/zuargo/build and I see just the PKGBUILD and another random file (it depends on the package to build). No useful information.

I have made twice the chroot directory and in both times I get the same error.

Does somebody have any idea on how to solve this trouble or how to get information related to the error?

Thanks in advance

Last edited by zuargo (2013-04-19 14:12:53)

Offline

#2 2013-03-12 17:59:13

tdy
Member
From: Sacremende
Registered: 2008-12-14
Posts: 438

Re: [SOLVED]Building in a Clean Chroot error: Build failed, check ~/build

zuargo wrote:
$  sudo makechrootpkg -c -r /home/zuargo/chroot/
==> Creating clean working copy...done
==> ERROR: Build failed, check /home/zuargo/chroot/zuargo/build

Is that really the entirety of the output? There's nothing between the "==> Creating" and "==> ERROR" lines?


dots (or just the awesomewm config)

$ whatis this?
this?: nothing appropriate.

Offline

#3 2013-03-14 03:00:44

zuargo
Member
From: Concepción, Chile
Registered: 2009-08-20
Posts: 116

Re: [SOLVED]Building in a Clean Chroot error: Build failed, check ~/build

Thank you for replying.

Yes, that is the entirety of the output. See the following screenshot:

Image

Offline

#4 2013-03-18 01:50:32

zuargo
Member
From: Concepción, Chile
Registered: 2009-08-20
Posts: 116

Re: [SOLVED]Building in a Clean Chroot error: Build failed, check ~/build

Does nobody have any idea?

Really I don't know how to to get more information about what is happen :'c

Offline

#5 2013-03-18 06:57:19

tdy
Member
From: Sacremende
Registered: 2008-12-14
Posts: 438

Re: [SOLVED]Building in a Clean Chroot error: Build failed, check ~/build

I know you've been following the devwiki, but try to post all of the exact commands you used from the start. Maybe there's something small that was overlooked along the way.

I started from scratch with a new chroot and have no problems building qt4 on my end.


dots (or just the awesomewm config)

$ whatis this?
this?: nothing appropriate.

Offline

#6 2013-03-20 01:43:03

zuargo
Member
From: Concepción, Chile
Registered: 2009-08-20
Posts: 116

Re: [SOLVED]Building in a Clean Chroot error: Build failed, check ~/build

OK, here I go:

I have tried out two methods:

The first one:

1) I make a new directory (chroot) with mkdir in my home folder:

$ mkdir chroot

2) I install the corresponding packages in the chroot directory:

$ sudo mkarchroot ~/chroot/root base base-devel sudo

3) I change the working directory to the folder containing the PKGBUILD and I run makechrootpkg:

$ sudo makechrootpkg -c -r ~/chroot

So, I get the error

Second one:

According to developer wiki:

1) I made a new directory (chroodir) with mkdir in my home folder:

$ CHROOT=$HOME/chroot
$ mkdir $CHROOT

2) I install the corresponding packages in the chroot directory:

sudo mkarchroot $CHROOT/root base base-devel sudo

3) I change the working directory to the folder containing the PKGBUILD and I run makechrootpkg:

sudo makechrootpkg -c -r $CHROOT

Then, I get the error

Thank you so much for your constant replying

Last edited by zuargo (2013-03-21 03:36:14)

Offline

#7 2013-03-21 01:16:55

tdy
Member
From: Sacremende
Registered: 2008-12-14
Posts: 438

Re: [SOLVED]Building in a Clean Chroot error: Build failed, check ~/build

zuargo wrote:
$ sudo mkarchroot ~chroot/root base base-devel sudo

Well I assume "~chroot" is only a forum typo, so I'm not sure why this procedure is failing for you. I don't get any problems on my end.

I guess I would start by adding some debugging lines into /usr/sbin/makechrootpkg. BUILD_FAILED is touched on either line #402 or #438 followed by exiting, so I would echo something before each of those lines to check where the failure occurs.

Maybe someone else will have some better ideas.

Last edited by tdy (2013-03-21 01:19:15)


dots (or just the awesomewm config)

$ whatis this?
this?: nothing appropriate.

Offline

#8 2013-03-26 22:54:31

zuargo
Member
From: Concepción, Chile
Registered: 2009-08-20
Posts: 116

Re: [SOLVED]Building in a Clean Chroot error: Build failed, check ~/build

This is just for bumping the thread to top

Sorry by late answer but I don't know to what I should make echo.

Offline

#9 2013-03-29 03:36:21

zuargo
Member
From: Concepción, Chile
Registered: 2009-08-20
Posts: 116

Re: [SOLVED]Building in a Clean Chroot error: Build failed, check ~/build

bumping the thread to top

Please, I need any idea!!

Offline

#10 2013-03-29 04:02:43

cookies
Member
Registered: 2013-01-17
Posts: 253

Re: [SOLVED]Building in a Clean Chroot error: Build failed, check ~/build

zuargo wrote:

This is just for bumping the thread to top

Just bumping the thread won't help you since we don't get any additional information that way.

Sorry by late answer but I don't know to what I should make echo.

Unfortunately I don't understand your question. Could you rephrase it, please?

Offline

#11 2013-03-29 04:38:59

zuargo
Member
From: Concepción, Chile
Registered: 2009-08-20
Posts: 116

Re: [SOLVED]Building in a Clean Chroot error: Build failed, check ~/build

cookies wrote:
zuargo wrote:

This is just for bumping the thread to top

Just bumping the thread won't help you since we don't get any additional information that way.

Sorry by late answer but I don't know to what I should make echo.

Unfortunately I don't understand your question. Could you rephrase it, please?

user dty on post #7 says:

guess I would start by adding some debugging lines into /usr/sbin/makechrootpkg. BUILD_FAILED is touched on either line #402 or #438 followed by exiting, so I would echo something before each of those lines to check where the failure occurs.

So I ask for "echo" what (whatever), can I insert into the file /usr/sbin/makechrootpkg, before lines 402 and 438?

I hope it is understood

Last edited by zuargo (2013-03-29 04:46:58)

Offline

#12 2013-03-29 04:46:01

cookies
Member
Registered: 2013-01-17
Posts: 253

Re: [SOLVED]Building in a Clean Chroot error: Build failed, check ~/build

I would just echo the line numbers ("echo 402" just before line 402, "echo 438" just before line 438). This way you know where the script exits.

Offline

#13 2013-03-30 15:54:01

zuargo
Member
From: Concepción, Chile
Registered: 2009-08-20
Posts: 116

Re: [SOLVED]Building in a Clean Chroot error: Build failed, check ~/build

Can you be more clear about putting "echo 402" and "echo 438" just before the appointed lines?

Is it something like this?:

cd /build
echo 402
sudo -u nobody makepkg $makepkg_args || touch BUILD_FAILED

[[ -f BUILD_FAILED ]] && exit 1

if $run_namcap; then
	pacman -S --needed --noconfirm namcap
	for pkgfile in /build/PKGBUILD /pkgdest/*.pkg.tar.?z; do
		echo "Checking \${pkgfile##*/}"
		sudo -u nobody namcap "\$pkgfile" 2>&1 | tee "/build/\${pkgfile##*/}-namcap.log"
	done
fi

exit 0
EOF
chmod +x "$copydir/chrootbuild"

if mkarchroot -r "/chrootbuild" "$copydir"; then
	for pkgfile in "$copydir"/pkgdest/*.pkg.tar.?z; do
		if $add_to_db; then
			mkdir -p "$copydir/repo"
			pushd "$copydir/repo" >/dev/null
			cp "$pkgfile" .
			repo-add repo.db.tar.gz "${pkgfile##*/}"
			popd >/dev/null
		fi

		chown "$src_owner" "$pkgfile"
		mv "$pkgfile" "$PKGDEST"
	done

	for l in "$copydir"/build/*-{build,check,namcap,package,package_*}.log; do
		chown "$src_owner" "$l"
		[[ -f $l ]] && mv "$l" .
	done
else
	# Just in case. We returned 1, make sure we fail
echo 438
	touch "$copydir/build/BUILD_FAILED"
fi

Sorry by this, but I am a common user, I studied chemistry, not anything related to computer science, so I have no the knowledge necessary.

Offline

#14 2013-04-03 00:45:24

Allan
Developer
From: Brisbane, AU
Registered: 2007-06-09
Posts: 10,396
Website

Re: [SOLVED]Building in a Clean Chroot error: Build failed, check ~/build

Have you tried using the helper scripts?

sudo extra-i686-build -r /path/to/create/chroot

Offline

#15 2013-04-03 17:52:39

cookies
Member
Registered: 2013-01-17
Posts: 253

Re: [SOLVED]Building in a Clean Chroot error: Build failed, check ~/build

zuargo wrote:

Can you be more clear about putting "echo 402" and "echo 438" just before the appointed lines?

Is it something like this?:

cd /build
echo 402
sudo -u nobody makepkg $makepkg_args || touch BUILD_FAILED

[[ -f BUILD_FAILED ]] && exit 1

[...]

Yes, like this. same for the line below.

Offline

#16 2013-04-04 03:15:56

zuargo
Member
From: Concepción, Chile
Registered: 2009-08-20
Posts: 116

Re: [SOLVED]Building in a Clean Chroot error: Build failed, check ~/build

Allan wrote:

Have you tried using the helper scripts?

sudo extra-i686-build -r /path/to/create/chroot

I get the same error:

==> Building in chroot for [extra] (i686)...
==> Creating clean working copy...done
==> ERROR: Build failed, check /home/zuargo/chroot/extra-i686/zuargo/build

=/

cookies wrote:
zuargo wrote:

Can you be more clear about putting "echo 402" and "echo 438" just before the appointed lines?

Is it something like this?:

cd /build
echo 402
sudo -u nobody makepkg $makepkg_args || touch BUILD_FAILED

[[ -f BUILD_FAILED ]] && exit 1

[...]

Yes, like this. same for the line below.

I get this:

$ sudo makechrootpkg -c -r /home/zuargo/chroot/
==> Creating clean working copy...done
438
==> ERROR: Build failed, check /home/zuargo/chroot/zuargo/build

It seems, "echo 438" is not on the proper line

Offline

#17 2013-04-04 04:41:05

tdy
Member
From: Sacremende
Registered: 2008-12-14
Posts: 438

Re: [SOLVED]Building in a Clean Chroot error: Build failed, check ~/build

zuargo wrote:
$ sudo makechrootpkg -c -r /home/zuargo/chroot/
==> Creating clean working copy...done
438
==> ERROR: Build failed, check /home/zuargo/chroot/zuargo/build

402 is part of the "chrootbuild" heredoc, which I think should be executed on line 418 with mkarchroot -r "/chrootbuild" "$copydir"

It doesn't get to 402, but I'm not sure if A) it enters chrootbuild and somehow breaks before 402 or B) something immediately breaks with the mkarchroot command. Personally I would add a lot more debugging stuff to trace the code execution, but that type of debugging would take quite a while for each step to get relayed+interpreted over a forum.


dots (or just the awesomewm config)

$ whatis this?
this?: nothing appropriate.

Offline

#18 2013-04-06 17:43:38

zuargo
Member
From: Concepción, Chile
Registered: 2009-08-20
Posts: 116

Re: [SOLVED]Building in a Clean Chroot error: Build failed, check ~/build

tdy wrote:
zuargo wrote:
$ sudo makechrootpkg -c -r /home/zuargo/chroot/
==> Creating clean working copy...done
438
==> ERROR: Build failed, check /home/zuargo/chroot/zuargo/build

402 is part of the "chrootbuild" heredoc, which I think should be executed on line 418 with mkarchroot -r "/chrootbuild" "$copydir"

It doesn't get to 402, but I'm not sure if A) it enters chrootbuild and somehow breaks before 402 or B) something immediately breaks with the mkarchroot command. Personally I would add a lot more debugging stuff to trace the code execution, but that type of debugging would take quite a while for each step to get relayed+interpreted over a forum.

Thank you

I think I know where is the problem in /usr/sbin/makechrootpkg. In the appointed file, the line 396, is disabling the commands located between lines 397 and 414. How do I know this? becouse kwrite shows it. Open makechrootpkg with kwrite, now see the text between lines 397 and 414, all commands are not highlighted with any color. Kwrite by default highlights all the functional commands in a document (compare them with the other commands in the file).

This can be confirmed by comment (#) the line 396. If this is done, you will see the commands, between the lines 397 and 414, now are highlighted, it means, now they are functionals.

Moreover, when I comment the line 396, I get other error, this one:

$ sudo makechrootpkg -c -r /home/zuargo/chroot/
==> Creating clean working copy...done
/usr/sbin/makechrootpkg: line 401: cd: /build: No such file or directory
mkdir: cannot create directory '/home/zuargo': Permission denied
==> ERROR: You do not have write permission to create packages in /home/zuargo/Paquetes/qt4.
    Aborting...

Well, now the point is how to fix this. I am thinking to report this as a bug.

Last edited by zuargo (2013-04-06 17:44:51)

Offline

#19 2013-04-06 17:54:24

zuargo
Member
From: Concepción, Chile
Registered: 2009-08-20
Posts: 116

Re: [SOLVED]Building in a Clean Chroot error: Build failed, check ~/build

Sorry, since I am the only one having this issue, I will post some snapshots of kwrite, showing the explained thing above. Not now, I must go.

Offline

#20 2013-04-06 18:05:45

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,092
Website

Re: [SOLVED]Building in a Clean Chroot error: Build failed, check ~/build

The "disabled" code is a heredoc which is written to a file to be later executed... there's nothing particularly wrong with it.

Offline

#21 2013-04-06 20:41:43

zuargo
Member
From: Concepción, Chile
Registered: 2009-08-20
Posts: 116

Re: [SOLVED]Building in a Clean Chroot error: Build failed, check ~/build

falconindy wrote:

The "disabled" code is a heredoc which is written to a file to be later executed... there's nothing particularly wrong with it.

Thank you for replying and explain it.

I made the chroot directory on another partition and I have tried to build the package therein. I get the same error. =/

Offline

#22 2013-04-14 16:45:35

zuargo
Member
From: Concepción, Chile
Registered: 2009-08-20
Posts: 116

Re: [SOLVED]Building in a Clean Chroot error: Build failed, check ~/build

Can someone post their makechrootpkg file here? please. Thanks in advance.

Offline

#23 2013-04-15 04:05:29

tdy
Member
From: Sacremende
Registered: 2008-12-14
Posts: 438

Re: [SOLVED]Building in a Clean Chroot error: Build failed, check ~/build

zuargo wrote:

Can someone post their makechrootpkg file here? please. Thanks in advance.

You can just reinstall devtools, but here is makechrootpkg from devtools-20130408-1


dots (or just the awesomewm config)

$ whatis this?
this?: nothing appropriate.

Offline

#24 2013-04-17 21:23:10

zuargo
Member
From: Concepción, Chile
Registered: 2009-08-20
Posts: 116

Re: [SOLVED]Building in a Clean Chroot error: Build failed, check ~/build

Thank you

I have new information.

Searching for information on the forum (this one) I have found this thread: https://bbs.archlinux.org/viewtopic.php?pid=1260353

The user that started the topic, had (or have) a very similar issue. At the first post, he says has fixed the problem by downgrading the package devtools to the version 20120720. So then, I did the same thing.

I had installed devtools 20130408 and in the cache of Pacman, I have the version 20130127, 20130122, 20121115, 20121027, 20121013, 20120720 of this package. I have downgraded to all these versions of devtools, one by one. In some cases, after downgrading and by creating the chroot directory I got errors, either with the package systemd or with the package filesystem. In the first case, the error did not affect the creation fo the chroot directory. In the second case (with filesystem), creating the directory was not successful, getting an error message (see below).

I proceed to list each devtool package (its version) and the error I have got, when I tried to create the chroot directory:

> devtools-20120720-1-any.pkg.tar.xz

systemd's error:

( 38/130) installing systemd                                               [##########################################] 100%
Initializing machine ID from random generator.
ln -s '/usr/lib/systemd/system/getty@.service' '/etc/systemd/system/getty.target.wants/getty@tty1.service'
:: Append 'init=/usr/lib/systemd/systemd' to your kernel command line in your
   bootloader to replace sysvinit with systemd, or install systemd-sysvcompat

Also an error with lacale-gen:

chroot: failed to run command '/usr/sbin/locale-gen': No such file or directory

Creating chroot directory successful

No error by building packages with makechrootpkg into the chroot directory.

> devtools-20121013-1-any.pkg.tar.xz

filesystem's error:

(  4/130) installing filesystem                                            [##########################################] 100%
error: could not rename /home/zuargo/chroot/root/etc/resolv.conf to /home/zuargo/chroot/root/etc/resolv.conf.pacorig (Device or resource busy)
error: problem occurred while installing filesystem
error: could not commit transaction
error: failed to commit transaction (transaction aborted)
Errors occurred, no packages were upgraded.
==> ERROR: Failed to install packages to new root
==> ERROR: Failed to install all packages

Creating chroot directory was not successful

> devtools-20121027-1-any.pkg.tar.xz

filesystem's error:

(  4/130) installing filesystem                                            [##########################################] 100%
error: could not rename /home/zuargo/chroot/root/etc/resolv.conf to /home/zuargo/chroot/root/etc/resolv.conf.pacorig (Device or resource busy)
error: problem occurred while installing filesystem
error: could not commit transaction
error: failed to commit transaction (transaction aborted)
Errors occurred, no packages were upgraded.
==> ERROR: Failed to install packages to new root
==> ERROR: Failed to install all packages

Creating chroot directory was not successful

> devtools-20121115-1-any.pkg.tar.xz

filesystem's error:

(  4/130) installing filesystem                                            [##########################################] 100%
error: could not rename /home/zuargo/chroot/root/etc/resolv.conf to /home/zuargo/chroot/root/etc/resolv.conf.pacorig (Device or resource busy)
error: problem occurred while installing filesystem
error: could not commit transaction
error: failed to commit transaction (transaction aborted)
Errors occurred, no packages were upgraded.
==> ERROR: Failed to install packages to new root
==> ERROR: Failed to install all packages

Creating chroot directory was not successful

> devtools-20130122-1-any.pkg.tar.xz

systemd's error:

( 38/130) installing systemd                                               [##########################################] 100%
Initializing machine ID from random generator.
ln -s '/usr/lib/systemd/system/getty@.service' '/etc/systemd/system/getty.target.wants/getty@tty1.service'
:: Append 'init=/usr/lib/systemd/systemd' to your kernel command line in your
   bootloader to replace sysvinit with systemd, or install systemd-sysvcompat

Error by building packages with makechrootpkg into the chroot directory:

==> Creating clean working copy...done
==> ERROR: Build failed, check /home/zuargo/chroot/zuargo/build

> devtools-20130127-1-any.pkg.tar.xz

systemd's error:

( 38/130) installing systemd                                               [##########################################] 100%
Initializing machine ID from random generator.
ln -s '/usr/lib/systemd/system/getty@.service' '/etc/systemd/system/getty.target.wants/getty@tty1.service'
:: Append 'init=/usr/lib/systemd/systemd' to your kernel command line in your
   bootloader to replace sysvinit with systemd, or install systemd-sysvcompat
   
Error by building packages with makechrootpkg into the chroot directory:

==> Creating clean working copy...done
==> ERROR: Build failed, check /home/zuargo/chroot/zuargo/build

> devtools-20130408-1-any.pkg.tar.xz

systemd's error:

( 38/130) installing systemd                                               [##########################################] 100%
Initializing machine ID from random generator.
ln -s '/usr/lib/systemd/system/getty@.service' '/etc/systemd/system/getty.target.wants/getty@tty1.service'
:: Append 'init=/usr/lib/systemd/systemd' to your kernel command line in your
   bootloader to replace sysvinit with systemd, or install systemd-sysvcompat

Error by building packages with makechrootpkg into the chroot directory:

==> Creating clean working copy...done
==> ERROR: Build failed, check /home/zuargo/chroot/zuargo/build

As see, the only one package that allows me to build into chroot directory with no errors is devtools-20120720.

Now I can build packages into a clean chroot directory. But I can't update devtools.

Offline

#25 2013-04-18 06:45:44

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 5,151

Re: [SOLVED]Building in a Clean Chroot error: Build failed, check ~/build

Well, looking at the devtools commit log, 20120720 was the last version of devtools to not use systemd-nspawn, so there may be a connection. However, I don't think your problem is the same one I'm experiencing. I've worked around mine with an ugly hack: https://github.com/WorMzy/compilepackag … 2022ab4ba0

I doubt that will help you in any way though.


Sakura:-
Mobo: ASUS P8Z77-V PRO // Processor: Intel Core i7-3770K 3.4GHz // GFX: nVidia GeForce GTX 970 Ti // RAM: 32GB (4x 8GB) Corsair DDR3 (@ 2133MHz) // Storage: 1x 3TB Seagate SATAII 5x 1TB Samsung SATAII, 2x 120GB Corsair SSD

Offline

Board footer

Powered by FluxBB