This works around the "Cannot fetch index base URL http://pypi.python.org/simple/"
error by installing pip==9.0.1 directly from the pypi.python.org/packages/
Change-Type: patch
This commit installs `node-usb` v1.3.0 from GitHub, since that version
was never published to NPM, and is the only one that works with Visual
Studio 2015 (see https://github.com/tessel/node-usb/issues/109).
The usbboot communicates with a Raspberry Pi / Amber through USB and
eventually mounts it as a block device we can write to.
This feature bundles bootcode.bin and start.elf from the original
usbboot implementation.
The flow is the following:
- On each scan, the usbboot scanner will try to get a usbboot compatible
USB device to the next "phase", until they are all transformed to
block devices the user can flash to as usual
Change-Type: minor
Changelog-Entry: Integrate Raspberry Pi's usbboot technology.
Fixes: https://github.com/resin-io/etcher/issues/1541
See: https://github.com/raspberrypi/usbboot
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
This commit makes use of the `resin/armv7hf-debian` Docker image to
test and generate armhf builds.
We needed to add a slash before `build` in `.gitignore` given that git
was refusing to include any changes on `scripts/build` otherwise.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
- Extend the `standard` ESLint configuration
- Remove ESLint rules that are defined in the `standard` configuration
- Get rid of semi-colons
See: https://github.com/resin-io/etcher/pull/1657
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
This commit changes the whole codebase to adhere to all StandardJS
guidelines rules except semicolons, since the removal of semicolons
affect pretty much all lines, and the final diff is very hard to follow
(and to assess other more involved changes).
In a nutshell:
- When using `function`, we now require a space before the opening
parenthesis
- If a line with operators is broken into multiple lines, the operator
should now go after the line break
- Unnecessary padding lines are now forbidden
There were also some minor things that the `standard` CLI caught that I
updated here.
See: https://standardjs.com
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
electron-builder seems to ship with an older AppImages version that
doesn't play very well with the custom AppImages elevation system we
created.
More particularly, we can't execute custom binaries inside the mounted
AppImage given that the mount point seems to lose permissions, owner,
and group file information.
This commit goes back to our old custom build system just for AppImages,
until we properly solve the problem, which will likely involve updating
the AppImages version in electron-builder.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Its very unlikely that we will ever support cross platform builds. For
that reason, let's simplify the whole Makefile by removing the concept
of target and host platforms.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
This commit replaces our home-grown CLI packaging mechanism based on
browserify + node-static-entry-point with pkg, an open source tool to
package Node.js applications for distribution.
Some highlights:
- Removing browserify got rid of a lot of dependencies from
npm-shrinkwrap.json
- pkg currently has an issue where macOS binaries can't be code-signed
(https://github.com/zeit/pkg/issues/128), therefore this commit
comments-out the binary signing section for that operating system
- pkg currently has an issue where Windows binaries can't be branded
(https://github.com/zeit/pkg/issues/149), therefore this commit
comments-out the branding section for that operating system
See: https://github.com/zeit/pkg
Fixes: https://github.com/resin-io/etcher/issues/1531
Fixes: https://github.com/resin-io/etcher/issues/1450
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
CI servers fail with timeouts, or network issues quite frequently,
requiring maintainers to manually restart failed builds.
Hopefully these npm settings will help mitigating these issues.
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
We currently support portable builds that are basically ZIPs containing
the main Etcher executable and all its related libraries.
Turns out `electron-builder` supports NSIS-based portable builds that
can create a single executable that has everything it needs to run,
including any external assets.
This commit makes use of this new portable Windows installer
functionality, replacing the old ZIP approach.
Change-Type: patch
Changelog-Entry: Generate single-binary portable installers on Windows.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
We've been using `electron-builder` v2 all this time to create the NSIS
installer. This commit upgrade `electron-builder` to v18.6.2, and keeps
using it just to create the NSIS installer (for now).
The final package behaves exactly like the one we have before, just that
we needed various tweaks to upgrade to the latest `electron-builder`
version.
In more detail:
- Inject data to package.json using the new `--extraMetadata` option
- Remove old `.builder` package.json property
- Change the author of the project to Resin Inc. (the company name used
in our code-signing certificate)
As an extra, the new NSIS installer allows the user to install the
application to any location, and fixes the fact that the previous
installer copied the application to C:\Program Files (x86) even on x64
systems.
Change-Type: patch
Fixes: https://github.com/resin-io/etcher/issues/1030
Fixes: https://github.com/resin-io/etcher/issues/877
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Etcher supports disabling the update notification dialog by setting the
`ETCHER_DISABLE_UPDATES` environment variable.
In order to simplify disabling updates for when these are managed by a
package manager (e.g. in a debian package), this removes support for the
`ETCHER_DISABLE_UPDATES` environment variable, and instead requires
packagers to tweak the `updates.enabled` property of the package.json
file, which is set to `true` by default.
We don't want to encourage end users to disable the update mechanism, so
the documention was removed from `USER-DOCUMENTATION.md`. This option
will remain as something only packagers should tweak.
Change-Type: minor
Changelog-Entry: Remove support for the `ETCHER_DISABLE_UPDATES` environment variable.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
* add support for rpm packages.
* remove bintray file not my place neither do i have the keys.
* Remove last visage of publishing rpm's to bintray.
* address review comments.
* remove electron installer redhat from optional dependancies and add it to dockerfiles. also remove variable ELECTRON-INSTALLER-REDHAT inline with electron installer debian script.
* Add dependancy on libXScrnSaver and remove unsupported fields from config.json.
add rpm package to dockerfiles.
add dependancy check on rpmbuild to installer script.
* change dependancy from lsb-core-noarch to just lsb.
* address review comments.
* Add bintray target for rpm packages.
* Fix missing dependancy removed during conflict resolution.
Resin.io already publishes multi-arch Docker base images running Jessie,
which is Debian version we wanted before falling back to Ubuntu 12.04.
The main reason behind this change is to be able to use other resin.io
base images (like ARM ones) without requiring a lot of per-base-image
changes.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
We encountered a Browserify bug when releasing the CLI, where absolute
paths would be hard-coded in the final bundle. Since we were in the
middle of a release process, we added a quick and dirty
search-and-replace workaround on `concatenate-javascript.sh`.
After the release, we submitted a PR to Browserify which fixes the
issue. This commit makes use of my personal fork to be able to use such
fix while it gets merged to the main project.
See: https://github.com/substack/node-browserify/pull/1725
See: https://github.com/resin-io/etcher/pull/1409
Fixes: https://github.com/resin-io/etcher/issues/1429
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
We're currently hardcoding various pip dependencies in
`appveyor-install.bat` and `travis-install.sh`.
This commit moves all the dependencies to a `requirements.txt` file in
the root of the project, and makes every install script run `pip install
-r requirements.txt`.
See: https://github.com/resin-io/etcher/pull/1401#discussion_r116547053
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
There are various problems that contributed to this issue:
- `node-pre-gyp` doesn't detect the 6.10.3 node version. We reverted to
6.1.0, which the module recognised, and which shares the same v8 ABI
- Passing `--force` to `npm install` causes npm to swallow any errors
and silently continue
- The x86 Docker container has problems writing to `$HOME/.node-gyp`.
The solution is to enable `unsafe-perm` given that the container is
running as `root`
Fixes: https://github.com/resin-io/etcher/issues/1444
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
For some strange reason, Browserify will hardcode absolute paths from
the machine that generated the bundle to be able to resolve `__dirname`
and `__filename` calls. This makes no sense, given that it means that
the Browserify bundle will not work when we move it to another machine,
which went undetected probably for months.
The Browserify community apparently makes modules to fix this particular
issue (like `bundle-collapser`, and `intreq`), however none of this seem
to solve the problem for the Etcher CLI bundle.
I also gave https://github.com/zeit/pkg a go, however I gave up after
not being able to make use of native modules (nothing seems to work; the
packager result will simply not find the addons).
Finally, I ended up making the following workarounds:
- Edit the Browserify bundle file to use its own `__dirname` to
dynamically resolve the values of `__dirname` and `__filename` of the
files it contains
- Patch `lzma-native` to statically require its add-on rather than
relying on dynamic requires from `node-pre-gyp`, which makes it
impossible to resolve on the final bundle
See: https://github.com/resin-io/etcher/issues/355
See: http://stackoverflow.com/questions/21993073/browserify-with-paths-to-folders-in-my-system
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
UglifyJS v3 was recently released, which includes support for
compressing ES6 code.
This commit introduces the following changes:
- Add a boolean `-m` option to `concatenate-javascript.sh`, which when
set, will minify the final concatenated JavaScript file
- Install `uglify-es` in the CI servers
See: https://news.ycombinator.com/item?id=14285179
See: https://github.com/mishoo/UglifyJS2/tree/harmony
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
Sentry error reports showcase that elevation errors on Windows are one
of the most frequent Windows errors.
In order to perform Windows elevation, we ship compiled EXEs of a third
party CLI elevation application (http://code.kliu.org/misc/elevate/)
that has several limitations:
- We have the scan the output of the script to determine if a user
cancelled the elevation request, which causes all sorts of issues on
computers where English is not the main language
- The application displays a `cmd.exe` window for some milliseconds,
which is bad UX, that we have to workaround by distributing a patched
version of the tool
- The CLI application has to be spawned, which seems to be problematic
if users have anti-virus software, leading to hard to debug issues
- We don't have any control if something goes wrong
For these reasons, we decided to implement our own elevation mechanism
in C++ as a Node.js add-on, based on the `elevate.exe` code we where
previously using.
Misc changes:
- Introduce a `lib/shared/bindings.js` module to easily require local native
add-ons
- Install `cpplint` and configure it to lint C++ files
Note that for practical reasons, the C++ code lives in this repository
rather than in a separate module. We will release this functionality in
a more accessible way in the future as part of the Etcher SDK project.
Change-Type: patch
Changelog-Entry: Fix uncaught errors when cancelling elevation requests on Windows when the system's language is not English.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
We recently discovered that users not running latest GNU/Linux
distributions were having problems when Etcher tried to load native
modules. We used to build packages on Ubuntu 16.04, which ships with
GLIBC 2.23.
In order to solve that issue, we moved our build Docker containers to
Debian Jessie, which ships with GLIBC 2.19, however we noticed that
users running even older Linux distributions were still having the same
issue, so this commit switched the Docker containers to Ubuntu 12.04,
which ships with GLIBC 2.15.
See: https://github.com/resin-io/etcher/pull/1319
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This commit packages the Etcher CLI as a ZIP archive for Windows, and as
a tarball for GNU/Linux and macOS. These basic "installers" are the
foundation to provide Chocolatey/Brew/AUR/etc packages.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
To prevent any potential version incompatibility caused by simply installing
the latest version of the packages in the CI services.
See: https://github.com/resin-io/etcher/pull/1326
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
We recently hit an issue where Etcher builds produced on Ubuntu relied
on a too new glibc version, making them incompatible with GNU/Linux
distributions such as Debian Jessie.
As a solution, we will start producing builds on Debian Jessie, which
ensures that the builds will be compatible with the majority of
GNU/Linux versions out there.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
We currently require this module to be available in the environment in
order to be able to build debian packages.
This commit adds it as an optional dependency, so we can have control
over the version that we use, to prevent any potential incompatibility.
We also update the `udif` package.json version to match what its on the
shrinkwrap file to avoid npm complaining about version mismatches.
See: https://github.com/resin-io/etcher/pull/1290
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
The rc2 debian package is not working because the path where the package files
is installed has changed. The change in paths comes from an upstream change
in the electron-installer-debian node package. So, updating the path here to
match the actuall install location.
`jq` crashes when setting a value on a relative file. We workaround the
issue by using `jq` in a pipe instead of passing the file to it as an
argument.
See: https://github.com/stedolan/jq/issues/1155
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>