WSL: Unable to build openembedded system LuneOS, error in packaging linux-libc-headers
-
Your Windows build number: Microsoft Windows [Version 10.0.16299.19] (WSL Ubuntu fresh install from store)
-
What you’re doing and what’s happening:
Build instructions for the LuneOS system are here: http://webos-ports.org/wiki/Build_for_Tenderloin
Error text:
ERROR: linux-libc-headers-4.10-r0 do_package: Error executing a python function in exec_python_func() autogenerated:
The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
0001:
*** 0002:sstate_task_postfunc(d)
0003:
File: '/home/eric/build-lune/webos-ports-env/webos-ports/openembedded-core/meta/classes/sstate.bbclass', lineno: 702, function: sstate_task_postfunc
0698:
0699: omask = os.umask(0o002)
0700: if omask != 0o002:
0701: bb.note("Using umask 0o002 (not %0o) for sstate packaging" % omask)
*** 0702: sstate_package(shared_state, d)
0703: os.umask(omask)
0704:
0705: sstateinst = d.getVar("SSTATE_INSTDIR")
0706: d.setVar('SSTATE_FIXMEDIR', shared_state['fixmedir'])
File: '/home/eric/build-lune/webos-ports-env/webos-ports/openembedded-core/meta/classes/sstate.bbclass', lineno: 624, function: sstate_package
0620: for plain in ss['plaindirs']:
0621: pdir = plain.replace(workdir, sstatebuild)
0622: bb.utils.mkdirhier(plain)
0623: bb.utils.mkdirhier(pdir)
*** 0624: os.rename(plain, pdir)
0625:
0626: d.setVar('SSTATE_BUILDDIR', sstatebuild)
0627: d.setVar('SSTATE_PKG', sstatepkg)
0628:
Exception: PermissionError: [Errno 13] Permission denied: '/home/eric/build-lune/webos-ports-env/webos-ports/tmp-glibc/work/armv7ahf-neon-webos-linux-gnueabi/linux-libc-headers/4.10-r0/package' -> '/home/eric/build-lune/webos-ports-env/webos-ports/tmp-glibc/work/armv7ahf-neon-webos-linux-gnueabi/linux-libc-headers/4.10-r0/sstate-build-package//package'
ERROR: linux-libc-headers-4.10-r0 do_package: Function failed: sstate_task_postfunc
ERROR: Logfile of failure stored in: /home/eric/build-lune/webos-ports-env/webos-ports/tmp-glibc/work/armv7ahf-neon-webos-linux-gnueabi/linux-libc-headers/4.10-r0/temp/log.do_package.26018
ERROR: Task (/home/eric/build-lune/webos-ports-env/webos-ports/openembedded-core/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.10.bb:do_package) failed with exit code '1'
This seems to be some kind of permissions error, but I’m not sure what kind of permissions error. This does not occur when following identical instructions on an actual Ubuntu system running 16.04.
This occurs a couple of hours into a system build on my laptop, approximately task #478.
I am not intimately familiar with the OE build system, so advice for tracking down any further specifics would be helpful. I did notice the double “/” on the pathname at the end, the last time I tried to run this, and I attempted to fix that, but it had no effect on the overall outcome. I also tested that double // in paths work correctly, normally, and they seem to.
Building on DrvFS results in a hung process very early in the build process, not sure how to diagnose.
-
What should be happening: it shouldn’t error here, and should complete the OS build.
-
Strace of the failing command: I’ve got a 290MB strace, I could use some direction on how to trim it down specifically to an area that is relevant to the problem
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 2
- Comments: 40 (3 by maintainers)
I guess I come back to this about once a year, give or take. 😄 I wanted to see if newest Windows release (1809) had made any headway on this, so I dug it out again. Stops in exactly the same spots, same packages (linux-libc-headers and base-files). SO, I finally opened up the code that was failing, and swapped out the python “os.rename” call to a “shutil.copy” call, and it has moved from being about 5% successful before failure, to about 15%, and still running without a failure, so far. IF I don’t run out of disk space (i haven’t attempted any of the hacks to move WSL to non-boot-disk yet), it’s looking good. . . but will take several hours to complete. (in WSL it’s moving at a much slower clip than my native Linux box, which is slower, has less memory, and only has a spinning disk… but it’s probably due to the sheer volume of disk access, which we know is a bit slow in WSL)
Duping into #1529. If 1529 flips status and building LuneOS still fails, open a new issue to that effect and we can take another run at it.
Gold star for tenacity on this one 🌟. I think you might be onto something. I saw the
fcntl(21, F_SETFD, FD_CLOEXEC)but convinced myself it didn’t matter. I forgot the kids…Line 685930:
Is there any chance you can test this on Insider 17046? It could be that
FD_CLOEXECisn’t working. But I have another theory…FD_CLOEXECworks, but doesn’t get a chance to work. Because #1878 (message). Thatclone()call should have blocked process 31182 until 31196 exits. But on your WSL build (FCU), it won’t. If therename()in 31182 gets to the fd first – boom. That would explain a lot about your shove threads down the machine’s throat test too.Gotta say, if that does turn out to be the problem, getting from a
CLONE_VMmisbehaviour to aEACCESfail was a long bloody bridge to walk.ok, i think i want to know how you figured that out … and then i think i don’t want to know because it’s probably crazy. 😃
so, just a few lines under the line you point out (line 612749)
There is (line 612771)
According to stackoverflow, this sets a “close-on-exec” flag, which causes the file descriptor to “be automatically (and atomically) closed when any of the exec family functions succeed”.
Then the rename fails at line 714814.
So, 21 is a duplicate of fd 6, line 612747?
6 appears to be line 612733?
So… it looks like that is a handle to …-r0/psuedo/ not -r0/package/ ?
Is CLOEXEC not working or not implemented? Are no exec() calls being executed between here and there? Are the exec() calls not entirely implemented?
(edit: i had originally pinpointed FD 6 to a different file entirely, changed the last of this text quite a bit after I realized I needed to be at a different fd 6)