Giter Club home page Giter Club logo

Comments (11)

jrtc27 avatar jrtc27 commented on August 22, 2024

That means cat is blocked trying to do a fctl(F_SETLKW) on the METALOG in your rootfs directory. Is your data drive formatted/mounted in a way that would stop that working? Did you kill a previous run and possibly leave that file still locked?

from cheribuild.

jrtc27 avatar jrtc27 commented on August 22, 2024

(specifically, /home/bharadwaj/datadrive/github/src/CHERI/output/rootfs-purecap128/METALOG in your case)

from cheribuild.

jrtc27 avatar jrtc27 commented on August 22, 2024

Ah, you're building a sysroot, so a different output directory, but the METALOG /dev/null also shows it's trying to lock that. You should find that echo foo | cat -l >> /dev/null similarly hangs. Either your /dev/null is broken or something else hasn't released that lock. (Yes, the lock is unnecessary in this very specific case, but it's not worth optimising for that)

from cheribuild.

bharadwajy avatar bharadwajy commented on August 22, 2024

I was wondering about the -l option of the cat command. It is not honored by the cat command on Linux.

$ echo foo | cat -l >> /dev/null
cat: invalid option -- 'l'
Try 'cat --help' for more information.
$ cat -l >> ~/foo
cat: invalid option -- 'l'
Try 'cat --help' for more information.

Do you think it would help if I remove the -l option from cat command? If so, can you point me to the source location?

Thanks!

from cheribuild.

jrtc27 avatar jrtc27 commented on August 22, 2024

Correct, it's a BSDism. If you remove the -l, it will work for building a sysroot, but break horribly when trying to assemble a rootfs for a disk image. That is not the right answer. @arichardson is cat meant to be a bootstrap tool?

from cheribuild.

arichardson avatar arichardson commented on August 22, 2024

@jrtc27 Yes, cat is bootstrapped from the CheriBSD tree. We could modify it to skip locking for /dev/null?

from cheribuild.

jrtc27 avatar jrtc27 commented on August 22, 2024

We could, but that's an upstream FreeBSD issue, and is just unnecessary serialisation. There is a more fundamental bug going on here, given this is meant to work and we have many people successfully using Linux to build CheriBSD.

from cheribuild.

nwf avatar nwf commented on August 22, 2024

FWIW, my cheribuild checkout contains

diff --git a/pycheribuild/projects/cross/cheribsd.py b/pycheribuild/projects/cross/cheribsd.py
index deaa811c..942d384b 100644
--- a/pycheribuild/projects/cross/cheribsd.py
+++ b/pycheribuild/projects/cross/cheribsd.py
@@ -805,7 +805,7 @@ class BuildFreeBSD(BuildFreeBSDBase):
             # By default also create a sysroot when installing world
             installsysroot_args = install_world_args.copy()
             # No need for the files in /usr/share and the METALOG file
-            installsysroot_args.set(NO_SHARE=True, METALOG="/dev/null")
+            installsysroot_args.set(NO_SHARE=True)
             installsysroot_args.set_env(DESTDIR=self.get_corresponding_sysroot())
             if sysroot_only:
                 if not self.has_installsysroot_target:

because I ran into something similar in the past. Apparently the docker daemon has been known to lock /dev/null (e.g., moby/moby#31182). Hilarious.

from cheribuild.

arichardson avatar arichardson commented on August 22, 2024

@nwf could you commit this? I only added the /dev/null to avoid creating a METALOG file in the sysroot.

from cheribuild.

bharadwajy avatar bharadwajy commented on August 22, 2024

FWIW, my cheribuild checkout contains

diff --git a/pycheribuild/projects/cross/cheribsd.py b/pycheribuild/projects/cross/cheribsd.py
index deaa811c..942d384b 100644
--- a/pycheribuild/projects/cross/cheribsd.py
+++ b/pycheribuild/projects/cross/cheribsd.py
@@ -805,7 +805,7 @@ class BuildFreeBSD(BuildFreeBSDBase):
             # By default also create a sysroot when installing world
             installsysroot_args = install_world_args.copy()
             # No need for the files in /usr/share and the METALOG file
-            installsysroot_args.set(NO_SHARE=True, METALOG="/dev/null")
+            installsysroot_args.set(NO_SHARE=True)
             installsysroot_args.set_env(DESTDIR=self.get_corresponding_sysroot())
             if sysroot_only:
                 if not self.has_installsysroot_target:

because I ran into something similar in the past. Apparently the docker daemon has been known to lock /dev/null (e.g., moby/moby#31182). Hilarious.

That change worked for me. Just providing feedback, in case you find it helpful.

Thanks to @jrtc27, @arichardson and @nwf for the quick responses. Really appreciate it.

from cheribuild.

nwf avatar nwf commented on August 22, 2024

@arichardson: Done. Hopefully nobody noticed my tripping over the git UI again. (Sigh.)

from cheribuild.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.