redneb / hs-linux-namespaces Goto Github PK
View Code? Open in Web Editor NEWhaskell library to work with linux namespaces
Home Page: https://hackage.haskell.org/package/linux-namespaces
License: BSD 3-Clause "New" or "Revised" License
haskell library to work with linux namespaces
Home Page: https://hackage.haskell.org/package/linux-namespaces
License: BSD 3-Clause "New" or "Revised" License
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
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.