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

nimbleDir ignored with custom tasks #495

Open
pacien opened this issue May 21, 2018 · 4 comments
Open

nimbleDir ignored with custom tasks #495

pacien opened this issue May 21, 2018 · 4 comments

Comments

@pacien
Copy link

pacien commented May 21, 2018

A custom --nimbleDir seems to be ignored when executing a user-defined task.

Running a pre-defined task: no packages.json in the newly created nimble directory. This is expected behaviour.

 % nimble --nimbleDir:tmp1 --verbose build        
    Setting Nim stdlib prefix to 
    Setting Nim stdlib path to /home/kea/.choosenim/toolchains/nim-0.18.0/lib
  Verifying dependencies for [email protected]
    Reading official package list
    Prompt: No local packages.json found, download it from internet? [y/N]

Running a custom task: a packages.json is somehow found despite the custom nimble directory being empty. The dependencies are installed in the wrong directory.

 % nimble --nimbleDir:tmp2 --verbose build_example 
    Setting Nim stdlib prefix to 
    Setting Nim stdlib path to /home/kea/.choosenim/toolchains/nim-0.18.0/lib
  Executing task build_example in /home/kea/code/dummy-nim/dummy_nim.nimble
    Setting Nim stdlib prefix to 
    Setting Nim stdlib path to /home/kea/.choosenim/toolchains/nim-0.18.0/lib
  Verifying dependencies for [email protected]
    Reading official package list
   Checking for jester@any version
 Installing jester@any version
    Reading official package list
Downloading https://github.com/dom96/jester using git
    Cloning latest tagged version: v0.2.0
    Setting Nim stdlib prefix to 
    Setting Nim stdlib path to /home/kea/.choosenim/toolchains/nim-0.18.0/lib
  Verifying dependencies for [email protected]
 Installing [email protected]
    Copying file /tmp/nimble_27574/githubcom_dom96jester/changelog.markdown to /home/kea/.nimble/pkgs/jester-0.2.0/changelog.markdown
    Copying file /tmp/nimble_27574/githubcom_dom96jester/license.txt to /home/kea/.nimble/pkgs/jester-0.2.0/license.txt
    Copying file /tmp/nimble_27574/githubcom_dom96jester/jester.nimble to /home/kea/.nimble/pkgs/jester-0.2.0/jester.nimble
    Copying file /tmp/nimble_27574/githubcom_dom96jester/readme.markdown to /home/kea/.nimble/pkgs/jester-0.2.0/readme.markdown
    Copying file /tmp/nimble_27574/githubcom_dom96jester/jester.nim to /home/kea/.nimble/pkgs/jester-0.2.0/jester.nim
    Copying file /tmp/nimble_27574/githubcom_dom96jester/jester/private/utils.nim to /home/kea/.nimble/pkgs/jester-0.2.0/jester/private/utils.nim
    Copying file /tmp/nimble_27574/githubcom_dom96jester/jester/private/patterns.nim to /home/kea/.nimble/pkgs/jester-0.2.0/jester/private/patterns.nim
    Copying file /tmp/nimble_27574/githubcom_dom96jester/jester/private/errorpages.nim to /home/kea/.nimble/pkgs/jester-0.2.0/jester/private/errorpages.nim
    Copying file /tmp/nimble_27574/githubcom_dom96jester/jester.nimble to /home/kea/.nimble/pkgs/jester-0.2.0/jester.nimble
   Success: jester installed successfully.

dummy_nim.nimble:

version       = "0.1.0"
author        = "kea"
description   = "A dummy package"
license       = "MIT"
srcDir        = "src"
bin           = @["dummy_nim"]

requires "nim >= 0.18.0"
requires "jester"

task build_example, "Build example":
  setCommand "c", "example/example.nim"
@dom96
Copy link
Collaborator

dom96 commented May 21, 2018

Yeah, I'm afraid these aren't passed yet.

You'll have to write exec "nimble c --nimbleDir:... example/example.nim" as a workaround in your task for now.

@dom96 dom96 added the Bug label May 21, 2018
@pacien
Copy link
Author

pacien commented May 21, 2018

How can I retrieve the supplied nimbleDir argument to pass it inside the task?

@dom96
Copy link
Collaborator

dom96 commented May 21, 2018

That's also not possible right now I'm afraid.

@dom96
Copy link
Collaborator

dom96 commented Mar 17, 2019

This is fixed but I want a test for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants