Skip to content

Commit

Permalink
Merge branch 'master' into with-nix-file-arg
Browse files Browse the repository at this point in the history
keep up with 0.5.1 in master
  • Loading branch information
philipp-baumann committed Jan 16, 2024
2 parents dfa1770 + 28706de commit 1aa7832
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 29 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: rix
Title: Rix: Reproducible Environments With Nix
Version: 0.5.0
Version: 0.5.1
Authors@R: c(
person("Bruno", "Rodrigues", , "bruno@brodrigues.co", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-3211-3689")),
Expand Down
10 changes: 10 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
<!-- NEWS.md is maintained by https://fledge.cynkra.com, contributors should not edit this file -->

# rix 0.5.1 (2024-01-16)

## Bug fixes

- `rix::rix()`: patch for nixpkgs revisions corresponding to R (`r_ver`)
<= 4.2.0; `nix-build` failed because attribute `glibcLocalesUtf8` was
not found. Fixed by importing `gibcLocales`. Thanks @motorlearner for
reporting.


# rix 0.5.0 (2024-01-07)

## Features
Expand Down
2 changes: 1 addition & 1 deletion R/detect_os.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ detect_os <- function(){
generate_locale_archive <- function(os){
os <- detect_os()
if (os == "Linux" || os == "Darwin") {
'LOCALE_ARCHIVE = if pkgs.system == \"x86_64-linux\" then \"${pkgs.glibcLocalesUtf8}/lib/locale/locale-archive\" else \"\";'
'LOCALE_ARCHIVE = if pkgs.system == \"x86_64-linux\" then \"${pkgs.glibcLocales}/lib/locale/locale-archive\" else \"\";'
} else {
stop("Operating System unsupported")
}
Expand Down
9 changes: 3 additions & 6 deletions R/find_rev.R
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,7 @@ fetchpkgs <- function(git_pkgs, archive_pkgs){
#' If there are good reasons to not stick to the default, you can set your
#' preferred locale variables via
#' `options(rix.nix_locale_variables = list(LANG = "de_CH.UTF-8", <...>)`
#' and the aforementioned locale variable names. However, you should use
#' UTF-8 locales since we import the `glibcLocalesUtf8` set only, to not
#' download the full set of locales and thereby keep the size reasonably
#' small.
#' and the aforementioned locale variable names.
#' @export
rix <- function(r_ver = "latest",
r_pkgs = NULL,
Expand Down Expand Up @@ -467,7 +464,7 @@ tex_pkgs)
# to add it.
generate_system_pkgs <- function(system_pkgs){
sprintf('system_packages = builtins.attrValues {
inherit (pkgs) R glibcLocalesUtf8 %s;
inherit (pkgs) R glibcLocales %s;
};
',
get_system_pkgs(system_pkgs))
Expand Down Expand Up @@ -591,7 +588,7 @@ create_default_nix <- function(path = file.path("inst", "extdata",
package_name = "rix",
repo_url = "https://github.com/b-rodrigues/rix",
branch_name = "master",
commit = "a7b1659a5676ba34dfb68009d1993fc53431a4e3"
commit = "22711ee98c0092e56c620122800ca8f30b773a65"
)
),
ide = "other",
Expand Down
9 changes: 3 additions & 6 deletions dev/build_envs.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,7 @@ you use another IDE, you can leave the "ide" argument blank:
#' If there are good reasons to not stick to the default, you can set your
#' preferred locale variables via
#' `options(rix.nix_locale_variables = list(LANG = "de_CH.UTF-8", <...>)`
#' and the aforementioned locale variable names. However, you should use
#' UTF-8 locales since we import the `glibcLocalesUtf8` set only, to not
#' download the full set of locales and thereby keep the size reasonably
#' small.
#' and the aforementioned locale variable names.
#' @export
rix <- function(r_ver = "latest",
r_pkgs = NULL,
Expand Down Expand Up @@ -551,7 +548,7 @@ tex_pkgs)
# to add it.
generate_system_pkgs <- function(system_pkgs){
sprintf('system_packages = builtins.attrValues {
inherit (pkgs) R glibcLocalesUtf8 %s;
inherit (pkgs) R glibcLocales %s;
};
',
get_system_pkgs(system_pkgs))
Expand Down Expand Up @@ -679,7 +676,7 @@ create_default_nix <- function(path = file.path("inst", "extdata",
package_name = "rix",
repo_url = "https://github.com/b-rodrigues/rix",
branch_name = "master",
commit = "a7b1659a5676ba34dfb68009d1993fc53431a4e3"
commit = "22711ee98c0092e56c620122800ca8f30b773a65"
)
),
ide = "other",
Expand Down
2 changes: 1 addition & 1 deletion dev/get_os.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ This function adds deals with locale on Linux (and WSL2):
generate_locale_archive <- function(os){
os <- detect_os()
if (os == "Linux" || os == "Darwin") {
'LOCALE_ARCHIVE = if pkgs.system == \"x86_64-linux\" then \"${pkgs.glibcLocalesUtf8}/lib/locale/locale-archive\" else \"\";'
'LOCALE_ARCHIVE = if pkgs.system == \"x86_64-linux\" then \"${pkgs.glibcLocales}/lib/locale/locale-archive\" else \"\";'
} else {
stop("Operating System unsupported")
}
Expand Down
20 changes: 10 additions & 10 deletions inst/extdata/default.nix
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
# This file was generated by the {rix} R package v0.4.1 on 2023-10-06
# This file was generated by the {rix} R package v0.5.0 on 2024-01-16
# with following call:
# >rix(r_ver = "7131f3c223a2d799568e4b278380cd9dac2b8579",
# >rix(r_ver = "e0629618b4b419a47e2c8a3cab223e2a7f3a8f97",
# > r_pkgs = NULL,
# > system_pkgs = NULL,
# > git_pkgs = list(list(package_name = "rix",
# > repo_url = "https://github.com/b-rodrigues/rix",
# > branch_name = "master",
# > commit = "a7b1659a5676ba34dfb68009d1993fc53431a4e3")),
# > commit = "22711ee98c0092e56c620122800ca8f30b773a65")),
# > ide = "other",
# > project_path = dirname(path),
# > overwrite = TRUE,
# > shell_hook = "R --vanilla")
# It uses nixpkgs' revision 7131f3c223a2d799568e4b278380cd9dac2b8579 for reproducibility purposes
# It uses nixpkgs' revision e0629618b4b419a47e2c8a3cab223e2a7f3a8f97 for reproducibility purposes
# which will install R version latest
# Report any issues to https://github.com/b-rodrigues/rix
let
pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/7131f3c223a2d799568e4b278380cd9dac2b8579.tar.gz") {};
pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/e0629618b4b419a47e2c8a3cab223e2a7f3a8f97.tar.gz") {};
git_archive_pkgs = [(pkgs.rPackages.buildRPackage {
name = "rix";
src = pkgs.fetchgit {
url = "https://github.com/b-rodrigues/rix";
branchName = "master";
rev = "a7b1659a5676ba34dfb68009d1993fc53431a4e3";
sha256 = "sha256-Z30dTSJW5jZjkC1I7mpAzuQthY4imc84r0V2cSp4XwM=";
rev = "22711ee98c0092e56c620122800ca8f30b773a65";
sha256 = "sha256-uCyvALQ7F6qHh8/c0VS7T+/svtGEMEg2f7/+sUinbMo=";
};
propagatedBuildInputs = builtins.attrValues {
inherit (pkgs.rPackages) httr jsonlite sys;
inherit (pkgs.rPackages) codetools httr jsonlite sys;
};
}) ];
system_packages = builtins.attrValues {
inherit (pkgs) R glibcLocalesUtf8 ;
inherit (pkgs) R glibcLocales ;
};
in
pkgs.mkShell {
LOCALE_ARCHIVE = if pkgs.system == "x86_64-linux" then "${pkgs.glibcLocalesUtf8}/lib/locale/locale-archive" else "";
LOCALE_ARCHIVE = if pkgs.system == "x86_64-linux" then "${pkgs.glibcLocales}/lib/locale/locale-archive" else "";
LANG = "en_US.UTF-8";
LC_ALL = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
Expand Down
5 changes: 1 addition & 4 deletions man/rix.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1aa7832

Please sign in to comment.