From e1e217705855f0106e6f97e2caadec71501673f5 Mon Sep 17 00:00:00 2001 From: simurai Date: Tue, 1 Sep 2015 14:26:05 +0900 Subject: [PATCH 01/11] Use San Francisco font on El Capitan Beta `SF UI Text` only works for the downloaded version of the San Francisco font. `.SFNSText-Regular` adds support for the bundled version that ships in El Capitan Beta --- static/variables/ui-variables.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/variables/ui-variables.less b/static/variables/ui-variables.less index aa33d0e06..781bac4de 100644 --- a/static/variables/ui-variables.less +++ b/static/variables/ui-variables.less @@ -82,4 +82,4 @@ // Other -@font-family: 'SF UI Text', 'Lucida Grande', 'Segoe UI', Ubuntu, Cantarell, sans-serif; +@font-family: '.SFNSText-Regular', 'SF UI Text', 'Lucida Grande', 'Segoe UI', Ubuntu, Cantarell, sans-serif; From 3df73aefa11932a27c9a206056654c10fbc63e76 Mon Sep 17 00:00:00 2001 From: Arana Jhonny Date: Tue, 1 Sep 2015 09:25:15 -0700 Subject: [PATCH 02/11] :memo: Fixed link for instructions Node.js. Fixed link for instructions Node.js debian, ubuntu and fedora. It is not something remarkable for us , but it is better to be specific. --- docs/build-instructions/linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/build-instructions/linux.md b/docs/build-instructions/linux.md index fd53b9612..fabec4479 100644 --- a/docs/build-instructions/linux.md +++ b/docs/build-instructions/linux.md @@ -17,7 +17,7 @@ Ubuntu LTS 12.04 64-bit is the recommended platform. ### Ubuntu / Debian * `sudo apt-get install build-essential git libgnome-keyring-dev fakeroot` -* Instructions for [Node.js](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager#ubuntu-mint-elementary-os). +* Instructions for [Node.js](https://github.com/nodejs/node-v0.x-archive/wiki/Installing-Node.js-via-package-manager#debian-and-ubuntu-based-linux-distributions). * Make sure the command `node` is available after Node.js installation (some systems install it as `nodejs`). * Use `which node` to check if it is available. * Use `sudo update-alternatives --install /usr/bin/node node /usr/bin/nodejs 10` to update it. @@ -25,7 +25,7 @@ Ubuntu LTS 12.04 64-bit is the recommended platform. ### Fedora / CentOS / RHEL * `sudo dnf --assumeyes install make gcc gcc-c++ glibc-devel git-core libgnome-keyring-devel rpmdevtools` -* Instructions for [Node.js](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager#fedora). +* Instructions for [Node.js](https://github.com/nodejs/node-v0.x-archive/wiki/Installing-Node.js-via-package-manager#enterprise-linux-and-fedora). ### Arch From f571ee7bafc4379b6996b62cb1ce691f9d1e8681 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 21 Aug 2015 16:14:22 -0600 Subject: [PATCH 03/11] Add Package::rebuild --- spec/package-spec.coffee | 39 ++++++++++++++++++++ src/package.coffee | 77 ++++++++++++++++++++++++++++++---------- 2 files changed, 97 insertions(+), 19 deletions(-) diff --git a/spec/package-spec.coffee b/spec/package-spec.coffee index 9ea000ab9..f8bf4730b 100644 --- a/spec/package-spec.coffee +++ b/spec/package-spec.coffee @@ -34,6 +34,45 @@ describe "Package", -> expect(global.localStorage.getItem.callCount).toBe 2 expect(global.localStorage.setItem.callCount).toBe 1 + describe "::rebuild()", -> + it "returns a promise resolving to the results of `apm rebuild`", -> + packagePath = atom.project.getDirectories()[0]?.resolve('packages/package-with-index') + pack = new Package(packagePath) + rebuildCallbacks = [] + spyOn(pack, 'runRebuildProcess').andCallFake ((callback) -> rebuildCallbacks.push(callback)) + + promise = pack.rebuild() + rebuildCallbacks[0]({code: 0, stdout: 'stdout output', stderr: 'stderr output'}) + + waitsFor (done) -> + promise.then (result) -> + expect(result).toEqual {code: 0, stdout: 'stdout output', stderr: 'stderr output'} + done() + + it "persists build failures in local storage", -> + packagePath = atom.project.getDirectories()[0]?.resolve('packages/package-with-index') + pack = new Package(packagePath) + global.localStorage.removeItem(pack.getBuildFailureOutputStorageKey()) + + expect(pack.isCompatible()).toBe true + expect(pack.getBuildFailureOutput()).toBeNull() + + rebuildCallbacks = [] + spyOn(pack, 'runRebuildProcess').andCallFake ((callback) -> rebuildCallbacks.push(callback)) + + pack.rebuild() + rebuildCallbacks[0]({code: 13, stderr: 'It is broken'}) + + expect(pack.getBuildFailureOutput()).toBe 'It is broken' + expect(pack.getIncompatibleNativeModules()).toEqual [] + expect(pack.isCompatible()).toBe false + + pack2 = new Package(packagePath) + expect(pack2.getBuildFailureOutput()).toBe 'It is broken' + expect(pack2.isCompatible()).toBe false + + global.localStorage.removeItem(pack.getBuildFailureOutputStorageKey()) + describe "theme", -> theme = null diff --git a/src/package.coffee b/src/package.coffee index 25bf3a038..467204428 100644 --- a/src/package.coffee +++ b/src/package.coffee @@ -11,6 +11,7 @@ Q = require 'q' ModuleCache = require './module-cache' ScopedProperties = require './scoped-properties' +BufferedProcess = require './buffered-process' packagesCache = require('../package.json')?._atomPackages ? {} @@ -603,6 +604,63 @@ class Package traversePath(path.join(@path, 'node_modules')) nativeModulePaths + ### + Section: Native Module Compatibility + ### + + # Extended: Are all native modules depended on by this package correctly + # compiled against the current version of Atom? + # + # Incompatible packages cannot be activated. + # + # Returns a {Boolean}, true if compatible, false if incompatible. + isCompatible: -> + return @compatible if @compatible? + + if @path.indexOf(path.join(atom.packages.resourcePath, 'node_modules') + path.sep) is 0 + # Bundled packages are always considered compatible + @compatible = true + else if @getMainModulePath() + @incompatibleModules = @getIncompatibleNativeModules() + @compatible = @incompatibleModules.length is 0 and not @getBuildFailureOutput()? + else + @compatible = true + + # Extended: Rebuild native modules in this package's dependencies for the + # current version of Atom. + # + # Returns a {Promise} that resolves with an object containing `code`, + # `stdout`, and `stderr` properties based on the results of running + # `apm rebuild` on the package. + rebuild: -> + new Promise (resolve) => + @runRebuildProcess (result) => + if result.code isnt 0 + @compatible = false + global.localStorage.setItem(@getBuildFailureOutputStorageKey(), result.stderr) + resolve(result) + + # Extended: If a previous rebuild failed, get the contents of stderr. + # + # Returns a {String} or null if no previous build failure occurred. + getBuildFailureOutput: -> + global.localStorage.getItem(@getBuildFailureOutputStorageKey()) + + runRebuildProcess: (callback) -> + stderr = '' + stdout = '' + new BufferedProcess({ + command: atom.packages.getApmPath() + args: ['rebuild'] + options: {cwd: @path} + stderr: (output) -> stderr += output + stdout: (output) -> stdout += output + exit: (code) -> callback({code, stdout, stderr}) + }) + + getBuildFailureOutputStorageKey: -> + "installed-packages:#{@name}:#{@metadata.version}:build-error" + # Get the incompatible native modules that this package depends on. # This recurses through all dependencies and requires all modules that # contain a `.node` file. @@ -632,25 +690,6 @@ class Package global.localStorage.setItem(localStorageKey, JSON.stringify({incompatibleNativeModules})) incompatibleNativeModules - # Public: Is this package compatible with this version of Atom? - # - # Incompatible packages cannot be activated. This will include packages - # installed to ~/.atom/packages that were built against node 0.11.10 but - # now need to be upgrade to node 0.11.13. - # - # Returns a {Boolean}, true if compatible, false if incompatible. - isCompatible: -> - return @compatible if @compatible? - - if @path.indexOf(path.join(atom.packages.resourcePath, 'node_modules') + path.sep) is 0 - # Bundled packages are always considered compatible - @compatible = true - else if @getMainModulePath() - @incompatibleModules = @getIncompatibleNativeModules() - @compatible = @incompatibleModules.length is 0 - else - @compatible = true - handleError: (message, error) -> if error.filename and error.location and (error instanceof SyntaxError) location = "#{error.filename}:#{error.location.first_line + 1}:#{error.location.first_column + 1}" From ea5b12d69ccff478ce79ab53374c8a466cbd3659 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 21 Aug 2015 17:59:28 -0600 Subject: [PATCH 04/11] Clear build failures, cached incompatible modules after rebuild --- spec/package-spec.coffee | 42 ++++++++++++++++++++++++++++++---------- src/package.coffee | 15 +++++++++----- 2 files changed, 42 insertions(+), 15 deletions(-) diff --git a/spec/package-spec.coffee b/spec/package-spec.coffee index f8bf4730b..ef5f5a4c3 100644 --- a/spec/package-spec.coffee +++ b/spec/package-spec.coffee @@ -7,6 +7,10 @@ describe "Package", -> describe "when the package contains incompatible native modules", -> beforeEach -> spyOn(atom, 'inDevMode').andReturn(false) + items = {} + spyOn(global.localStorage, 'setItem').andCallFake (key, item) -> items[key] = item; undefined + spyOn(global.localStorage, 'getItem').andCallFake (key) -> items[key] ? null + spyOn(global.localStorage, 'removeItem').andCallFake (key) -> delete items[key]; undefined it "does not activate it", -> packagePath = atom.project.getDirectories()[0]?.resolve('packages/package-with-incompatible-native-module') @@ -17,14 +21,6 @@ describe "Package", -> it "caches the incompatible native modules in local storage", -> packagePath = atom.project.getDirectories()[0]?.resolve('packages/package-with-incompatible-native-module') - cacheKey = null - cacheItem = null - - spyOn(global.localStorage, 'setItem').andCallFake (key, item) -> - cacheKey = key - cacheItem = item - spyOn(global.localStorage, 'getItem').andCallFake (key) -> - return cacheItem if cacheKey is key expect(new Package(packagePath).isCompatible()).toBe false expect(global.localStorage.getItem.callCount).toBe 1 @@ -35,6 +31,13 @@ describe "Package", -> expect(global.localStorage.setItem.callCount).toBe 1 describe "::rebuild()", -> + beforeEach -> + spyOn(atom, 'inDevMode').andReturn(false) + items = {} + spyOn(global.localStorage, 'setItem').andCallFake (key, item) -> items[key] = item; undefined + spyOn(global.localStorage, 'getItem').andCallFake (key) -> items[key] ? null + spyOn(global.localStorage, 'removeItem').andCallFake (key) -> delete items[key]; undefined + it "returns a promise resolving to the results of `apm rebuild`", -> packagePath = atom.project.getDirectories()[0]?.resolve('packages/package-with-index') pack = new Package(packagePath) @@ -52,7 +55,6 @@ describe "Package", -> it "persists build failures in local storage", -> packagePath = atom.project.getDirectories()[0]?.resolve('packages/package-with-index') pack = new Package(packagePath) - global.localStorage.removeItem(pack.getBuildFailureOutputStorageKey()) expect(pack.isCompatible()).toBe true expect(pack.getBuildFailureOutput()).toBeNull() @@ -67,11 +69,31 @@ describe "Package", -> expect(pack.getIncompatibleNativeModules()).toEqual [] expect(pack.isCompatible()).toBe false + # A different package instance has the same failure output (simulates reload) pack2 = new Package(packagePath) expect(pack2.getBuildFailureOutput()).toBe 'It is broken' expect(pack2.isCompatible()).toBe false - global.localStorage.removeItem(pack.getBuildFailureOutputStorageKey()) + # Clears the build failure after a successful build + pack.rebuild() + rebuildCallbacks[1]({code: 0, stdout: 'It worked'}) + + expect(pack.getBuildFailureOutput()).toBeNull() + expect(pack2.getBuildFailureOutput()).toBeNull() + + it "sets cached incompatible modules to an empty array when the rebuild completes (there may be a build error, but rebuilding *deletes* native modules)", -> + packagePath = atom.project.getDirectories()[0]?.resolve('packages/package-with-incompatible-native-module') + pack = new Package(packagePath) + + expect(pack.getIncompatibleNativeModules().length).toBeGreaterThan(0) + + rebuildCallbacks = [] + spyOn(pack, 'runRebuildProcess').andCallFake ((callback) -> rebuildCallbacks.push(callback)) + + pack.rebuild() + expect(pack.getIncompatibleNativeModules().length).toBeGreaterThan(0) + rebuildCallbacks[0]({code: 0, stdout: 'It worked'}) + expect(pack.getIncompatibleNativeModules().length).toBe(0) describe "theme", -> theme = null diff --git a/src/package.coffee b/src/package.coffee index 467204428..db6c77533 100644 --- a/src/package.coffee +++ b/src/package.coffee @@ -635,9 +635,12 @@ class Package rebuild: -> new Promise (resolve) => @runRebuildProcess (result) => - if result.code isnt 0 + if result.code is 0 + global.localStorage.removeItem(@getBuildFailureOutputStorageKey()) + else @compatible = false global.localStorage.setItem(@getBuildFailureOutputStorageKey(), result.stderr) + global.localStorage.setItem(@getIncompatibleNativeModulesStorageKey(), '[]') resolve(result) # Extended: If a previous rebuild failed, get the contents of stderr. @@ -661,6 +664,9 @@ class Package getBuildFailureOutputStorageKey: -> "installed-packages:#{@name}:#{@metadata.version}:build-error" + getIncompatibleNativeModulesStorageKey: -> + "installed-packages:#{@name}:#{@metadata.version}:incompatible-native-modules" + # Get the incompatible native modules that this package depends on. # This recurses through all dependencies and requires all modules that # contain a `.node` file. @@ -668,11 +674,10 @@ class Package # This information is cached in local storage on a per package/version basis # to minimize the impact on startup time. getIncompatibleNativeModules: -> - localStorageKey = "installed-packages:#{@name}:#{@metadata.version}" unless atom.inDevMode() try - {incompatibleNativeModules} = JSON.parse(global.localStorage.getItem(localStorageKey)) ? {} - return incompatibleNativeModules if incompatibleNativeModules? + if arrayAsString = global.localStorage.getItem(@getIncompatibleNativeModulesStorageKey()) + return JSON.parse(arrayAsString) incompatibleNativeModules = [] for nativeModulePath in @getNativeModuleDependencyPaths() @@ -687,7 +692,7 @@ class Package version: version error: error.message - global.localStorage.setItem(localStorageKey, JSON.stringify({incompatibleNativeModules})) + global.localStorage.setItem(@getIncompatibleNativeModulesStorageKey(), JSON.stringify(incompatibleNativeModules)) incompatibleNativeModules handleError: (message, error) -> From f5a591f6b3abbb088dccfa4f08f6e6c24dc1a900 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 21 Aug 2015 19:07:17 -0600 Subject: [PATCH 05/11] Disable colored output from `apm rebuild` --- src/package.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/package.coffee b/src/package.coffee index db6c77533..761171f61 100644 --- a/src/package.coffee +++ b/src/package.coffee @@ -654,7 +654,7 @@ class Package stdout = '' new BufferedProcess({ command: atom.packages.getApmPath() - args: ['rebuild'] + args: ['rebuild', '--no-color'] options: {cwd: @path} stderr: (output) -> stderr += output stdout: (output) -> stdout += output From 7e0b0a4427a97895f0b5112ae3b30340a857f729 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 24 Aug 2015 15:29:12 -0600 Subject: [PATCH 06/11] Cache incompatible packages based on electron version This will cause us to re-check all packages when upgrading the version of Electron. --- src/package.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/package.coffee b/src/package.coffee index 761171f61..f3f5cf4a2 100644 --- a/src/package.coffee +++ b/src/package.coffee @@ -665,7 +665,8 @@ class Package "installed-packages:#{@name}:#{@metadata.version}:build-error" getIncompatibleNativeModulesStorageKey: -> - "installed-packages:#{@name}:#{@metadata.version}:incompatible-native-modules" + electronVersion = process.versions['electron'] ? process.versions['atom-shell'] + "installed-packages:#{@name}:#{@metadata.version}:electron-#{electronVersion}:incompatible-native-modules" # Get the incompatible native modules that this package depends on. # This recurses through all dependencies and requires all modules that From 30a5a1c580c07ba13e61fffb57bd5bc8f8e1f53b Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 8 Sep 2015 11:02:37 -0600 Subject: [PATCH 07/11] :arrow_up: incompatible-packages --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fa3e6e273..d7473ddf3 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ "go-to-line": "0.30.0", "grammar-selector": "0.47.0", "image-view": "0.54.0", - "incompatible-packages": "0.24.1", + "incompatible-packages": "0.25.0", "keybinding-resolver": "0.33.0", "line-ending-selector": "0.0.5", "link": "0.30.0", From fbeee4695769bb696b6aaf1de4e33ecf422b2445 Mon Sep 17 00:00:00 2001 From: Thomas Johansen Date: Tue, 8 Sep 2015 20:39:38 +0200 Subject: [PATCH 08/11] :arrow_up: one-dark/light-ui@1.0.4 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d7473ddf3..968ff7735 100644 --- a/package.json +++ b/package.json @@ -69,10 +69,10 @@ "atom-light-ui": "0.43.0", "base16-tomorrow-dark-theme": "0.27.0", "base16-tomorrow-light-theme": "0.9.0", - "one-dark-ui": "1.0.3", + "one-dark-ui": "1.0.4", "one-dark-syntax": "1.1.0", "one-light-syntax": "1.1.0", - "one-light-ui": "1.0.3", + "one-light-ui": "1.0.4", "solarized-dark-syntax": "0.38.1", "solarized-light-syntax": "0.22.1", "about": "1.1.0", From ddb519ce7be8d8fd90788c9880a119fa3a9e0cbd Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 8 Sep 2015 15:35:18 -0600 Subject: [PATCH 09/11] :arrow_up: tree-view --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 968ff7735..298b428c6 100644 --- a/package.json +++ b/package.json @@ -116,7 +116,7 @@ "symbols-view": "0.104.0", "tabs": "0.84.0", "timecop": "0.31.0", - "tree-view": "0.186.0", + "tree-view": "0.187.0", "update-package-dependencies": "0.10.0", "welcome": "0.30.0", "whitespace": "0.31.0", From 31cb4a475c4d7972d70a743f97b2c391e104c15d Mon Sep 17 00:00:00 2001 From: Thomas Johansen Date: Wed, 9 Sep 2015 18:23:09 +0200 Subject: [PATCH 10/11] :arrow_up: git-diff@0.56.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 298b428c6..ddffb3fac 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "exception-reporting": "0.36.0", "find-and-replace": "0.180.0", "fuzzy-finder": "0.88.0", - "git-diff": "0.55.0", + "git-diff": "0.56.0", "go-to-line": "0.30.0", "grammar-selector": "0.47.0", "image-view": "0.54.0", From e34d49ebb5436642ae83f24e7f1305521da52a96 Mon Sep 17 00:00:00 2001 From: Thomas Johansen Date: Wed, 9 Sep 2015 20:29:38 +0200 Subject: [PATCH 11/11] :arrow_up: bookmarks@0.37.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ddffb3fac..5aecf66ce 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "autoflow": "0.25.0", "autosave": "0.22.0", "background-tips": "0.26.0", - "bookmarks": "0.36.0", + "bookmarks": "0.37.0", "bracket-matcher": "0.76.0", "command-palette": "0.36.0", "deprecation-cop": "0.54.0",