JuliaCloud / AWS.jl

Julia interface to AWS
MIT License
160 stars 62 forks source link

Cannot call `global_aws_config()` at module level #611

Open mattBrzezinski opened 1 year ago

mattBrzezinski commented 1 year ago
Precompiling project...
  ✗ {REDACTED}
  0 dependencies successfully precompiled in 6 seconds. 84 already precompiled.

ERROR: The following 1 direct dependency failed to precompile:

{REDACTED} [...]

Failed to precompile {REDACTED} [...] to /Users/mattbr/.julia/compiled/v1.8/{REDACTED}/jl_GmNEGS.
ERROR: LoadError: MethodError: no method matching getpass(::Base.PipeEndpoint, ::IOContext{IOStream}, ::String)
Closest candidates are:
  getpass(::Base.TTY, ::IO, ::AbstractString) at util.jl:282
Stacktrace:
  [1] getpass(prompt::String)
    @ Base ./util.jl:291
  [2] macro expansion
    @ ~/.julia/packages/Mocking/MRkF3/src/mock.jl:29 [inlined]
  [3] _aws_get_role(role::String, ini::IniFile.Inifile)
    @ AWS ~/.julia/packages/AWS/1AmZD/src/utilities/credentials.jl:90
  [4] dot_aws_config(profile::String)
    @ AWS ~/.julia/packages/AWS/1AmZD/src/AWSCredentials.jl:437
  [5] (::AWS.var"#9#13"{String})()
    @ AWS ~/.julia/packages/AWS/1AmZD/src/AWSCredentials.jl:119
  [6] AWS.AWSCredentials(; profile::String, throw_cred_error::Bool)
    @ AWS ~/.julia/packages/AWS/1AmZD/src/AWSCredentials.jl:128
  [7] #global_aws_config#74
    @ ~/.julia/packages/AWS/1AmZD/src/AWS.jl:79 [inlined]
  [8] top-level scope
    @ ~/Documents/GitHub/{REDACTED}.jl:19
  [9] include
    @ ./Base.jl:419 [inlined]
 [10] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
    @ Base ./loading.jl:1554
 [11] top-level scope
    @ stdin:1
in expression starting at /Users/mattbr/Documents/GitHub/{REDACTED}.jl:1
in expression starting at stdin:1
ericphanson commented 1 year ago

This should be done in __init__. Even if it worked, it would bake credentials into the precompiled file, which doesn’t seem ideal (they would be either stale or a security issue).