Code Monkey home page Code Monkey logo

hs-linux-namespaces's People

Contributors

redneb avatar sorki avatar wangbj avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

wangbj sorki

hs-linux-namespaces's Issues

fails to build with ghc-9.6

       Building library for linux-namespaces-0.1.3.0..                                                                  [380/157737]
       [1 of 1] Compiling System.Linux.Namespaces                                                                                                                                                                                                                       
       /var/stackage/work/unpack-dir/unpacked/linux-namespaces-0.1.3.0-89f763235d0c9593cd8f6bdea2b8d38cc7d40118e498822417aa8a7d862e6
20c/System/Linux/Namespaces.hsc:133:9: error: [GHC-83865]                                                                           
           • Couldn't match expected type: OpenFileFlags -> IO r                                                                    
                         with actual type: IO Fd                                                                                    
           • The function ‘openFd’ is applied to four value arguments,                                                              
               but its type ‘FilePath -> OpenMode -> OpenFileFlags -> IO Fd’                                                        
               has only three                                                                                                       
             In the second argument of ‘($)’, namely                                                                                
               ‘openFd path ReadOnly Nothing defaultFileFlags {nonBlock = True}’                                                    
             In the expression:                                                                                                     
               ioeSetLoc "enterNamespace"                                                                                           
                 $ openFd path ReadOnly Nothing defaultFileFlags {nonBlock = True}                                                  
           • Relevant bindings include                                                                                              
               openFd' :: IO r (bound at System/Linux/Namespaces.hsc:132:5)                                                         
           |                                                                                                                        
       133 |         openFd path ReadOnly Nothing defaultFileFlags {nonBlock = True}                                                
           |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                
                                                                                                                                    
       /var/stackage/work/unpack-dir/unpacked/linux-namespaces-0.1.3.0-89f763235d0c9593cd8f6bdea2b8d38cc7d40118e498822417aa8a7d862e6
20c/System/Linux/Namespaces.hsc:133:30: error: [GHC-83865]
           • Couldn't match expected type ‘OpenFileFlags’
                         with actual type ‘Maybe a1’
           • In the third argument of ‘openFd’, namely ‘Nothing’
             In the second argument of ‘($)’, namely
               ‘openFd path ReadOnly Nothing defaultFileFlags {nonBlock = True}’
             In the expression:
               ioeSetLoc "enterNamespace"
                 $ openFd path ReadOnly Nothing defaultFileFlags {nonBlock = True}
           |
       133 |         openFd path ReadOnly Nothing defaultFileFlags {nonBlock = True}
           |                              ^^^^^^^
        
       /var/stackage/work/unpack-dir/unpacked/linux-namespaces-0.1.3.0-89f763235d0c9593cd8f6bdea2b8d38cc7d40118e498822417aa8a7d862e6
20c/System/Linux/Namespaces.hsc:218:14: error: [GHC-83865]
           • Couldn't match expected type: OpenFileFlags -> IO Fd
                         with actual type: IO Fd
           • The function ‘openFd’ is applied to four value arguments,
               but its type ‘FilePath -> OpenMode -> OpenFileFlags -> IO Fd’
               has only three

RTS ticker thread can cause trouble

Recently I found that a testsuite using this package started failing with unshare: invalid argument but I wasn't sure what was going on as command line unshare worked just fine. Comparing both calls I didn't see much difference but then stumbled on clone3 call done by GHC forking a process called ghc_ticker. The use of ticker seems to depend on compile time options and availability of packages during GHC build.

Some more info https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/rts/signals#the-rts-timer-signal

This started manifesting in CI which used latest Ubuntu and on NixOS as well.

The fix is to disable the timer with

ghc-options:       -rtsopts "-with-rtsopts -V0"

From help:

hnix-store-remote-tests:   -V<secs>  Master tick interval in seconds (0 == disable timer).
hnix-store-remote-tests:             This sets the resolution for -C and the heap profile timer -i,
hnix-store-remote-tests:             and is the frequency of time profile samples.
hnix-store-remote-tests:             Default: 0.01 sec.

Should we add this to the comments (or README) that already mention issues with -threaded?

During the debugging I've also extracted the example to separate cabal executable - want a PR? I can also PR a simple testsuite + CI if you want.

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.