Mach XFree86 build error - preferred workaround?
Thomas Vander Stichele
thomas at apestaart.org
Fri Mar 5 10:32:01 UTC 2004
On Thu, 2004-03-04 at 23:03, John Dalbec wrote:
> Building XFree86 fails with:
>
> egrep: /proc/stat: no such file or directory
Can you check if proc gets mounted when you go inside the chroot ?
(I still need a good clean solution for /proc and its contents; mounting
it is bad, and not mounting it is bad too :))
> This is the offending section of the .spec file:
>
> %if %{ParallelBuild}
> numprocs=$(( $(egrep -c ^cpu[0-9]+ /proc/stat || :) * 2 ))
> [ "$numprocs" = "0" ] && numprocs=1
> echo "PARALLEL MAKE ENABLED: numprocs=$numprocs"
> %else
> numprocs=1
> %endif
Hm, that looks wonky. I wouldn't use code like this.
Here's what mach uses to check number of cpu's:
if not os.environ.has_key('RPM_BUILD_NCPUS'):
nrcpus =
os.popen('/usr/bin/getconf_NPROCESSORS_ONLN').read().rstrip()
else:
nrcpus = os.environ['RPM_BUILD_NCPUS']
also, I don't see the rest of the spec file, so not sure what you're
trying to achieve there. But, in general, a spec file should just do
make %{_smp_flags}
> Is there a mach-compatible way to accomplish the same thing?
>
> Should I add /proc/stat as a BuildRequires?
Ugh, no :) I don't think that would work, /proc is not a real
filesystem.
> I'm trying various workarounds to be able to access /proc/stat, but it doesn't
> help that the build is run as a non-root user. My latest attempt is to add
> "none /proc proc defaults,user 0 0" to /etc/fstab and add the "mount" commands
> below:
>
> %if %{ParallelBuild}
> [ -f /proc/stat ] || mount /proc || mount /proc -o remount || :
> numprocs=$(( $(egrep -c ^cpu[0-9]+ /proc/stat || :) * 2 ))
> [ "$numprocs" = "0" ] && numprocs=1
> echo "PARALLEL MAKE ENABLED: numprocs=$numprocs"
> %else
> numprocs=1
> %endif
that's hacking around the actual problem. Let's try to fix it in a
clean way; no spec file should ever try to mount stuff.
> The remount is because /etc/mtab seems to have mount entries for /proc already.
> My workaround appears to have worked. At least the scrolling is much faster
> now.
What do you mean, scrolling is much faster ?
> Does mach require a terminal?
I'm pretty sure that the terminal inside the chroot is not set
correctly, but I never figured out which I'm supposed to use anyway. If
anyone can tell me what TERM should be set to, feel free. I don't think
it's a big problem though atm.
> I tried redirecting stdout and stderr and I still
> got status messages printed to the terminal.
You did this from inside the chroot then ?
> I've closed my SSH window. Will
> mach wait for TTY output all night instead of building the package?
Can you give me some more background as to what exactly you're doing ?
I'm getting the feeling you're using it differently than what I usually
do. That's not necessarily bad, I'm just not sure if you're using it in
a way that I've actually made to work :)
Thomas
Dave/Dina : future TV today ! - http://www.davedina.org/
<-*- thomas (dot) apestaart (dot) org -*->
Welcome to Hits City, Jeff K - Population: you
<-*- thomas (at) apestaart (dot) org -*->
URGent, best radio on the net - 24/7 ! - http://urgent.fm/
More information about the fedora-legacy-list
mailing list