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

Peng/389 release 0.4 #422

Merged
merged 14 commits into from
Jan 31, 2018
Merged

Peng/389 release 0.4 #422

merged 14 commits into from
Jan 31, 2018

Conversation

nylira
Copy link
Contributor

@nylira nylira commented Jan 31, 2018

  • Resolves symlinks not being included in tar.gz by using tar-fs instead of tar-stream
  • Updates version to 0.4.0
  • Created Gaia binaries: download them from the pinned files on the #dev-gaia channel or build them yourself.

Please follow the release docs and confirm these hashes for me: WIP

Closes #389

@nylira nylira requested a review from mappum as a code owner January 31, 2018 05:12
@nylira
Copy link
Contributor Author

nylira commented Jan 31, 2018

Blocking

  • It appears that deterministic-tar is stripping out symlinks
  • deterministic-tar seems to also prevent Cosmos.app from launching, most likely related to the symlink stripping issue.

@nylira
Copy link
Contributor Author

nylira commented Jan 31, 2018

Update: This is a non-blocking issue for release

I'm getting this error in the production build of Cosmos UI 0.4.0:

screen shot 2018-01-31 at 1 31 12 pm

I managed to find the error by adding mainWindow.webContents.openDevTools() in app/src/main.index.js after mainWindow = new BrowserWindow... Had to add this because the dev tools is disabled in production builds.

@nylira
Copy link
Contributor Author

nylira commented Jan 31, 2018

Update: Fixed

After creating an account or signing into an account with the 0.4.0 binary, the app refuses to set config.modals.session.active to false

screen shot 2018-01-31 at 2 23 48 pm

Last login: Wed Jan 31 13:13:32 on ttys012
pz@mbp ~> /Users/pz/Projects/cosmos-ui/builds/Cosmos-darwin-x64/Cosmos.app/Contents/MacOS/Cosmos ; exit;
mainWindow opened
Redirecting console output to logfile /Users/pz/.Cosmos/main.log
[START SUCCESS] Vue app successfuly started
2018-01-31 14:23:22.059 Cosmos Helper[31027:1271332] Couldn't set selectedTextBackgroundColor from default ()
2018-01-31 14:23:28.048 Cosmos[31022:1271204] IMKInputSession presentFunctionRowItemTextInputViewWithEndpoint:completionHandler: : [self textInputContext]=0x0 *NO* NSRemoteViewController to client, NSError=Error Domain=NSCocoaErrorDomain Code=4099 "The connection from pid 0 was invalidated from this process." UserInfo={NSDebugDescription=The connection from pid 0 was invalidated from this process.}, com.apple.inputmethod.EmojiFunctionRowItem
2018-01-31 14:23:33.378 Cosmos[31022:1271204] IMKInputSession presentFunctionRowItemTextInputViewWithEndpoint:completionHandler: : [self textInputContext]=0x0 *NO* NSRemoteViewController to client, NSError=Error Domain=NSCocoaErrorDomain Code=4099 "The connection from pid 0 was invalidated from this process." UserInfo={NSDebugDescription=The connection from pid 0 was invalidated from this process.}, com.apple.inputmethod.EmojiFunctionRowItem
2018-01-31 14:23:35.296 Cosmos[31022:1271204] IMKInputSession presentFunctionRowItemTextInputViewWithEndpoint:completionHandler: : [self textInputContext]=0x0 *NO* NSRemoteViewController to client, NSError=Error Domain=NSCocoaErrorDomain Code=4099 "The connection from pid 0 was invalidated from this process." UserInfo={NSDebugDescription=The connection from pid 0 was invalidated from this process.}, com.apple.inputmethod.EmojiFunctionRowItem
2018-01-31 14:23:36.422 Cosmos[31022:1271204] IMKInputSession presentFunctionRowItemTextInputViewWithEndpoint:completionHandler: : [self textInputContext]=0x0 *NO* NSRemoteViewController to client, NSError=Error Domain=NSCocoaErrorDomain Code=4099 "The connection from pid 0 was invalidated from this process." UserInfo={NSDebugDescription=The connection from pid 0 was invalidated from this process.}, com.apple.inputmethod.EmojiFunctionRowItem

@nylira
Copy link
Contributor Author

nylira commented Jan 31, 2018

So to summarize, using tar-fs creates a perfect tarball of the macOS binary:

screen shot 2018-01-31 at 3 00 17 pm

But deterministic-tar is stripping out the symlinks (among other things?), which is causing necessary files to be removed from the gzipped tarball, and Cosmos.app can no longer be opened.

You can confirm this by seeing that Cosmos.app within Cosmos-darwin-x64_0.4.0.tar.gz runs after commenting out this line: https://github.com/cosmos/cosmos-ui/blob/178b4cfd425586268023e1025f2af27b2c1af097/tasks/release.js#L151

Finally: the binary built following the release docs by @mappum works! I can run it and make an account and stake. Just the deterministic-tar is rendering the app non-working.

@faboweb
Copy link
Collaborator

faboweb commented Jan 31, 2018

I am very sorry. There was a commit missing in the deterministic-zip PR. The important part was, that the packed executable didn't have the rights to execute. I readded this.
As tar-fs caused issues in the combination with my code I removed it again in favor of tar-stream. I tested it on Ubuntu and it works. If the symlink problem still exists, I offer to patch this approach together with tar-fs.

@faboweb
Copy link
Collaborator

faboweb commented Jan 31, 2018

On devtools: You can set COSMOS_DEVTOOLS=true. Then even the production build will show the devtools.

@faboweb
Copy link
Collaborator

faboweb commented Jan 31, 2018

My Linux-build SHA256: 757dab38d271cb2fcaa516052d76e530bea80c872f22061889135bcdc67ccd5d
My Windows-build SHA256: 613d6160410d60662c99080d4786a29f4c3f20d3202f0304b51ecbbf3913be81

@nylira
Copy link
Contributor Author

nylira commented Jan 31, 2018

@faboweb thanks! I have an error related to tar-stream and symlinks when I try to build on macOS though, which is the reason why I tried out tar-fs earlier. It appears fs.readSync is trying to read a symlink folder, which seems to cause the error:

yarn build:darwin --binary=$GOPATH/src/github.com/cosmos/gaia/gaia-mac
Zipping files...

fs.js:693
  return binding.read(fd, buffer, offset, length, position);
                 ^

Error: EISDIR: illegal operation on a directory, read
    at Object.fs.readSync (fs.js:693:18)
    at tryReadSync (fs.js:557:20)
    at Object.fs.readFileSync (fs.js:600:19)
    at files.filter.forEach.file (/Users/pz/Projects/cosmos-ui/tasks/release.js:159:63)
    at Array.forEach (<anonymous>)
    at glob (/Users/pz/Projects/cosmos-ui/tasks/release.js:158:10)
    at f (/Users/pz/Projects/cosmos-ui/node_modules/once/once.js:25:25)
    at Glob.<anonymous> (/Users/pz/Projects/cosmos-ui/node_modules/glob/glob.js:151:7)
    at Glob.emit (events.js:160:13)
    at Glob._finish (/Users/pz/Projects/cosmos-ui/node_modules/glob/glob.js:197:8)
    at done (/Users/pz/Projects/cosmos-ui/node_modules/glob/glob.js:182:14)
    at Glob._processGlobStar2 (/Users/pz/Projects/cosmos-ui/node_modules/glob/glob.js:637:12)
    at /Users/pz/Projects/cosmos-ui/node_modules/glob/glob.js:626:10
    at RES (/Users/pz/Projects/cosmos-ui/node_modules/inflight/inflight.js:31:16)
    at f (/Users/pz/Projects/cosmos-ui/node_modules/once/once.js:25:25)
    at lstatcb_ (/Users/pz/Projects/cosmos-ui/node_modules/glob/glob.js:519:7)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@faboweb
Copy link
Collaborator

faboweb commented Jan 31, 2018

Sadly tar-fs doesn't produce deterministic builds.
The error seams to be in fs.readFileSync (line 159) can't read a folder. Those get filtered out but apparently symlinked folders are not detected correctly. I added a try catch to prevent the build from failing on these (6764279). Would this work for you?

@nylira
Copy link
Contributor Author

nylira commented Jan 31, 2018

@faboweb It looks like the macOS build works with your warning bypassing the error. One minor issue is that using tar-stream is ballooning the size of Cosmos.app from 146MB to 339MB (by including symlink files or something?). But we can release with this and resolve it later.

@nylira
Copy link
Contributor Author

nylira commented Jan 31, 2018

Cosmos-darwin-x64_0.4.0.tar.gz

SHA256: daf0099289b0b88898e66098f689ffcd204bf048b6da4413d341f075e073af77

Cosmos-linux-x64_0.4.0.tar.gz

SHA256: 71e44df3518afa85710ef2851eb28459c15a36892a0ea05043b9243487ed9f89

Cosmos-win32-x64_0.4.0.zip

SHA256: f0684a73a0d34e0c39d196adcfe9027e0e484cbed78b2b9aab4a8efd05068e4a

@nylira nylira changed the title WIP: Peng/389 release 0.4 Peng/389 release 0.4 Jan 31, 2018
@faboweb
Copy link
Collaborator

faboweb commented Jan 31, 2018

Sadly the checksums are not equal :(

Cosmos-darwin-x64_0.4.0.tar.gz

SHA256: ff27a1d063a7b303f8836bd6a9797a67aa4e4cceb4dac1e5bff9b836418ce150

Cosmos-linux-x64_0.4.0.tar.gz

SHA256: b7314eadec7c55ec7687e799b4f9fc1cc30ad1391b1e82458cd7fa48b4770902

Cosmos-win32-x64_0.4.0.zip

SHA256: 19bf82b3b1cf3c88ff909c1781b913026d07220f196ba95a46a987d56bbd9b21

Regarding tar-fs: ok let's work on this when we have solved this issue.

@faboweb
Copy link
Collaborator

faboweb commented Jan 31, 2018

I created a follow up issue here: #424

@mappum
Copy link
Contributor

mappum commented Jan 31, 2018

Got the same hashes as Peng when building with his gaia binaries 👍 (Although different for Windows, still something non-deterministic there).

Veriability isn't a blocker for this release though, we'll just have to get it working before launch.

@mappum mappum merged commit d76023b into develop Jan 31, 2018
@faboweb faboweb mentioned this pull request Feb 1, 2018
1 task
@nylira nylira deleted the peng/389-release-0-4 branch February 14, 2018 04:52
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 this pull request may close these issues.

3 participants