Issue 350 in xmonad: Investigate using Dyre for xmonad configuration

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue 350 in xmonad: Investigate using Dyre for xmonad configuration

codesite-noreply@google.com
Status: Accepted
Owner: gwern0
Labels: Milestone-Release1.0

New issue 350 by SpencerJanssen: Investigate using Dyre for xmonad  
configuration
http://code.google.com/p/xmonad/issues/detail?id=350

http://hackage.haskell.org/package/dyre

Things we need to know before switching:
  * Can we make the transition seamless for our users?  This means the
config file format, location remain unchanged.
  * Is the maintainer available and cooperative?  Will bug reports and
patches be attended to in a timely manner?


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
Reply | Threaded
Open this post in threaded view
|

Re: Issue 350 in xmonad: Investigate using Dyre for xmonad configuration

codesite-noreply@google.com

Comment #1 on issue 350 by gwern0: Investigate using Dyre for xmonad  
configuration
http://code.google.com/p/xmonad/issues/detail?id=350

Looking at some of the opts, shouldn't be too hard.

<a href="http://hackage.haskell.org/packages/archive/dyre/0.8.2/doc/html/Config-Dyre.html#v%">http://hackage.haskell.org/packages/archive/dyre/0.8.2/doc/html/Config-Dyre.html#v%
3AprojectName

Going very quickly through the Params record, we'd want a config like:

