Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: option --base-dir does not work #6937

Open
stationname opened this issue Apr 12, 2024 · 1 comment
Open

Bug: option --base-dir does not work #6937

stationname opened this issue Apr 12, 2024 · 1 comment
Labels
area/build sam build command blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale. type/question

Comments

@stationname
Copy link

Description:

--base-dir does not apply the given directory to relative path in --config-file

Steps to reproduce:

(1) project structure:

/ 
    my_lambda_project1
          build_and_deploy
                samconfig.toml
                template.yaml
    my_lambda_project2
          ...

(2) move to root directory (/)

(3) run sam build --base-dir "./my_lambda_project1" --config-file "./build_and_deploy/samconfig.toml"

Observed result:

2024-04-12 16:39:57,170 | Config file ./build_and_deploy/samconfig.toml does not exist or could not be   
read!                                                                                                         
Error: Config file ./build_and_deploy/samconfig.toml does not exist or could not be read!

Expected result:

sam starts building using the samconfig.toml file

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  • OS: Mac OS
  • sam version: 1.115.0
  • aws region: irrelevant for this use case.

sam --info:

{
  "version": "1.115.0",
  "system": {
    "python": "3.12.2",
    "os": "macOS-14.3.1-arm64-arm-64bit"
  },
  "additional_dependencies": {
    "docker_engine": "20.10.16",
    "aws_cdk": "2.61.1 (build d319d9c)",
    "terraform": "Not available"
  },
  "available_beta_feature_env_vars": [
    "SAM_CLI_BETA_FEATURES",
    "SAM_CLI_BETA_BUILD_PERFORMANCE",
    "SAM_CLI_BETA_TERRAFORM_SUPPORT",
    "SAM_CLI_BETA_RUST_CARGO_LAMBDA"
  ]
}
@stationname stationname added the stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. label Apr 12, 2024
@jysheng123
Copy link
Contributor

Hi, thanks for bringing up the issue. Can you try running the build again with the command with it like this and let me know your result then? sam build --base-dir "./my_lambda_project1" --config-file "build_and_deploy/samconfig.toml".

@jysheng123 jysheng123 added blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale. area/build sam build command and removed stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. labels Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build sam build command blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale. type/question
Projects
None yet
Development

No branches or pull requests

3 participants