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

Don't install VS Code by default, and definitely not under Raspberry Pi OS Lite #7

Open
pxeger opened this issue Jan 23, 2021 · 14 comments · May be fixed by #20
Open

Don't install VS Code by default, and definitely not under Raspberry Pi OS Lite #7

pxeger opened this issue Jan 23, 2021 · 14 comments · May be fixed by #20

Comments

@pxeger
Copy link

pxeger commented Jan 23, 2021

When installing, one of the dependencies is VS Code. I can understand why one might want to include and set up VS Code for some users, but I think the overlap between that group of users, with people who want to use C++ over MicroPython, is very small. I think this definitely should not be the default behaviour.

This is particularly infuriating under Raspberry Pi OS Lite because it installs the entire desktop environment which I categorically did not ask for. Ideally I would be able to develop entirely on my proper desktop, but I can't find any cross-compile instructions so it seemed a lot easier to set up using this script on a Pi (which I am already using for something else and definitely don't want a desktop environment on).

It certainly ought to be explained more clearly on the Getting Started page that this script sets up an entire development system, not just a "toolchain". Currently that just plonks you on a GitHub repo with no README or even instructions on how to download and run it. I had to read the script to learn about SKIP_VSCODE=1 (by which point it was too late), something which some might not be able to (or want to) do.

I think the best solution would be to present an interactive menu at the start of the script where the user can decide that they don't want to have VS Code set up for them.

@scratch-er
Copy link

This script is targeted for newbies so it is designed to set up everything and make them work just out of box. However, it should NOT install all the stuff without user's confirmation. It should ask the user to make a choice first.

@lurch
Copy link
Contributor

lurch commented Feb 26, 2021

I think giving the newbie user lots of questions to confirm/deny would take away a lot of the ease-of-use that pico_setup was written to provide. If you want to submit a PR that adds an "advanced mode" which is off by default (e.g. you need to explicitly enable it with pico_setup.sh --interactive or something), then feel free 🙂

(and of course you can refer to https://datasheets.raspberrypi.org/pico/getting-started-with-pico.pdf if you want to do things "manually" and not rely on the automated nature of pico_setup)

I agree that it probably makes sense to not install VSCode on Raspberry Pi OS Lite though.
@XECDesign Is there an easy way (e.g. looking for the absence of some package) that pico_setup could tell the difference between normal "Raspberry Pi OS" and "Raspberry Pi OS Lite"?

@XECDesign
Copy link

You can check /etc/rpi-issue whether it's a 'stage 2' (lite) image or for the presence of x11 libraries, but you can't assume that if a user started with the lite image that they haven't or aren't going to install a desktop environment or that they won't use X forwarding over SSH.

@lurch
Copy link
Contributor

lurch commented Feb 26, 2021

Would checking the return-code of dpkg-query -s xserver-xorg be a sensible option?

@aallan
Copy link

aallan commented Feb 26, 2021

Ideally I would be able to develop entirely on my proper desktop, but I can't find any cross-compile instructions…

Please see the Getting Started guide which gives full instructions on how to set up the toolchain under Linux, macOS, or Windows. I'm not sure what you mean by cross-compile instructions though?

@XECDesign
Copy link

Would checking the return-code of dpkg-query -s xserver-xorg be a sensible option?

libx11-6 would probably be the safer option. I don't know what the goals of the scripts are, but if it doesn't have to be non-interactive, then it should probably just ask.

@lurch
Copy link
Contributor

lurch commented Feb 27, 2021

Thanks @XECDesign , I'll give that a go next week 👍

@michaelstoops
Copy link

Would checking the return-code of dpkg-query -s xserver-xorg be a sensible option?

libx11-6 would probably be the safer option.

I don't think this will work as intended. Raspberry Pi OS Lite does not have xserver-xorg installed, but does have libx11-6.

pi@raspberrypi:~ $ cat /etc/rpi-issue
Raspberry Pi reference 2021-03-04
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 461109415073d2eb67083709662ba983cc191f14, stage2
pi@raspberrypi:~ $ dpkg-query -s xserver-xorg
dpkg-query: package 'xserver-xorg' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files.
pi@raspberrypi:~ $ dpkg-query -s libx11-6
Package: libx11-6
Status: install ok installed
Priority: optional
Section: libs
Installed-Size: 1370
Maintainer: Debian X Strike Force <[email protected]>
Architecture: armhf
Multi-Arch: same
Source: libx11
Version: 2:1.6.7-1+deb10u1
Depends: libc6 (>= 2.28), libxcb1 (>= 1.11.1), libx11-data
Description: X11 client-side library
 This package provides a client interface to the X Window System, otherwise
 known as 'Xlib'.  It provides a complete API for the basic functions of the
 window system.
 .
 More information about X.Org can be found at:
 <URL:https://www.X.org>
 .
 This module can be found at
 git://anongit.freedesktop.org/git/xorg/lib/libX11

@XECDesign
Copy link

You're right, something seems to drag it in as a recommended package, which I should get rid of for the next set of images and save some space.

And it probably doesn't make a ton of sense to use VS Code through X11 forwarding anyway, so I think my original comment was a bit too pedantic.

@michaelstoops
Copy link

Oh, are you the image builder? Cool, nice to meet you.

@michaelstoops michaelstoops linked a pull request Apr 3, 2021 that will close this issue
@aallan aallan linked a pull request Apr 6, 2021 that will close this issue
@lurch
Copy link
Contributor

lurch commented Apr 7, 2021

@XECDesign It seems to be git that's dragging in these unwanted X11 packages, see my comment here: #20 (comment)

@XECDesign
Copy link

In the case of pi-gen it happens because ssh has xauth as a recommended package, which then depends on the x11 libs. Git drags in the ssh client as a recommended package, so you end up with the same situation.

@lurch
Copy link
Contributor

lurch commented Apr 7, 2021

Ahhh, I hadn't noticed that git was pulling in openssh-client, and it was actually the latter that was dragging in xauth and the X11 libs! 😆
But apt install --no-install-recommends openssh-client works without dragging in xauth. And after that I can do apt install git and remain X11-bloat-free 👍 😉
(or even better, apt install --no-install-recommends ssh-client as ssh-client is the metapackage that git recommends)

@aallan
Copy link

aallan commented Apr 7, 2021

Ahhh, I hadn't noticed that git was pulling in openssh-client, and it was actually the latter that was dragging in xauth and the X11 libs! 😆

Makes sense, you want to be able to display forward your XWindows stuff I guess, so SSH just pulls in the X11 libs so you can do that?

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

Successfully merging a pull request may close this issue.

6 participants