Merge pull request #139312 from jbedo/r-broken

rPackages: mark packages as broken when generating package sets

authored by Matthieu Coudron and committed by GitHub 639df4e2 92357f5e

+24 -8
+12 -8
doc/languages-frameworks/r.section.md
··· 96 97 ## Updating the package set {#updating-the-package-set} 98 99 ```bash 100 nix-shell generate-shell.nix 101 ··· 112 mv bioc-experiment-packages.nix.new bioc-experiment-packages.nix 113 ``` 114 115 - `generate-r-packages.R <repo>` reads `<repo>-packages.nix`, therefor the renaming. 116 117 - ## Testing if the Nix-expression could be evaluated {#testing-if-the-nix-expression-could-be-evaluated} 118 - 119 - ```bash 120 - nix-build test-evaluation.nix --dry-run 121 - ``` 122 - 123 - If this exits fine, the expression is ok. If not, you have to edit `default.nix`
··· 96 97 ## Updating the package set {#updating-the-package-set} 98 99 + There is a script and associated environment for regenerating the package 100 + sets and synchronising the rPackages tree to the current CRAN and matching 101 + BIOC release. These scripts are found in the `pkgs/development/r-modules` 102 + directory and executed as follows: 103 + 104 ```bash 105 nix-shell generate-shell.nix 106 ··· 117 mv bioc-experiment-packages.nix.new bioc-experiment-packages.nix 118 ``` 119 120 + `generate-r-packages.R <repo>` reads `<repo>-packages.nix`, therefore 121 + the renaming. 122 123 + Some packages require overrides to specify external dependencies or other 124 + patches and special requirements. These overrides are specified in the 125 + `pkgs/development/r-modules/default.nix` file. As the `*-packages.nix` 126 + contents are automatically generated it should not be edited and broken 127 + builds should be addressed using overrides.
+12
pkgs/development/r-modules/generate-r-packages.R
··· 82 nix <- apply(pkgs, 1, function(p) formatPackage(p[1], p[2], p[18], p[4], p[5], p[6])) 83 write("done", stderr()) 84 85 cat("# This file is generated from generate-r-packages.R. DO NOT EDIT.\n") 86 cat("# Execute the following command to update the file.\n") 87 cat("#\n") ··· 95 cat(";\n") 96 cat("in with self; {\n") 97 cat(paste(nix, collapse="\n"), "\n", sep="") 98 cat("}\n") 99 100 stopCluster(cl)
··· 82 nix <- apply(pkgs, 1, function(p) formatPackage(p[1], p[2], p[18], p[4], p[5], p[6])) 83 write("done", stderr()) 84 85 + # Mark deleted packages as broken 86 + setkey(readFormatted, V2) 87 + markBroken <- function(name) { 88 + str <- paste0(readFormatted[name], collapse='"') 89 + if(sum(grep("broken = true;", str))) 90 + return(str) 91 + write(paste("marked", name, "as broken"), stderr()) 92 + gsub("};$", "broken = true; };", str) 93 + } 94 + broken <- lapply(setdiff(readFormatted[[2]], pkgs[[1]]), markBroken) 95 + 96 cat("# This file is generated from generate-r-packages.R. DO NOT EDIT.\n") 97 cat("# Execute the following command to update the file.\n") 98 cat("#\n") ··· 106 cat(";\n") 107 cat("in with self; {\n") 108 cat(paste(nix, collapse="\n"), "\n", sep="") 109 + cat(paste(broken, collapse="\n"), "\n", sep="") 110 cat("}\n") 111 112 stopCluster(cl)