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

rstudio: 1.2.5042 -> 1.4.1717 #139887

Merged
merged 5 commits into from
Oct 15, 2021
Merged

rstudio: 1.2.5042 -> 1.4.1717 #139887

merged 5 commits into from
Oct 15, 2021

Conversation

Artturin
Copy link
Member

@Artturin Artturin commented Sep 29, 2021

Motivation for this change
Things done

it launches but i dont use rstudio so please test

@mikepurvis the libyaml-cpp patch added in this will fix this #133921 (comment)

@james-atkins i used your expr as a reference https://github.com/james-atkins/dotfiles/blob/main/pkgs/rstudio/default.nix

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • 21.11 Release Notes (or backporting 21.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@Artturin Artturin force-pushed the rstudiobump branch 2 times, most recently from 60d4621 to 17d8b38 Compare September 29, 2021 15:23
Copy link
Contributor

@doronbehar doronbehar left a comment

Choose a reason for hiding this comment

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

Haven't tested the build yet.

pkgs/applications/editors/rstudio/default.nix Outdated Show resolved Hide resolved
pkgs/applications/editors/rstudio/default.nix Show resolved Hide resolved
@Artturin Artturin force-pushed the rstudiobump branch 2 times, most recently from 4201a00 to fb26508 Compare September 29, 2021 20:00
- "/usr/lib/libclang.so",
- "/usr/lib/llvm/libclang.so",
- "/usr/lib64/libclang.so",
- "/usr/lib64/llvm/libclang.so",
+ "@libclang.so@"
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not an expert here, but isn't this likely to be a fragile patch, since all the removed content will need to match exactly in the future in order for it to apply cleanly? I'm wondering it it might be safer to just patch in an early return at the top of the function instead and otherwise leave the rest of it intact? eg:

std::vector<std::string> systemClangVersions()
{
    return { "@libclang.so@" };
    [ other content remains unaltered ]
}

@Artturin
Copy link
Member Author

Rstudio has now switched to a new versioning scheme 2021.09.0+351...
https://github.com/rstudio/rstudio/releases

pkgs/applications/editors/rstudio/update.sh Outdated Show resolved Hide resolved
nixpkgsTop="$(git rev-parse --show-toplevel)"
rstudioDir="$nixpkgsTop/pkgs/applications/editors/rstudio"

nix-update rstudio
Copy link
Contributor

Choose a reason for hiding this comment

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

You can grab the latest rstudio version with GitHub's API with

version=$(curl --silent https://api.github.com/repos/rstudio/rstudio/releases/latest | jq --raw-output '.tag_name')

And not use nix-update, but write the sha256 of the src to an external file and read it in the default.nix expression with:

nix shell nixpkgs#nix-prefetch-git -c nix-prefetch-git https://github.com/rstudio/rstudio --rev ${version} > $dirname/sha256

What's interesting though, is that the curl command above doesn't list any published releases, and using:

curl --silent https://api.github.com/repos/rstudio/rstudio/tags | jq '.[0]'

Doesn't return the newest tag with the new version scheme, has't yet figure out why..

Copy link
Contributor

@doronbehar doronbehar Oct 3, 2021

Choose a reason for hiding this comment

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

@Artturin Perhaps this will work for us, at least until they'll make a major change in their website:

curl --silent 'https://www.rstudio.com/products/rstudio/download/' | pup ':parent-of(h3:contains("Source Code")) > a  > attr{href}' | awk -F/ '{gsub(/^v/, "", $NF); print $NF}'

Of course there should be somekind of a check that the version found there is not empty.


nix-update rstudio

rstudioVer="$(nix-build -A rstudio.version --no-out-link)"
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be removed if you'd use

  version = lib.fileContents ./version;

pkgs/applications/editors/rstudio/update.sh Outdated Show resolved Hide resolved
@Artturin
Copy link
Member Author

@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/vvrn1bd8lr16m1ixllbvlxyxbsmkbgbn-release-0.3.0.tar.gz
source root is yaml-cpp-release-0.3.0
setting SOURCE_DATE_EPOCH to timestamp 1327135916 of file yaml-cpp-release-0.3.0/yaml-cpp.pc.cmake
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
applying patch /nix/store/k30pc3chcgqd3zpmf4khif3w1jb4narm-4f48727b365962e31451cd91027bd797bc7d2ee7.patch
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- a/yaml-cpp-config.cmake.in
|+++ b/yaml-cpp-config.cmake.in
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
1 out of 1 hunk ignored

@Artturin Artturin force-pushed the rstudiobump branch 2 times, most recently from e0bce90 to 66fd4df Compare October 12, 2021 20:21
@Artturin Artturin changed the title rstudio: 1.2.5042 -> 1.4.1717 rstudio: 1.2.5042 -> 2021.09.0+351 Oct 12, 2021
@Artturin Artturin force-pushed the rstudiobump branch 2 times, most recently from bac5378 to 9dda236 Compare October 12, 2021 20:25
@Artturin
Copy link
Member Author

launching rstudio when version is at 2021.09.0+351

2021-10-12T20:24:11.343878Z [rdesktop] ERROR system error 2 (No such file or directory) [path: /nix/store/nyv8aap6qwbbjyszxbly5mlvzyqlvyik-RStudio-2021.09.0+351/lib/rstudio/bin/resources/html/loading.html]; OCCURRED AT rstudio::core::Error rstudio::core::FilePath::openForRead(std::shared_ptr<std::basic_istream<char> >&) const src/cpp/shared_core/FilePath.cpp:1453; LOGGED FROM: void rstudio::desktop::MainWindow::onLoadFinished(bool) src/cpp/desktop/DesktopMainWindow.cpp:714

@Artturin Artturin changed the title rstudio: 1.2.5042 -> 2021.09.0+351 rstudio: 1.2.5042 -> 1.4.1717 Oct 12, 2021
@phirsch
Copy link

phirsch commented Oct 13, 2021

2021-10-12T20:24:11.343878Z [rdesktop] ERROR system error 2 (No such file or directory) [path: /nix/store/nyv8aap6qwbbjyszxbly5mlvzyqlvyik-RStudio-2021.09.0+351/lib/rstudio/bin/resources/html/loading.html]; OCCURRED AT rstudio::core::Error rstudio::core::FilePath::openForRead(std::shared_ptr<std::basic_istream >&) const src/cpp/shared_core/FilePath.cpp:1453; LOGGED FROM: void rstudio::desktop::MainWindow::onLoadFinished(bool) src/cpp/desktop/DesktopMainWindow.cpp:714

FWIW: There is a resources/html/loading.html file under /lib/rstudio (i.e. one level up from /lib/rstudio/bin).

@Artturin Artturin force-pushed the rstudiobump branch 2 times, most recently from dca1d58 to 8ed57e5 Compare October 13, 2021 17:03
@Artturin
Copy link
Member Author

Artturin commented Oct 13, 2021

the problem with libyamlcpp is because there's a libyamlcpp_0_3 and the patch is being applied to it, osm2xmap doesn't build with the newest libyamlcpp even after applying to cmake patch @mpickering

@Artturin
Copy link
Member Author

Result of nixpkgs-review pr 139887 run on x86_64-linux 1

32 packages built:
  • blender
  • brise
  • calamares
  • d-seams
  • dcm2niix
  • facter
  • fcitx-engines.rime
  • fcitx5-rime
  • ibus-engines.rime
  • interception-tools
  • ip2unix
  • liblinphone
  • librime
  • libyamlcpp
  • libyamlcpp_0_3
  • lime
  • linphone
  • luaformatter
  • micromamba
  • mongodb (mongodb-3_4)
  • mongodb-3_6
  • mongodb-4_0
  • mongodb-4_2
  • opencolorio
  • openxcom
  • osm2xmap
  • powerdns
  • rime-data
  • rstudio
  • rstudioWrapper
  • soci
  • thinkfan

@Artturin
Copy link
Member Author

merging without the update script

#!/usr/bin/env nix-shell
#!nix-shell -i bash -p nix-update yarn2nix

set -euo pipefail

dirname="$(dirname "$0")"

nix-update rstudio

rstudioVer="$(nix-build -A rstudio.version --no-out-link)"

packageJSON="https://raw.githubusercontent.com/rstudio/rstudio/${rstudioVer}/src/gwt/panmirror/src/editor/package.json"
yarnLock="https://raw.githubusercontent.com/rstudio/rstudio/${rstudioVer}/src/gwt/panmirror/src/editor/yarn.lock"

curl --silent "$packageJSON" -o $dirname/package.json
curl --silent "$yarnLock" -o $dirname/yarn.lock
yarn2nix --lockfile=$dirname/yarn.lock > $dirname/yarndeps.nix

@doronbehar
Copy link
Contributor

launching rstudio when version is at 2021.09.0+351

2021-10-12T20:24:11.343878Z [rdesktop] ERROR system error 2 (No such file or directory) [path: /nix/store/nyv8aap6qwbbjyszxbly5mlvzyqlvyik-RStudio-2021.09.0+351/lib/rstudio/bin/resources/html/loading.html]; OCCURRED AT rstudio::core::Error rstudio::core::FilePath::openForRead(std::shared_ptr<std::basic_istream<char> >&) const src/cpp/shared_core/FilePath.cpp:1453; LOGGED FROM: void rstudio::desktop::MainWindow::onLoadFinished(bool) src/cpp/desktop/DesktopMainWindow.cpp:714

Did you report this upstream?

@Artturin
Copy link
Member Author

launching rstudio when version is at 2021.09.0+351

2021-10-12T20:24:11.343878Z [rdesktop] ERROR system error 2 (No such file or directory) [path: /nix/store/nyv8aap6qwbbjyszxbly5mlvzyqlvyik-RStudio-2021.09.0+351/lib/rstudio/bin/resources/html/loading.html]; OCCURRED AT rstudio::core::Error rstudio::core::FilePath::openForRead(std::shared_ptr<std::basic_istream<char> >&) const src/cpp/shared_core/FilePath.cpp:1453; LOGGED FROM: void rstudio::desktop::MainWindow::onLoadFinished(bool) src/cpp/desktop/DesktopMainWindow.cpp:714

Did you report this upstream?

grepping the repo i found

src/cpp/desktop/DesktopOptions.cpp
459:FilePath Options::resourcesPath() const
460-{
461:   if (resourcesPath_.isEmpty())
462-   {
463-#ifdef RSTUDIO_PACKAGE_BUILD
464-      // release configuration: the 'resources' folder is
465-      // part of the supporting files folder
466:      resourcesPath_ = supportingFilePath().completePath("resources");
467-#else
468-      // developer configuration: the 'resources' folder is
469-      // a sibling of the RStudio executable
470:      resourcesPath_ = scriptsPath().completePath("resources");
471-#endif
472-   }
473-
474:   return resourcesPath_

so i'll try -DRSTUDIO_PACKAGE_BUILD=1
which is set in https://github.com/rstudio/rstudio/blob/5defcf967a3f1ba06ad9d4b289fff33efacb62a6/package/linux/make-package#L78 during their builds

@Artturin
Copy link
Member Author

:/ someone else may update to to the newest version

RStudio> CMake Error at /nix/store/m33sn6h5kgfbk3z4avwmgxam1dny07i0-cmake-3.21.2/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
RStudio>   Could NOT find Boost (missing: atomic date_time filesystem iostreams
RStudio>   program_options random regex thread) (found suitable version "1.69.0",
RStudio>   minimum required is "1.69.0")
RStudio> Call Stack (most recent call first):
RStudio>   /nix/store/m33sn6h5kgfbk3z4avwmgxam1dny07i0-cmake-3.21.2/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
RStudio>   /nix/store/m33sn6h5kgfbk3z4avwmgxam1dny07i0-cmake-3.21.2/share/cmake-3.21/Modules/FindBoost.cmake:2345 (find_package_handle_standard_args)

@Artturin Artturin merged commit db56940 into NixOS:master Oct 15, 2021
@Artturin Artturin deleted the rstudiobump branch October 15, 2021 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants