Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

"Remove" option doesn't remove dependency #21

Closed
jolly-fellow opened this issue Mar 20, 2023 · 2 comments · Fixed by #42
Closed

"Remove" option doesn't remove dependency #21

jolly-fellow opened this issue Mar 20, 2023 · 2 comments · Fixed by #42
Assignees
Labels
bug Something isn't working 👍 lgtm
Milestone

Comments

@jolly-fellow
Copy link
Contributor

Content of the project.yaml file:

#antler-proj::generated
#   This file was AUTOGENERATED.
#   Modification or removal of the above lines will cause antler-proj to deem the project as invalid.
#   Any changes made to this file will be lost when the tool updates this project.
#   generated with v1.0.0
#
# This file was auto-generated. Be aware antler-proj may discard added comments.


project: test_proj
version: 0.0.1
libraries:
  - name: test_app1
    lang: CXX
    compile_options: cmpl_opt;
    link_options: link_opt;
apps:
  - name: app
    lang: CXX
  - name: test_app
    lang: java
    compile_options: cpp_opt;
    link_options: link_pot;
  - name: test_app1
    lang: java
    compile_options: cpp_opt;
    link_options: link_pot;
    depends:
      - name: test_dep1
        from: 'https://github.com/larryk85/sample_contract'
        release: 0.0.1
        hash: hash

root@c1742fb0fdb3:/app# antler-proj remove /host/home/alex/dev/projects/AntelopeIO/Clion_DUNE/test dep test_app1 test_dep1
Object: test_dep1 does not exist.

while removing of the test_app1 with it's dependency works well:

root@c1742fb0fdb3:/app# antler-proj remove /host/home/alex/dev/projects/AntelopeIO/Clion_DUNE/test app test_app1
Removing object: test_app1 from the project.

P.S. IMHO it would be better to write the message as "Object test_app1 has been removed" or something like this to make the user sure that the action has been completed successfully.

@jolly-fellow jolly-fellow added the bug Something isn't working label Mar 20, 2023
@stephenpdeos stephenpdeos added triage bug Something isn't working 👍 lgtm and removed bug Something isn't working triage labels Apr 7, 2023
@stephenpdeos stephenpdeos added this to the CDT 4.0.0-rc1 milestone Apr 10, 2023
@stephenpdeos stephenpdeos moved this from Todo to In Progress in Team Backlog Apr 18, 2023
@mikelik
Copy link
Contributor

mikelik commented Apr 19, 2023

To answer the original issue: the syntax is as following:
antler-proj remove dep [OPTIONS] dep [obj]
which means that original command needs to have dep and obj swapped. It should be:
antler-proj remove /host/home/alex/dev/projects/AntelopeIO/Clion_DUNE/test dep test_dep1 test_app1

However there are other issues related which I will address in the PR:

  1. Nothing happens if directory doesn't exist, example command:
    antler-proj remove /not/existing/dir dep test_dep1 test_app1
    Expected: some error that directory doesn't exist
    NOTE: this issue will be solved seperately in If a directory doesn't exist, nothing happens when remove command is used #39
  2. If you run proper command for above project.yml
    antler-proj remove /host/home/alex/dev/projects/AntelopeIO/Clion_DUNE/test dep test_dep1 test_app1
    what happens is that from section in project.yml is being deleted for app test_app1.
    Expectation is that it shouldn't be (because command affect only dependency test_dep1, not the whole app `test_app1)
  3. Section libraries is gone after issuing above command.
  4. Lang for app test_app1 changes from java to C after issuing above comand.
  5. I cannot add dependency:
mikel@msi:~/repo/antler-proj/build/tools$ ./antler-proj add dep test_app abc_dep "https://github.com/abc/a"
[debug_log] :: version.hpp:parse:112 :: parsing version : 0.0.1
[error_log] :: location.cpp:is_reachable:37 :: In this version of antler-proj only github shorthands are supported. Generalized git repos and archives will be supported in a future version.
[error_log] :: project.cpp:validate_dependency:121 :: Error denpendency: abc_dep is invalid.
[error_log] :: add_to.hpp:add_dependency<antler::project::object<antler::project::app_tag> >:115 :: Dependency: abc_dep is invalid.
[error_log] :: add_to.hpp:exec:185 :: failed to add dependency

@mikelik
Copy link
Contributor

mikelik commented Apr 20, 2023

Issue 1 pulled out to #39
Issue 2, 3, 4 are caused by improper project.yml. Now when you create a new project.yml from scratch there is location instead of from, libs instead of libraries and you can't add dependency other than C++. So there is nothing to fix.
Issue 5 happened because of incorrect URL, I have improved the error here: #42

@BenjaminGormanPMP BenjaminGormanPMP moved this from In Progress to Awaiting Review in Team Backlog Apr 20, 2023
@github-project-automation github-project-automation bot moved this from Awaiting Review to Done in Team Backlog Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working 👍 lgtm
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants