Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tidal-boot-script-path currently can't handle paths containing spaces #561

Closed
ethancrawford opened this issue Oct 29, 2019 · 3 comments
Closed

Comments

@ethancrawford
Copy link
Contributor

ethancrawford commented Oct 29, 2019

Describe the bug
Attempting to boot tidal with the emacs plugin fails if the path to the tidal package contains space characters.

To Reproduce
Steps to reproduce the behavior: (on Windows, but a similar process should reveal the issue on other platforms) :
Note: this assumes you don't have the cabal tidal package installed yet, and will be doing so locally from a copy of the source code.

  1. Edit the cabal config file (at %AppData%\Roaming\cabal\config on my machine for example) and change the line -- data-dir: $prefix to data-dir: $prefix\test test test (ie remove the -- and add a sub folder name with spaces in it to the end)
  2. In a cmd.exe window, change the current directory to your local copy of the tidal source code (eg cd projects\tidal) and run cabal install
  3. Follow the 'Start SuperDirt inside SuperCollider' steps at Start tidal cycles and superdirt for the first time
  4. Now attempt to boot tidal as described in 'Start TidalCycles inside your text editor > Instructions for Emacs' in the above document
  5. Observe that instead of tidal booting properly, something similar to the following error is printed to the log window:
GHCi, version 8.4.3: http://www.haskell.org/ghc/  :? for help
Prelude> IO error:  ""C:\\Users\\Ethan\\AppData\\Roaming\\cabal\\test\BootTidal.hs" invalid argument
Prelude> 

Expected behavior
The tidal.el script should gracefully handle paths to the tidal package that contain spaces, and parse them correctly, so that tidal is able to boot without an error.

Environment (please complete the following information):

  • OS: Windows (though the same problem may well exist on others)
  • Haskell version: GHC 8.4.3
  • Tidal version: 1.4.3
  • SuperCollider version: 3.9.0-beta1

Additional context
Regarding cross-platform determination of the tidal data-dir value as introduced in a3f2b69, using ghc-pkg field tidal data-dir instead as mentioned elsewhere may simplify things somewhat. The remaining hurdle however would be parsing the value in such a way that it can handle paths without spaces in them (which are stored in data-dir in the cabal config without surrounding quotes) and paths with spaces in them (which are stored with surrounding quotes). My own elisp-fu is not strong enough for that just yet...

@ndr-brt
Copy link
Contributor

ndr-brt commented Jan 8, 2020

The same problem exists on atom plugin, after it was changed BootTidal.hs loading from sending line by line to ghci to using :script command: tidalcycles/pulsar-tidalcycles#82 (comment)

it seems that :script does not support path folding with ' nor ".

@yaxu
Copy link
Member

yaxu commented Apr 7, 2020

Reported upstream: https://gitlab.haskell.org/ghc/ghc/issues/18027

@yaxu
Copy link
Member

yaxu commented Jun 2, 2020

Kindly solved upstream, so should be fixed in the next haskell release.

@yaxu yaxu closed this as completed Jun 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants