klmr / box

Write reusable, composable and modular R code
https://klmr.me/box/
MIT License
862 stars 48 forks source link

GitHub version is broken: ERROR: a 'NAMESPACE' file is required; object 'c_strict_extract' not found #321

Closed barracuda156 closed 1 year ago

barracuda156 commented 1 year ago

Error description

GitHub version does not install, failing due to missing NAMESPACE, and tests are broken:

R version 4.3.0 (2023-04-21) -- "Already Tomorrow"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: powerpc-apple-darwin10.8.0 (32-bit)

> # Needed for subshells openend in tests, and does no harm otherwise.
> # See <https://github.com/hadley/testthat/issues/144> for details.
> Sys.setenv(R_TESTS = '')
> testthat::test_check('box')
Loading required package: box

Attaching package: 'box'

The following object is masked from 'package:utils':

    help

The following objects are masked from 'package:base':

    file, topenv

Attaching package: 'testthat'

The following object is masked from 'package:box':

    expect

[ FAIL 96 | WARN 0 | SKIP 10 | PASS 332 ]

══ Skipped tests ═══════════════════════════════════════════════════════════════
• On CRAN (6)
• Only run on Windows (1)
• Outside source code repository (3)

══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-S3.r:34:5'): S3 methods are found ──────────────────────────────
Error in `box::use(mod/s3)`: object 'c_strict_extract' not found
Backtrace:
     ▆
  1. └─box::use(mod/s3) at test-S3.r:34:4
  2.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  3.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  4.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
  5.         └─box (local) `<fn>`(...)
  6.           └─box::rethrow_on_error(...)
  7.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
  8.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  9.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 10.                   └─value[[3L]](cond)
 11.                     └─box::rethrow(error, call)
── Error ('test-S3.r:47:5'): can call S3 methods without attaching ─────────────
Error in `box::use(mod/s3)`: object 'c_strict_extract' not found
Backtrace:
     ▆
  1. └─box::use(mod/s3) at test-S3.r:47:4
  2.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  3.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  4.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
  5.         └─box (local) `<fn>`(...)
  6.           └─box::rethrow_on_error(...)
  7.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
  8.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  9.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 10.                   └─value[[3L]](cond)
 11.                     └─box::rethrow(error, call)
── Error ('test-S3.r:56:5'): S3 methods are not registered twice ───────────────
Error in `box::use(mod/s3)`: object 'c_strict_extract' not found
Backtrace:
     ▆
  1. └─box::use(mod/s3) at test-S3.r:56:4
  2.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  3.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  4.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
  5.         └─box (local) `<fn>`(...)
  6.           └─box::rethrow_on_error(...)
  7.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
  8.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  9.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 10.                   └─value[[3L]](cond)
 11.                     └─box::rethrow(error, call)
── Error ('test-S3.r:72:5'): Forwarded S3 genetics without methods work ────────
<box_error/error/condition>
Error in `box::use(mod/s3_b)`: unable to load module "./s3"; not found in "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-box/R-box/work/box-1.1.3/box.Rcheck/tests/testthat"
Backtrace:
     ▆
  1. └─box::use(mod/s3_b) at test-S3.r:72:4
  2.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  3.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  4.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
  5.         └─box (local) `<fn>`(...)
  6.           └─box::rethrow_on_error(...)
  7.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
  8.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  9.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 10.                   └─value[[3L]](cond)
 11.                     └─box::rethrow(error, call)
── Failure ('test-S3.r:78:5'): `is_S3_user_generic` can deal with substituted functions ──
`box::use(mod/issue125)` threw an error.
Message: object 'c_strict_extract' not found
Class:   simpleError/box_error/error/condition
Backtrace:
     ▆
  1. ├─testthat::expect_error(box::use(mod/issue125), NA) at test-S3.r:78:4
  2. │ └─testthat:::quasi_capture(...)
  3. │   ├─testthat (local) .capture(...)
  4. │   │ └─base::withCallingHandlers(...)
  5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  6. └─box::use(mod/issue125)
  7.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  8.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  9.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
 10.         └─box (local) `<fn>`(...)
 11.           └─box::rethrow_on_error(...)
 12.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
 13.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 14.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 15.                   └─value[[3L]](cond)
 16.                     └─box::rethrow(error, call)
── Failure ('test-S3.r:82:5'): nested functions are parsed correctly ───────────
`box::use(mod/issue203)` threw an error.
Message: object 'c_strict_extract' not found
Class:   simpleError/box_error/error/condition
Backtrace:
     ▆
  1. ├─testthat::expect_error(box::use(mod/issue203), NA) at test-S3.r:82:4
  2. │ └─testthat:::quasi_capture(...)
  3. │   ├─testthat (local) .capture(...)
  4. │   │ └─base::withCallingHandlers(...)
  5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  6. └─box::use(mod/issue203)
  7.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  8.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  9.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
 10.         └─box (local) `<fn>`(...)
 11.           └─box::rethrow_on_error(...)
 12.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
 13.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 14.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 15.                   └─value[[3L]](cond)
 16.                     └─box::rethrow(error, call)
── Error ('test-S3.r:83:5'): nested functions are parsed correctly ─────────────
Error in `eval(code, test_env)`: object 'issue203' not found
Backtrace:
    ▆
 1. ├─testthat::expect_false(box:::is_S3_user_generic("g", issue203)) at test-S3.r:83:4
 2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
 3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
 4. └─box:::is_S3_user_generic("g", issue203)
 5.   └─base::bindingIsActive(function_name, envir)
── Error ('test-active.r:4:5'): active bindings can be exported ────────────────
Error in `box::use(mod/active)`: object 'c_strict_extract' not found
Backtrace:
     ▆
  1. └─box::use(mod/active) at test-active.r:4:4
  2.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  3.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  4.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
  5.         └─box (local) `<fn>`(...)
  6.           └─box::rethrow_on_error(...)
  7.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
  8.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  9.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 10.                   └─value[[3L]](cond)
 11.                     └─box::rethrow(error, call)
── Error ('test-active.r:12:5'): active bindings can be attached ───────────────
Error in `box::use(mod/active[...])`: object 'c_strict_extract' not found
Backtrace:
     ▆
  1. └─box::use(mod/active[...]) at test-active.r:12:4
  2.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  3.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  4.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
  5.         └─box (local) `<fn>`(...)
  6.           └─box::rethrow_on_error(...)
  7.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
  8.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  9.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 10.                   └─value[[3L]](cond)
 11.                     └─box::rethrow(error, call)
── Error ('test-basic.r:14:5'): module can be imported ─────────────────────────
Error in `box::use(mod/a)`: object 'c_strict_extract' not found
Backtrace:
     ▆
  1. └─box::use(mod/a) at test-basic.r:14:4
  2.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  3.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  4.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
  5.         └─box (local) `<fn>`(...)
  6.           └─box::rethrow_on_error(...)
  7.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
  8.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  9.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 10.                   └─value[[3L]](cond)
 11.                     └─box::rethrow(error, call)
── Error ('test-basic.r:21:9'): import works in global namespace ───────────────
Error in `box::use(mod/a)`: object 'c_strict_extract' not found
Backtrace:
     ▆
  1. ├─base::eval(...)
  2. │ └─base::eval(...)
  3. └─box::use(mod/a) at test-basic.r:21:8
  4.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  5.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  6.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
  7.         └─box (local) `<fn>`(...)
  8.           └─box::rethrow_on_error(...)
  9.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
 10.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 11.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 12.                   └─value[[3L]](cond)
 13.                     └─box::rethrow(error, call)
── Error ('test-basic.r:29:5'): module is uniquely identified by path ──────────
Error in `box::use(mod/a)`: object 'c_strict_extract' not found
Backtrace:
     ▆
  1. └─box::use(mod/a) at test-basic.r:29:4
  2.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  3.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  4.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
  5.         └─box (local) `<fn>`(...)
  6.           └─box::rethrow_on_error(...)
  7.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
  8.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  9.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 10.                   └─value[[3L]](cond)
 11.                     └─box::rethrow(error, call)
── Error ('test-basic.r:39:5'): can use imported function ──────────────────────
Error in `box::use(mod/a)`: object 'c_strict_extract' not found
Backtrace:
     ▆
  1. └─box::use(mod/a) at test-basic.r:39:4
  2.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  3.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  4.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
  5.         └─box (local) `<fn>`(...)
  6.           └─box::rethrow_on_error(...)
  7.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
  8.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  9.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 10.                   └─value[[3L]](cond)
 11.                     └─box::rethrow(error, call)
── Error ('test-basic.r:44:5'): modules export all objects ─────────────────────
Error in `box::use(mod/a)`: object 'c_strict_extract' not found
Backtrace:
     ▆
  1. └─box::use(mod/a) at test-basic.r:44:4
  2.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  3.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  4.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
  5.         └─box (local) `<fn>`(...)
  6.           └─box::rethrow_on_error(...)
  7.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
  8.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  9.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 10.                   └─value[[3L]](cond)
 11.                     └─box::rethrow(error, call)
── Error ('test-basic.r:52:5'): module can modify its variables ────────────────
Error in `box::use(mod/a)`: object 'c_strict_extract' not found
Backtrace:
     ▆
  1. └─box::use(mod/a) at test-basic.r:52:4
  2.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  3.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  4.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
  5.         └─box (local) `<fn>`(...)
  6.           └─box::rethrow_on_error(...)
  7.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
  8.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  9.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 10.                   └─value[[3L]](cond)
 11.                     └─box::rethrow(error, call)
── Error ('test-basic.r:59:5'): hidden objects are not exported ────────────────
Error in `box::use(mod/a)`: object 'c_strict_extract' not found
Backtrace:
     ▆
  1. └─box::use(mod/a) at test-basic.r:59:4
  2.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  3.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  4.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
  5.         └─box (local) `<fn>`(...)
  6.           └─box::rethrow_on_error(...)
  7.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
  8.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  9.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 10.                   └─value[[3L]](cond)
 11.                     └─box::rethrow(error, call)
── Error ('test-basic.r:69:5'): module bindings are locked ─────────────────────
Error in `box::use(mod/a)`: object 'c_strict_extract' not found
Backtrace:
     ▆
  1. └─box::use(mod/a) at test-basic.r:69:4
  2.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  3.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  4.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
  5.         └─box (local) `<fn>`(...)
  6.           └─box::rethrow_on_error(...)
  7.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
  8.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  9.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 10.                   └─value[[3L]](cond)
 11.                     └─box::rethrow(error, call)
── Failure ('test-basic.r:81:5'): modules don’t need exports ───────────────────
`box::use(mod/no_exports)` threw an error.
Message: unable to load module "./a"; not found in "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-box/R-box/work/box-1.1.3/box.Rcheck/tests/testthat"
Class:   box_error/error/condition
Backtrace:
     ▆
  1. ├─testthat::expect_error(box::use(mod/no_exports), NA) at test-basic.r:81:4
  2. │ └─testthat:::quasi_capture(...)
  3. │   ├─testthat (local) .capture(...)
  4. │   │ └─base::withCallingHandlers(...)
  5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  6. └─box::use(mod/no_exports)
  7.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  8.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  9.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
 10.         └─box (local) `<fn>`(...)
 11.           └─box::rethrow_on_error(...)
 12.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
 13.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 14.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 15.                   └─value[[3L]](cond)
 16.                     └─box::rethrow(error, call)
── Failure ('test-basic.r:82:5'): modules don’t need exports ───────────────────
`capture.output(box::use(mod/no_names))` threw an error.
Message: object 'c_strict_extract' not found
Class:   simpleError/box_error/error/condition
Backtrace:
     ▆
  1. ├─testthat::expect_error(...) at test-basic.r:82:4
  2. │ └─testthat:::quasi_capture(...)
  3. │   ├─testthat (local) .capture(...)
  4. │   │ └─base::withCallingHandlers(...)
  5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  6. ├─utils::capture.output(box::use(mod/no_names))
  7. │ └─base::withVisible(...elt(i))
  8. └─box::use(mod/no_names)
  9.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
 10.     └─base::Map(.f, ..., USE.NAMES = FALSE)
 11.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
 12.         └─box (local) `<fn>`(...)
 13.           └─box::rethrow_on_error(...)
 14.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
 15.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 16.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 17.                   └─value[[3L]](cond)
 18.                     └─box::rethrow(error, call)
── Failure ('test-basic.r:83:5'): modules don’t need exports ───────────────────
ls() (`actual`) and c("no_exports", "no_names") (`expected`) don't have the same values.
* Only in `actual`:   

── Failure ('test-basic.r:87:5'): modules can be empty ─────────────────────────
`box::use(mod/empty)` threw an error.
Message: object 'c_strict_extract' not found
Class:   simpleError/box_error/error/condition
Backtrace:
     ▆
  1. ├─testthat::expect_error(box::use(mod/empty), NA) at test-basic.r:87:4
  2. │ └─testthat:::quasi_capture(...)
  3. │   ├─testthat (local) .capture(...)
  4. │   │ └─base::withCallingHandlers(...)
  5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  6. └─box::use(mod/empty)
  7.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  8.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  9.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
 10.         └─box (local) `<fn>`(...)
 11.           └─box::rethrow_on_error(...)
 12.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
 13.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 14.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 15.                   └─value[[3L]](cond)
 16.                     └─box::rethrow(error, call)
── Failure ('test-basic.r:88:5'): modules can be empty ─────────────────────────
`box::use(mod/export_empty)` threw an error.
Message: unable to load module "./empty"; not found in "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-box/R-box/work/box-1.1.3/box.Rcheck/tests/testthat"
Class:   box_error/error/condition
Backtrace:
     ▆
  1. ├─testthat::expect_error(box::use(mod/export_empty), NA) at test-basic.r:88:4
  2. │ └─testthat:::quasi_capture(...)
  3. │   ├─testthat (local) .capture(...)
  4. │   │ └─base::withCallingHandlers(...)
  5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  6. └─box::use(mod/export_empty)
  7.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  8.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  9.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
 10.         └─box (local) `<fn>`(...)
 11.           └─box::rethrow_on_error(...)
 12.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
 13.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 14.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 15.                   └─value[[3L]](cond)
 16.                     └─box::rethrow(error, call)
── Error ('test-basic.r:100:5'): package exports do not leak into modules ──────
Error in `box::use(mod/a)`: object 'c_strict_extract' not found
Backtrace:
     ▆
  1. └─box::use(mod/a) at test-basic.r:100:4
  2.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  3.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  4.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
  5.         └─box (local) `<fn>`(...)
  6.           └─box::rethrow_on_error(...)
  7.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
  8.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  9.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 10.                   └─value[[3L]](cond)
 11.                     └─box::rethrow(error, call)
── Error ('test-basic.r:110:5'): partial name causes error ─────────────────────
Error in `box::use(mod/a)`: object 'c_strict_extract' not found
Backtrace:
     ▆
  1. └─box::use(mod/a) at test-basic.r:110:4
  2.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  3.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  4.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
  5.         └─box (local) `<fn>`(...)
  6.           └─box::rethrow_on_error(...)
  7.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
  8.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  9.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 10.                   └─value[[3L]](cond)
 11.                     └─box::rethrow(error, call)
── Failure ('test-basic.r:121:5'): trailing comma is accepted ──────────────────
`box::use(mod/a, )` threw an error.
Message: object 'c_strict_extract' not found
Class:   simpleError/box_error/error/condition
Backtrace:
     ▆
  1. ├─testthat::expect_error(box::use(mod/a, ), NA) at test-basic.r:121:4
  2. │ └─testthat:::quasi_capture(...)
  3. │   ├─testthat (local) .capture(...)
  4. │   │ └─base::withCallingHandlers(...)
  5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  6. └─box::use(mod/a, )
  7.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  8.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  9.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
 10.         └─box (local) `<fn>`(...)
 11.           └─box::rethrow_on_error(...)
 12.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
 13.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 14.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 15.                   └─value[[3L]](cond)
 16.                     └─box::rethrow(error, call)
── Failure ('test-basic.r:122:5'): trailing comma is accepted ──────────────────
`box::use(mod/a, mod/b, )` threw an error.
Message: object 'c_strict_extract' not found
Class:   simpleError/box_error/error/condition
Backtrace:
     ▆
  1. ├─testthat::expect_error(box::use(mod/a, mod/b, ), NA) at test-basic.r:122:4
  2. │ └─testthat:::quasi_capture(...)
  3. │   ├─testthat (local) .capture(...)
  4. │   │ └─base::withCallingHandlers(...)
  5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  6. └─box::use(mod/a, mod/b, )
  7.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  8.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  9.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
 10.         └─box (local) `<fn>`(...)
 11.           └─box::rethrow_on_error(...)
 12.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
 13.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 14.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 15.                   └─value[[3L]](cond)
 16.                     └─box::rethrow(error, call)
── Failure ('test-basic.r:123:5'): trailing comma is accepted ──────────────────
`box::use(mod/a[modname, double, ])` threw an error.
Message: object 'c_strict_extract' not found
Class:   simpleError/box_error/error/condition
Backtrace:
     ▆
  1. ├─testthat::expect_error(box::use(mod/a[modname, double, ]), NA) at test-basic.r:123:4
  2. │ └─testthat:::quasi_capture(...)
  3. │   ├─testthat (local) .capture(...)
  4. │   │ └─base::withCallingHandlers(...)
  5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  6. └─box::use(mod/a[modname, double, ])
  7.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  8.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  9.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
 10.         └─box (local) `<fn>`(...)
 11.           └─box::rethrow_on_error(...)
 12.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
 13.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 14.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 15.                   └─value[[3L]](cond)
 16.                     └─box::rethrow(error, call)
── Error ('test-basic.r:127:5'): nested module can use parent ──────────────────
<box_error/error/condition>
Error in `box::use(mod/b/b)`: unable to load module "./__init__"; not found in "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-box/R-box/work/box-1.1.3/box.Rcheck/tests/testthat"
Backtrace:
     ▆
  1. └─box::use(mod/b/b) at test-basic.r:127:4
  2.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  3.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  4.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
  5.         └─box (local) `<fn>`(...)
  6.           └─box::rethrow_on_error(...)
  7.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
  8.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  9.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 10.                   └─value[[3L]](cond)
 11.                     └─box::rethrow(error, call)
── Error ('test-basic.r:139:5'): using legacy functions raises warning ─────────
Error in `box::use(mod/legacy/library)`: object 'c_strict_extract' not found
Backtrace:
     ▆
  1. ├─testthat::expect_warning(box::use(mod/legacy/library), ".+library.+ inside a module") at test-basic.r:139:4
  2. │ └─testthat:::quasi_capture(...)
  3. │   ├─testthat (local) .capture(...)
  4. │   │ └─base::withCallingHandlers(...)
  5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  6. └─box::use(mod/legacy/library)
  7.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  8.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  9.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
 10.         └─box (local) `<fn>`(...)
 11.           └─box::rethrow_on_error(...)
 12.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
 13.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 14.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 15.                   └─value[[3L]](cond)
 16.                     └─box::rethrow(error, call)
. . .
── Error ('test-unload.r:76:5'): after purging the cache, modules get reloaded ──
Error in `box::use(mod/a)`: object 'c_strict_extract' not found
Backtrace:
     ▆
  1. └─box::use(mod/a) at test-unload.r:76:4
  2.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  3.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  4.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
  5.         └─box (local) `<fn>`(...)
  6.           └─box::rethrow_on_error(...)
  7.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
  8.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  9.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 10.                   └─value[[3L]](cond)
 11.                     └─box::rethrow(error, call)
── Error ('test-unload.r:86:5'): purging the cache executes `.on_unload` hooks ──
<box_error/error/condition>
Error in `box::use(mod/reload/a)`: unable to load module "./b"; not found in "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-box/R-box/work/box-1.1.3/box.Rcheck/tests/testthat"
Backtrace:
     ▆
  1. └─box::use(mod/reload/a) at test-unload.r:86:4
  2.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  3.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  4.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
  5.         └─box (local) `<fn>`(...)
  6.           └─box::rethrow_on_error(...)
  7.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
  8.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  9.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 10.                   └─value[[3L]](cond)
 11.                     └─box::rethrow(error, call)
── Error ('test-z-attach.r:23:5'): attach works locally inside module ──────────
<box_error/error/condition>
Error in `box::use(mod/no_exports)`: unable to load module "./a"; not found in "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-box/R-box/work/box-1.1.3/box.Rcheck/tests/testthat"
Backtrace:
     ▆
  1. └─box::use(mod/no_exports) at test-z-attach.r:23:4
  2.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  3.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  4.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
  5.         └─box (local) `<fn>`(...)
  6.           └─box::rethrow_on_error(...)
  7.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
  8.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  9.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 10.                   └─value[[3L]](cond)
 11.                     └─box::rethrow(error, call)
── Error ('test-z-attach.r:35:5'): attach works locally inside function ────────
Error in `box::use(mod/a[...])`: object 'c_strict_extract' not found
Backtrace:
     ▆
  1. └─box (local) f() at test-z-attach.r:35:4
  2.   └─box::use(mod/a[...]) at test-z-attach.r:31:8
  3.     └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  4.       └─base::Map(.f, ..., USE.NAMES = FALSE)
  5.         └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
  6.           └─box (local) `<fn>`(...)
  7.             └─box::rethrow_on_error(...)
  8.               └─base::tryCatch(expr, error = function(error) rethrow(error, call))
  9.                 └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 10.                   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 11.                     └─value[[3L]](cond)
 12.                       └─box::rethrow(error, call)
── Error ('test-z-attach.r:42:9'): module can be attached to global environment ──
Error in `box::use(a = mod/a[...])`: object 'c_strict_extract' not found
Backtrace:
     ▆
  1. ├─base::eval(...)
  2. │ └─base::eval(...)
  3. └─box::use(a = mod/a[...]) at test-z-attach.r:42:8
  4.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  5.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  6.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
  7.         └─box (local) `<fn>`(...)
  8.           └─box::rethrow_on_error(...)
  9.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
 10.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 11.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 12.                   └─value[[3L]](cond)
 13.                     └─box::rethrow(error, call)
── Failure ('test-z-attach.r:52:5'): module can be detached ────────────────────
search()[2L] not equal to `test_mod_envname`.
1/1 mismatches
x[1]: "mod:devtools"
y[1]: "mod:mod/a"
── Error ('test-z-attach.r:54:5'): module can be detached ──────────────────────
Error in `detach(test_mod_envname, character.only = TRUE)`: invalid 'name' argument
Backtrace:
    ▆
 1. └─base::detach(test_mod_envname, character.only = TRUE) at test-z-attach.r:54:4
── Error ('test-z-attach.r:60:5'): hidden names can be attached ────────────────
Error in `box::use(mod/a[...])`: object 'c_strict_extract' not found
Backtrace:
     ▆
  1. └─box::use(mod/a[...]) at test-z-attach.r:60:4
  2.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  3.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  4.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
  5.         └─box (local) `<fn>`(...)
  6.           └─box::rethrow_on_error(...)
  7.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
  8.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  9.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 10.                   └─value[[3L]](cond)
 11.                     └─box::rethrow(error, call)
── Error (???): unloading a module detaches it ─────────────────────────────────
Error in `box::use(a = mod/a[...])`: object 'c_strict_extract' not found
Backtrace:
     ▆
  1. ├─base::eval(quote(box::use(a = mod/a[...])), .GlobalEnv)
  2. │ └─base::eval(quote(box::use(a = mod/a[...])), .GlobalEnv)
  3. └─box::use(a = mod/a[...])
  4.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  5.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  6.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
  7.         └─box (local) `<fn>`(...)
  8.           └─box::rethrow_on_error(...)
  9.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
 10.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 11.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 12.                   └─value[[3L]](cond)
 13.                     └─box::rethrow(error, call)
── Error ('test-z-attach.r:77:9'): unloading a local module detaches it ────────
Error in `box::use(a = mod/a[...])`: object 'c_strict_extract' not found
Backtrace:
     ▆
  1. └─base::eval(...)
  2.   └─base::eval(...)
  3.     └─box::use(a = mod/a[...]) at test-z-attach.r:77:8
  4.       └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  5.         └─base::Map(.f, ..., USE.NAMES = FALSE)
  6.           └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
  7.             └─box (local) `<fn>`(...)
  8.               └─box::rethrow_on_error(...)
  9.                 └─base::tryCatch(expr, error = function(error) rethrow(error, call))
 10.                   └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 11.                     └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 12.                       └─value[[3L]](cond)
 13.                         └─box::rethrow(error, call)
── Error (???): reloading a module reattaches it ───────────────────────────────
Error in `box::use(a = mod/a[...])`: object 'c_strict_extract' not found
Backtrace:
     ▆
  1. ├─base::eval(quote(box::use(a = mod/a[...])), .GlobalEnv)
  2. │ └─base::eval(quote(box::use(a = mod/a[...])), .GlobalEnv)
  3. └─box::use(a = mod/a[...])
  4.   └─box::map(use_one, imports, aliases, list(caller), use_call = list(sys.call()))
  5.     └─base::Map(.f, ..., USE.NAMES = FALSE)
  6.       └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
  7.         └─box (local) `<fn>`(...)
  8.           └─box::rethrow_on_error(...)
  9.             └─base::tryCatch(expr, error = function(error) rethrow(error, call))
 10.               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 11.                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 12.                   └─value[[3L]](cond)
 13.                     └─box::rethrow(error, call)

[ FAIL 96 | WARN 0 | SKIP 10 | PASS 332 ]
Error: Test failures
Execution halted

CRAN version is perfectly fine and 100% of tests pass.

R version

> R.version
               _                           
platform       powerpc-apple-darwin10.8.0  
arch           powerpc                     
os             darwin10.8.0                
system         powerpc, darwin10.8.0       
status                                     
major          4                           
minor          3.0                         
year           2023                        
month          04                          
day            21                          
svn rev        84292                       
language       R                           
version.string R version 4.3.0 (2023-04-21)
nickname       Already Tomorrow


### ‘box’ version

1.1.3
klmr commented 1 year ago

This is by design: the repository only contains the source files, not generated files. Please follow the instructions for installing the development version:

install.packages('box', repos = 'https://klmr.r-universe.dev')

(I am aware that ‘box’ deviates from many other R packages in this regard; this is unfortunate, but GitHub is a source code sharing platform, not a software distribution repository.)

When checking out the code for development, make sure to run make documentation (or devtools::document() inside R, as usual for ‘devtools’ packages; I should probably add some development instructions at some point.)

barracuda156 commented 1 year ago

@klmr Thank you for clarification. Since I was adding the package to Macports (not just building locally for myself), I will just keep it to CRAN-provided source. Not a big deal, I just personally opt for upstream sources whenever available.

klmr commented 1 year ago

@barracuda156 Fair enough, makes perfect sense.

The canonical upstream source for this package is the R-Universe (https://klmr.r-universe.dev) package repository (rather than GitHub directly). That repo is automatically synchronised with the main branch of the source repo via CI/CD. Feel free to use either that or CRAN.