NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.51k stars 13.69k forks source link

R Package httpgd not working #246953

Closed misaka4a92 closed 1 year ago

misaka4a92 commented 1 year ago

Describe the bug

rPackages.httpgd not working

Steps To Reproduce

Steps to reproduce the behavior: On NixOS 23.05

  1. flake.nix

    {
    description = "A basic flake with a shell";
    inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
    inputs.flake-utils.url = "github:numtide/flake-utils";
    
    outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = nixpkgs.legacyPackages.${system};
      in
      {
        devShells.default = pkgs.mkShell {
          nativeBuildInputs = with pkgs; [
            bashInteractive
            R
          ];
          buildInputs = (
            with pkgs; [
          ]) ++ (
            with pkgs.rPackages; [
              httpgd
          ]);
        };
      });
    }
  2. 
    $ LANG=C nix develop .
    $ R --no-save --no-restore

R version 4.3.1 (2023-06-16) -- "Beagle Scouts" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.

library(httpgd) httpgd::hgd() Error: path must point to a valid file sessionInfo() R version 4.3.1 (2023-06-16) Platform: x86_64-pc-linux-gnu (64-bit) Running under: NixOS 23.05 (Stoat)

Matrix products: default BLAS/LAPACK: /nix/store/ippl67a888i0481zxq4y7m50qjrkswj9-blas-3/lib/libblas.so.3; LAPACK version 3.9.0

locale: [1] C

time zone: Asia/Shanghai tzcode source: system (glibc)

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] httpgd_1.3.1

loaded via a namespace (and not attached): [1] compiler_4.3.1 later_1.3.1 Rcpp_1.0.10 systemfonts_1.0.4 [5] rlang_1.1.1

.libPaths() [1] "/nix/store/p59z3bf19ravp9fj7cqzgz37wbnad8gz-r-httpgd-1.3.1/library" [2] "/nix/store/k62mhv739j6wk8lbhw2nsh5hnv7clrin-r-BH-1.81.0-1/library" [3] "/nix/store/8kmw0yqqkxypvs5r59va4cci0gr8nirw-r-cpp11-0.4.3/library" [4] "/nix/store/v3zsjl3dizhr4xrg8xbqms9fy2rs4fwc-r-later-1.3.1/library" [5] "/nix/store/1f2883awpi8xnmb60gjfajycb27x9mwj-r-Rcpp-1.0.10/library" [6] "/nix/store/rivxsgphg57nflch2vcl61ldliinmqag-r-rlang-1.1.1/library" [7] "/nix/store/sc75anfiw4jaygsz3khs1lkjryykd3sx-r-systemfonts-1.0.4/library" [8] "/nix/store/w80wx4g5li3si4aqc092vpfzq58qx9f1-R-4.3.1/lib/R/library"

Expected behavior

on Debian sid, with httpgd installed from install.packages:

> hgd()
httpgd server running at:
  http://127.0.0.1:53615/live?token=PhZTvmMD
> sessionInfo()
R version 4.3.1 (2023-06-16)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux trixie/sid

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-openmp/libblas.so.3 
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-openmp/libopenblasp-r0.3.23.so;  LAPACK version 3.11.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: Asia/Shanghai
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] httpgd_1.3.1     ggsignif_0.6.4   ggfortify_0.4.16 patchwork_1.1.2 
 [5] lubridate_1.9.2  forcats_1.0.0    stringr_1.5.0    dplyr_1.1.2     
 [9] purrr_1.0.1      readr_2.1.4      tidyr_1.3.0      tibble_3.2.1    
[13] ggplot2_3.4.2    tidyverse_2.0.0  survival_3.5-5   furrr_0.3.1     
[17] future_1.33.0    stringi_1.7.12  

loaded via a namespace (and not attached):
 [1] utf8_1.2.3        generics_0.1.3    lattice_0.21-8    listenv_0.9.0    
 [5] hms_1.1.3         digest_0.6.33     magrittr_2.0.3    grid_4.3.1       
 [9] timechange_0.2.0  jsonlite_1.8.7    Matrix_1.6-0      gridExtra_2.3    
[13] fansi_1.0.4       scales_1.2.1      codetools_0.2-19  cli_3.6.1        
[17] rlang_1.1.1       crayon_1.5.2      parallelly_1.36.0 bit64_4.0.5      
[21] munsell_0.5.0     splines_4.3.1     withr_2.5.0       tools_4.3.1      
[25] parallel_4.3.1    tzdb_0.4.0        colorspace_2.1-0  globals_0.16.2   
[29] vctrs_0.6.3       R6_2.5.1          lifecycle_1.0.3   bit_4.0.5        
[33] vroom_1.6.3       pkgconfig_2.0.3   later_1.3.1       pillar_1.9.0     
[37] gtable_0.3.3      Rcpp_1.0.11       glue_1.6.2        systemfonts_1.0.4
[41] tidyselect_1.2.0  farver_2.1.1      labeling_0.4.2    compiler_4.3.1 

Screenshots

// If applicable, add screenshots to help explain your problem.

Additional context

This problem arose when trying to enable httpgd integration of vscode-R extension. I am not familiar with R packaging of nix, and I am not able to use install.packages("httpgd") to install this package under home directory, nor can I debug R codes. Since this problem appeared on NixOS but not on Debian, I opened an issue here.

Notify maintainers

@jbedo, Thanks!

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
- system: `"x86_64-linux"`
 - host os: `Linux 6.1.38, NixOS, 23.05 (Stoat), 23.05.20230717.53657af`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.13.3`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
jbedo commented 1 year ago

I'm unable to reproduce this with your flake expression :thinking:.

misaka4a92 commented 1 year ago

It also works after I restarted my computer... and I do not know why

misaka4a92 commented 1 year ago

And thank you for your patience!