-
Notifications
You must be signed in to change notification settings - Fork 6
Nix flake installation option #31
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
Conversation
|
have you tried this thing ? https://search.nixos.org/packages?channel=unstable&show=llvmPackages.libcxxClang&query=llvmPackages |
|
I am on arch linux with executing nix develop
code .leads to a linker error with I assume that your system I made Would it make sense to alternatively bundle a VS code version with |
Bummer, OK I probably should not have assumed code was not going to work so easily. I tested it on Arch so I figured things would be fine but I'm technically on the WSL version so it's actually using the windows version of the IDE/electron internally.
OK. It's up to @charguer , who added the libc++ in the first place. He changed it because Clang searching for a GCC installation for the stdlib would lead to unpredictable results. Maybe an alternative is to just specify what version of GCC you need to at least have installed (not necessarily default), and change the flag passed in c_parser to reflect that? It's interesting though that you had to remove
Well, these are two separate questions - see above for the libc++. Bundling VS Code could get tricky (and clunky) very quick. It's nice if it can run on the host because you can use all of your existing settings, can be launched from the desktop with Direnv, etc. At this point we'd probably just want to cover our bases and have the browser installed in Nix as well. I think all the watcher stuff would still work but yeah it would just make the workflow a little annoying. We could make it slightly less bad by providing an "install script" that installs some desktop entries for the "OptiTrust IDE" (special version of vscode launched thru nix shell). But of course currently that nix environment is tied to the repo itself so that probably won't work well either. Convenience issues aside (since I appreciate there is huge functionality missing from the nix environment still), the version of VSCode that's provided and works in the Nix might be too ancient for some features we need. Specifically, I'm thinking the change we made some time ago to support the new tasks mechanism would have to be undone. Maybe the watcher script would break. I'm not sure. New extensions may not even support being installed on such an old version anymore. I don't think we want to split our userbase into a group of people who are able to running a version of VSCode from 3 years ago and another group who can run the newest version. Only reason I think we should consider an ancient VSCode setup is if there's like an appimage type thing where we can say 'this is the OptiTrust IDE running on VSCode internally, it has all the deps bundled' and we force everyone to use that. À la Vitis HLS or Arduino IDE powered by VSCode internally. If we go in that direction Nix may not even make sense. I think AppImage does things differently. It's not so important for the vscode/electron binary itself to be running on the Nix. Hell, on my desktop these are running on Windows, I just have the WSL SSH to handle everything else. There are just three things I can think that we need to run on Nix:
TL;DR see the original post I've edited for the problems we still have to solve. Here are some questions/decisions for us to think about, in terms of solving them. Some are much more long term than others and we don't need to decide immediately just may help us save more work in the future:
And finally @bastian-koepcke, can you summarize what it is you're missing to have a comfortable workflow? Do you have a way to use the LSP in Ocaml? Is launching nix develop each time from the terminal in VSCode acceptable? Can we just add some hacks for workarounds for your system? I ask because you are our only user that needs this at the moment so I think it makes sense to split this PR into two steps - the minimal we need for Bastian to have a comfortable workflow, that we can merge so he can base his work off, and then the 'proper' environment solution. We can consider getting rid of the documentation in this PR or suggesting it as a very experimental thing until we do part 2. |
I have. For whatever reason I don't think it installs the headers, only the libraries. Maybe I missed something, but I looked at the package that it installed in the nix store and it was nowhere to be found. It certainly wasnt auto detected by the clang I had installed. I probably have because it seems weird that there would be no way to get the header files through Nix. |
Oh one other thing - you may not be able to launch the IDE through the host, but perhaps you could try my direnv solution (I've added instructions to in INSTALL.md in this branch)? This would just reload certain parts of the IDE like the extensions & etc. with the Nix stuff in the path. This may avoid dealing with libc conflicts for Electron cuz I think it runs on host either way, and I reckon this would be a good enough solution even relatively long term if it works. |
|
Experience is that maintaining more than one UI is too much effort for a research team. My policy is: (1) we support VScode ; (2) we try to make it not infeasible for users who insist on using emacs/vim to adapt the bindings. To achieve (2), I use bash scripts to implement all actions. The VScode bindings trigger basic calls to these bash scripts. The rendering is performed in a webpage using a server that is independent of VScode. In the long term, someone might want to integrate into VScode the browser window and the associated server; however a few years ago VScode did not yet have the feature for detaching tabs to separate screens, which we do need. The benefits of having a VScode integration is to avoid the dependency on the X-server and xdotools, both of which require deactivating Wayland on Ubuntu. |
|
We would like to maintain a Nix package in the long term, so that students can easily play with OptiTrust, in particular in the context of compiler courses, or for summer schools and tutorials that would teach OptiTrust. |
|
Obviously we need at some point people to be able to use OptiTrust on scripts that live outside our repo. But we said this was not yet a top priority. Besides, we need first to introduce a version numbering system, so that scripts can indicate which version of OptiTrust (or even of each transformation) they depend upon. Nontrivial design is needed there. The aim is to do better than the usual 'everything gets broken behind your back at every single release'. |
|
You can try docker if you think it would work better. The fact that we go through a watch.sh script for issueing commands, and through a webserver for answering queries, means that, assuming your server port in open, you should be able to escape your bocker sandbox. But this might take some effort. |
|
I had a chat with Bastian, it would be great for him if we can merge this into main so he doesn't need to copy over the nix flake into his working branch each time. Since it's still an experimental thing, I updated the docs again to add a disclaimer. @Bastacyclop @charguer Let me know if we can merge this |
Changes:
flake.nixgiving users the option to set up a semi-isolated environment that installs the necessary system and OCaml dependencies to build and run OptiTrust (works with the interactive stuff that uses the browser as well)TODOs: