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

Fix/document some of keytar issues #9707

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dev-packages/application-manager/src/rebuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import path = require('path');
export function rebuild(target: 'electron' | 'browser', modules: string[] | undefined): void {
const nodeModulesPath = path.join(process.cwd(), 'node_modules');
const browserModulesPath = path.join(process.cwd(), '.browser_modules');
const modulesToProcess = modules || ['@theia/node-pty', 'nsfw', 'native-keymap', 'find-git-repositories', 'drivelist'];
const modulesToProcess = modules || ['@theia/node-pty', 'nsfw', 'native-keymap', 'find-git-repositories', 'drivelist', 'keytar'];

if (target === 'electron' && !fs.existsSync(browserModulesPath)) {
const dependencies: {
Expand Down
39 changes: 35 additions & 4 deletions doc/Developing.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ For Windows instructions [click here](#building-on-windows).
- [Linux](#linux)
- [Windows](#windows)
- [macOS](#macos)
- [node-keytar](#keytar)
- [Root privileges errors](#root-privileges-errors)

## Prerequisites
Expand All @@ -64,17 +65,33 @@ Some additional tools and libraries are needed depending on your platform:
- [gcc](https://gcc.gnu.org/) (or another compiling toolchain)
- [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/)
- build-essential: `sudo apt-get install build-essential`
- Dependencies for `native-keymap` node native extension:
- Debian-based: `sudo apt-get install libx11-dev libxkbfile-dev`
- Red Hat-based: `sudo yum install libX11-devel.x86_64 libxkbfile-devel.x86_64 # or .i686`
- FreeBSD: `sudo pkg install libX11`
- Dependencies for node native extensions:
- `native-keymap`:
- Debian-based: `sudo apt-get install libx11-dev libxkbfile-dev`
- Red Hat-based: `sudo yum install libX11-devel.x86_64 libxkbfile-devel.x86_64 # or .i686`
- FreeBSD: `sudo pkg install libX11`
- `node-keytar`:
- Debian-based: `sudo apt-get install libsecret-1-dev`

- Linux/MacOS
- [nvm](https://github.com/nvm-sh/nvm) is recommended to easily switch between Node.js versions.

- Windows
- We recommend using [`scoop`](https://scoop.sh/). The detailed steps are [here](#building-on-windows).

- Alternative Linux Distributions (e.g. RHEL7)
- [node-keytar](https://github.com/atom/node-keytar) uses [`prebuild-install`](https://github.com/prebuild/prebuild-install) to download prebuilt binaries.
This can cause some issues on RHEL for instance where some shared libraries are missing from the system it was original built upon.
To fix that issue, you can tell `prebuild-install` to build the native extension locally by setting the following environment variable before doing `yarn`:

```sh
# either:
export npm_config_build_from_source=true
yarn

# or:
npm_config_build_from_source=true yarn
```
## Quick Start

To build and run the browser example:
Expand Down Expand Up @@ -470,6 +487,20 @@ If you already have Xcode installed, but you see the `xcode-select: error: tool

The solution is the same if you have updated to `10.14` (Mojave) and you can see the `gyp: No Xcode or CLT version detected!` error. More details [here](https://github.com/nodejs/node-gyp#on-macos).

### Keytar

See prerequisites for [`node-keytar`](#prerequisites)

On some distributions (e.g. RHEL7, CentOS7) the prebuilt binaries for `node-keytar` might crash at runtime because of some missing shared libraries (e.g. some glibc version).

To address that issue you can force `node-keytar` to build on install rather than pulling incompatible prebuilt binaries by setting the following environment variable:

```sh
export npm_config_build_from_source=true
```

And then running `yarn` to install dependencies and have them build themselves locally.

### Root privileges errors
When trying to install with root privileges, you might encounter errors such as
`cannot run in wd`.
Expand Down