\x -> Params { projectName = "xmonad",
  configDir = Just ".xmonad",
  cacheDir = configDir,
  realMain = x,
  showError = <same as the dyre example, I guess, I'm not sure whether IO is  
allowed
for an xmessage>
  hidePackages = [],
  ghcOpts =  
["--make", "xmonad.hs", "-i", "-ilib", "-fforce-recomp", "-v0", "-
o",binn],
-- probably some of these flags are already handled by dyre, for example I  
rather
doubt we'd actually need --make xmonad.hs
  forceRecomp = False,
  statusOut = hPutStrLn stderr }

Not sure how it would all get wired into our current main.hs

But we probably don't have to worry about the names of things in .xmonad/,  
since
http://hackage.haskell.org/packages/archive/dyre/0.8.2/doc/html/src/Config-Dyre-
Paths.html#getPaths looks like it was modeled after xmonad:

     let tempBinary = cacheDir </> pName ++ "-" ++ os ++ "-" ++ arch
     let configFile = configDir </> pName ++ ".hs"



--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
Reply | Threaded
Open this post in threaded view
|

Re: Issue 350 in xmonad: Investigate using Dyre for xmonad configuration

codesite-noreply@google.com

Comment #2 on issue 350 by gwern0: Investigate using Dyre for xmonad  
configuration
http://code.google.com/p/xmonad/issues/detail?id=350

As to whether Will Donnelly is 'available and cooperative', he has been in  
my few
interactions with him, and presumably his use of github would help with  
that.
Whether he will maintain it in the long run, I cannot say - he hasn't been  
involved
in packages to a great extent or for a notably long period:
<a href="http://www.google.com/search?hl=en&q=site%3Ahaskell.org+%22will.donnelly@gmail.com%">http://www.google.com/search?hl=en&q=site%3Ahaskell.org+%22will.donnelly@...%
22&aq=f

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
Reply | Threaded
Open this post in threaded view
|

Re: Issue 350 in xmonad: Investigate using Dyre for xmonad configuration

codesite-noreply@google.com

Comment #3 on issue 350 by vogt.adam: Investigate using Dyre for xmonad  
configuration
http://code.google.com/p/xmonad/issues/detail?id=350

I can't find a version of dyre on hackage that supports base-3, so somebody  
either
needs to fix dyre in that respect, or we should accept the loss of ghc-6.8
compatiblity (this is particularily a concern if we want to minimize  
trouble for
ubuntu users, which still have ghc-6.8).

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
Reply | Threaded
Open this post in threaded view
|

Re: Issue 350 in xmonad: Investigate using Dyre for xmonad configuration

codesite-noreply@google.com

Comment #4 on issue 350 by gwern0: Investigate using Dyre for xmonad  
configuration
http://code.google.com/p/xmonad/issues/detail?id=350

I doubt it would be too difficult to get dyre to support base-3. I did a  
quick
dyre.cabal edit to

diff --git a/dyre.cabal b/dyre.cabal
index 8a6c395..c11e659 100644
--- a/dyre.cabal
+++ b/dyre.cabal
@@ -41,7 +41,7 @@ library
                     Config.Dyre.Options,
                     Config.Dyre.Compile,
                     Config.Dyre.Relaunch
-  build-depends:   base >= 4 && < 5, process, filepath,
+  build-depends:   base < 4, process, filepath,
                     directory, ghc-paths, old-time, binary,
                     executable-path, xdg-basedir, io-storage

and with my GHC 6.10.2 worked fine

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
Reply | Threaded
Open this post in threaded view
|

Re: Issue 350 in xmonad: Investigate using Dyre for xmonad configuration

Justin Bogner
In reply to this post by codesite-noreply@google.com
> this is particularily a concern if we want to minimize trouble for
> ubuntu users, which still have ghc-6.8

As of Ubuntu 9.10, which was released october 29th, this is no longer
true.

Reply | Threaded
Open this post in threaded view
|

Re: Issue 350 in xmonad: Investigate using Dyre for xmonad configuration

Ivan Lazar Miljenovic
2009/12/21 Justin Bogner <[hidden email]>:
> As of Ubuntu 9.10, which was released october 29th, this is no longer
> true.

I think the problem is from the Long Term Support releases...

--
Ivan Lazar Miljenovic
[hidden email]
IvanMiljenovic.wordpress.com
Marie von Ebner-Eschenbach  - "Even a stopped clock is right twice a
day." - http://www.brainyquote.com/quotes/authors/m/marie_von_ebnereschenbac.html
Reply | Threaded
Open this post in threaded view
|

Re: Issue 350 in xmonad: Investigate using Dyre for xmonad configuration

codesite-noreply@google.com
In reply to this post by codesite-noreply@google.com

Comment #5 on issue 350 by vogt.adam: Investigate using Dyre for xmonad  
configuration
http://code.google.com/p/xmonad/issues/detail?id=350

I have a branch which uses dyre:

http://code.haskell.org/~aavogt/xmonad-dyre

Compatibility for changes to the type of recompile (which could be left  
as-is, but the type should suggest what is legal):

http://code.haskell.org/~aavogt/XMonadContrib/dyre/

And minor changes that were necessary to dyre (though more need to be made  
to duplicate xmonad's current behavior, especially with respect to  
recompilation checking for ~/.xmonad/lib):

http://code.haskell.org/~aavogt/dyre.git

Reply | Threaded
Open this post in threaded view
|

Issue 350 in xmonad: Investigate using Dyre for xmonad configuration

codesite-noreply@google.com

Comment #6 on issue 350 by gwern0: Investigate using Dyre for xmonad  
configuration
http://code.google.com/p/xmonad/issues/detail?id=350

aavogt, is Will accepting your Dyre patches?



Reply | Threaded
Open this post in threaded view
|

Issue 350 in xmonad: Investigate using Dyre for xmonad configuration

codesite-noreply@google.com

Comment #7 on issue 350 by vogt.adam: Investigate using Dyre for xmonad  
configuration
http://code.google.com/p/xmonad/issues/detail?id=350

I have not heard either way. That being said, my changes aren't complete  
and I
was more or less asking for help in this (dated Nov 1, 2010):

     The following darcs repository xmonad uses dyre:

     http://code.haskell.org/~aavogt/xmonad-dyre/

     I'm using ghc-6.12.3 and some part of the recompile seems to die:

     If I touch ~/.xmonad/xmonad.hs, then  (xmonad --restart, or use a
     keybind to    restart (Right True)) the WM exits due to this exception:

     Configuration '/home/aavogt/.xmonad/xmonad.hs' changed. Recompiling.
     xmonad: waitForProcess: does not exist (No child processes)

     The recompile dies with the same exception here, but the result is
     correct:

     touch ~/.xmonad/xmonad.hs; xmonad --recompile; xmonad --restart

     Some feature requests, somewhat related to what's already done in
     xmonad. (see http://code.google.com/p/xmonad/issues/detail?id=350)

     1. there should be a way bypass dyre's recompilation checking; and force
        that executable to exit once recompilation is done. For the latter
        I've tried unsuccessfully:
        - write a global IORef before using dyre, and read it in the realMain
          which I'm not sure why that doesn't work
        - set config parameters, which obviously doesn't work since the
          config in ~/.xmonad/xmonad.hs shouldn't ask for early exit
     2. dyre's recompilation checking could look in ./lib given -ilib, which
        makes changing files in a modular config trigger a recompile

     Thanks for you help,
     Adam




Reply | Threaded
Open this post in threaded view
|

Issue 350 in xmonad: Investigate using Dyre for xmonad configuration

codesite-noreply@google.com

Comment #8 on issue 350 by Will.Donnelly: Investigate using Dyre for xmonad  
configuration
http://code.google.com/p/xmonad/issues/detail?id=350

I am terribly sorry, I was completely swamped with coursework these past  
couple of months. I probably won't be able to work on it this year, but  
I'll finally have some time to work on it tomorrow.



Reply | Threaded
Open this post in threaded view
|

Issue 350 in xmonad: Investigate using Dyre for xmonad configuration

codesite-noreply@google.com

Comment #9 on issue 350 by vogt.adam: Investigate using Dyre for xmonad  
configuration
http://code.google.com/p/xmonad/issues/detail?id=350

This may or may not belong to dyre's responsibility, but it would be nice  
to specify that the xmonad.hs is compiled using the correct -package. If  
Cabal permits, ghc's package names could include those hashes, so multiple  
xmonad-0.9.2 could coexist (ex. global and user). Confusion resulting from  
unexpected results from multiple xmonad installs happens often in #xmonad.  
After a compile failure with restricted package versions fails, a second  
attempt should be made without the -hide-all-packages.

That way multiple versions of xmonad could coexist for a single user, and  
it may make install errors clearer. The only downside I see is excessive  
code complexity. Haskell is more consise than my current description and  
some parts may be in dyre, so it might be worthwhile.



Reply | Threaded
Open this post in threaded view
|

Issue 350 in xmonad: Investigate using Dyre for xmonad configuration

codesite-noreply@google.com
Updates:
        Cc: vogt.adam

Comment #10 on issue 350 by vogt.a... at gmail.com: Investigate using Dyre for  
xmonad configuration
http://code.google.com/p/xmonad/issues/detail?id=350

Changing to dyre will also addresses the rare event that xmonad tries to  
pass an excessively long string to the new process that replaces it, since  
if I recall correctly, dyre seems to save the state in '/tmp' (at least by  
default, which should probably be changed to ~/.xmonad/state or so).

The error is the first point below, and today in #xmonad pielgrzym ran into  
it too.

http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Actions-WorkspaceCursors.html#4



Reply | Threaded
Open this post in threaded view
|

Issue 350 in xmonad: Investigate using Dyre for xmonad configuration

codesite-noreply@google.com

Comment #11 on issue 350 by vogt.a... at gmail.com: Investigate using Dyre for  
xmonad configuration
http://code.google.com/p/xmonad/issues/detail?id=350

Issue 501 has been merged into this issue.



Reply | Threaded
Open this post in threaded view
|

Issue 350 in xmonad: Investigate using Dyre for xmonad configuration

codesite-noreply@google.com

Comment #12 on issue 350 by woozlet... at gmail.com: Investigate using Dyre  
for xmonad configuration
https://code.google.com/p/xmonad/issues/detail?id=350

I was playing around a little with replacing the baked-in recompilation  
with that from dyre. Relaunching does not seem to work reliably as  
recompilation crashes xmonad/X. This only happens when I change the  
configuration file. My guess is that the relaunch facilities are not  
compatible with the `executeFile` calls which are currently used. It's the  
same issue as mentioned in #7. The second feature mentioned there is now  
the default in Dyre.

     Configuration '/home/saep/.xmonad/xmonad.hs' changed. Recompiling.
     xmonad: waitForProcess: does not exist (No child processes)

The attached patch still uses the command line arguments to pass the state  
on restart. I don't think it is worthwile to addres any outstanding issue  
unless the recompilation works properly.

Attachments:
        recompilation-with-dyre.dpatch  23.3 KB

--
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

Reply | Threaded
Open this post in threaded view
|

Issue 350 in xmonad: Investigate using Dyre for xmonad configuration

codesite-noreply@google.com
Updates:
        Cc: woozlet... at gmail.com

Comment #13 on issue 350 by allber... at gmail.com: Investigate using Dyre for  
xmonad configuration
https://code.google.com/p/xmonad/issues/detail?id=350

The "temporarily disable SIGCHLD ignoring" code in recompile  
(uninstallSignalHandlers, installSignalHandlers) is *not* optional; the  
error you are getting is a symptom of not disabling it before rebuilding.  
You will need to find some way to integrate that with Dyre.

--
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

Reply | Threaded
Open this post in threaded view
|

Issue 350 in xmonad: Investigate using Dyre for xmonad configuration

codesite-noreply@google.com

Comment #14 on issue 350 by vogt.a... at gmail.com: Investigate using Dyre for  
xmonad configuration
https://code.google.com/p/xmonad/issues/detail?id=350

http://code.haskell.org/~aavogt/xmonad/dyre/ is where the repo in #7 now  
lives. It does uninstallSignalHandlers/installSignalHandlers around the  
call to dyre, which avoids the crash. I'm not sure if it's erring on the  
side of having the SIGCHLD handler not installed for too long.

--
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings