Open ttilley opened 9 years ago
It appears that there's a typo in atom-shell upstream that mixes up product_name and project_name in one place, breaking the build anyways.
This is what i'm doing to work around it locally:
diff --git i/tasks/build-atom-shell-task.coffee w/tasks/build-atom-shell-task.coffee
index 66f8812..a5d42a1 100644
--- i/tasks/build-atom-shell-task.coffee
+++ w/tasks/build-atom-shell-task.coffee
@@ -62,16 +62,27 @@ module.exports = (grunt) ->
.concatMap (x) -> spawnObservable(x)
.takeLast(1)
+ envWithGypDefines = (projectName, productName) ->
+ ewg = _.extend {}, process.env
+ ewg.GYP_DEFINES = "project_name=#{projectName} product_name=#{productName}"
+ if process.env.GYP_DEFINES?
+ ewg.GYP_DEFINES = "#{process.env.GYP_DEFINES} #{ewg.GYP_DEFINES}"
+ ewg
+
buildAtomShell = (atomShellDir, config, projectName, productName, forceRebuild) ->
+ cmdOptions =
+ cwd: atomShellDir
+ env: envWithGypDefines(projectName, productName)
+
bootstrapCmd =
cmd: 'python'
args: ['script/bootstrap.py']
- opts: {cwd: atomShellDir}
+ opts: cmdOptions
buildCmd =
cmd: 'python'
args: ['script/build.py', '-c', config, '-t', projectName]
- opts: {cwd: atomShellDir}
+ opts: cmdOptions
rx.Observable.create (subj) ->
grunt.verbose.ok "Rigging atom.gyp to have correct name"
@@ -81,6 +92,7 @@ module.exports = (grunt) ->
.replace("'project_name': 'atom'", "'project_name': '#{projectName}'")
.replace("'product_name': 'Atom'", "'product_name': '#{productName}'")
.replace("'framework_name': 'Atom Framework'", "'framework_name': '#{productName} Framework'")
+ .replace("'<(project_name) Framework'", "'<(product_name) Framework'") # fix upstream typo in 0.20.3
grunt.file.write gypFile, atomGyp
@ttilley Good catch - I knew about the breaking changes but not about the typo. Can you submit a PR to fix the typo to Atom Shell, and I'll work on updating grunt-build-atom-shell to be compatible with both < 0.20.3 and >= 0.20.3
i left a line comment with a github ping to the committer... dunno if i should follow that up with an actual issue or if that's sufficient. I don't want to be that guy that pokes someone repeatedly over the holidays. ;)
The 'atom.gyp' rigging needs to be fixed for atom-shell 0.20.3 and beyond. The upstream build process has changed in order to make this customization simpler. Now the suggested method of renaming is:
In grunt-build-atom-shell 1.1.4, attempting to compile atom-shell 0.20.3 will throw the following error:
The 'atom.gyp' file ends up containing:
Dealing with quoting and interpolation for multiple options in a single string feels weird for me, so it might just be simpler to add another two replace statements for the new form. I haven't looked at the changes in depth to see what else might have changed (or if those defines are used in other places).
If I get un-lazy I'll patch and submit a pull quest, but considering i'm both lazy and hung over you'll probably get to it first. :laughing: