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

updating jetbrains channels; made unknown channel error non-fatal #29312

Closed
wants to merge 5 commits into from

Conversation

bbarker
Copy link
Contributor

@bbarker bbarker commented Sep 13, 2017

Motivation for this change

Needed to update Jetbrains channels; newer builds are available from JetBrains, some older builds are not.

Things done
  1. Changed update.pl for the case when an existing channel no longer appears as a JetBrains channel. This should not prevent updates to existing channels that do not have a problem.
  2. Added support for new download URL format as introduced for channel rider_2017_2_eap.
  3. Ran update.pl
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@bbarker
Copy link
Contributor Author

bbarker commented Sep 13, 2017

I guess I can understand leaving the script as fatal if there are errors updating a block, but it seems a bit too unfriendly for someone running the script the first time and just wanting to get one of the more commonly used IDEs up-to-date.

die "no version in $block" unless $version;
if ($version eq $latest_versions{$channel}) {
print("$channel is up to date at $version\n");
} else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mix spaces and tabs here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 removing tabs now

@Mic92
Copy link
Member

Mic92 commented Sep 13, 2017

cc @volth

@bbarker
Copy link
Contributor Author

bbarker commented Sep 13, 2017 via email

@edwtjo
Copy link
Member

edwtjo commented Sep 14, 2017

@bbarker or @volth: minor nit, since I missed #26769, please make sure that the outputted hash from the script is in base32.

description = "A cross-platform .NET IDE based on the IntelliJ platform and ReSharper";
license = stdenv.lib.licenses.unfree;
src = fetchurl {
url = "https://download.jetbrains.com/resharper/Rider-RC-${version}.tar.gz";
sha256 = "37bad69cdfcc4f297b2500a7bb673af7ef8f1fd45baa4eb2fa388d2c4bcb41ee"; /* updated by script */
url = "https://download.jetbrains.com/resharper/JetBrains.Rider-${version}.tar.gz";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, thanks for catching that, fixed

($sha256) = get("$url.sha256") =~ /^([0-9a-f]{64})/;
$version_string = $full_version;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation :)

@Mic92
Copy link
Member

Mic92 commented Sep 15, 2017

Can please also make one commit per update. I want to backport some of the updates to 17.03 and most updates to 17.09.

@bbarker
Copy link
Contributor Author

bbarker commented Sep 15, 2017

@Mic92 Not sure I follow on how exactly you want the commits done, as there are already multiple commits - do you mean you to squash them into one update for this PR?

@Mic92
Copy link
Member

Mic92 commented Sep 15, 2017

You can use git-reset to undo the commits and then add one commit per package update, with commit messages in the following style:

  • clion: 2017.2.1 -> 2017.2.2
  • gogland: 172.3757.46 -> 172.3968.45

The perl script update can be just one commit. And then just do git-push force.
This helps me with git-cherry-pick.

@bbarker
Copy link
Contributor Author

bbarker commented Sep 18, 2017 via email

@bbarker
Copy link
Contributor Author

bbarker commented Sep 18, 2017 via email

@edwtjo
Copy link
Member

edwtjo commented Sep 19, 2017

@volth AFAICT the chromium stuff is in base32, as is the majority of hashes in nixpkgs, as well as previous jetbrains/idea expressions. The reason is simple, base32 is more compact for manual edits and we're not really supposed to add generator scripts such as this into the tree, even though we continue to do so. This is also why we have nix-hash to help with the conversion. Regarding the academic discussion surrounding nix-lint: sure when there is such a thing that would be great but there isn't so lets make the generator follow majority rule. Right now AFAIK we only have nixpkgs-lint which doesn't check the hash, perhaps it should.

@edwtjo
Copy link
Member

edwtjo commented Sep 19, 2017

@volth that stuff gets merged without proper vetting, or by slip up, isn't an excuse for not doing the right thing when called upon. Neither is it psychologically pleasant to argue silly stuff like hash bases with contributors.

@Mic92
Copy link
Member

Mic92 commented Sep 19, 2017

Using base16 has the advantage, that we have the right checksum before downloading.

@edwtjo
Copy link
Member

edwtjo commented Sep 19, 2017

@Mic92 Sorry I don't understand what you mean, can you elaborate. I've just updated the generator to encode hashes as base32.

@edwtjo
Copy link
Member

edwtjo commented Sep 22, 2017

Cherry-picked appropriate changes in 14f2e0c

@edwtjo edwtjo closed this Sep 22, 2017
@Mic92
Copy link
Member

Mic92 commented Sep 22, 2017

done in e4a859a

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.

None yet

3 participants