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

ambiguous identifier: 'requiresData' #1158

Closed
stoneface86 opened this issue Nov 8, 2023 · 1 comment
Closed

ambiguous identifier: 'requiresData' #1158

stoneface86 opened this issue Nov 8, 2023 · 1 comment

Comments

@stoneface86
Copy link
Contributor

Consider this nimble file

# Package

version       = "0.1.0"
author        = "stoneface86"
description   = "A new awesome nimble package"
license       = "MIT"
srcDir        = "src"


# Dependencies

requires "nim >= 1.6.16"

task echoRequires, "":
  echo requiresData

When attempting to access the requiresData var, an error occurs:

     Error: Could not read package info file in /mnt/ramdisk/ws/temp/temp.nimble;
        ...   Reading as ini file failed with: 
        ...     Invalid section: .
        ...   Evaluating as NimScript file failed with: 
        ...     /mnt/ramdisk/ws/temp/temp.nimble(14, 1) template/generic instantiation of `task` from here
        ... /mnt/ramdisk/ws/temp/temp.nimble(15, 8) Error: ambiguous identifier: 'requiresData' -- use one of the following:
        ...   system.requiresData: seq[string]
        ...   nimscriptapi_402557162.requiresData: seq[string]
        ... printPkgInfo() failed.

Using system.requiresData results in an empty seq, even though it should contain the nimble file's dependencies. When specifying it from the nimscriptapi_xxxxx module it gives us what we expect. I believe requiresData is missing from the except clause at

import system except getCommand, setCommand, switch, `--`, thisDir,
packageName, version, author, description, license, srcDir, binDir, backend,
skipDirs, skipFiles, skipExt, installDirs, installFiles, installExt, bin, foreignDeps,
requires, task, packageName

When I manually add requiresData to the generated nimscript file in /tmp it works

This occurs with nimble versions v0.13.1 and v0.14.2 on my machine.

stoneface86 added a commit to stoneface86/nimble that referenced this issue Nov 9, 2023
Araq pushed a commit that referenced this issue Nov 10, 2023
@ringabout
Copy link
Member

I suppose it was fixed by #1159

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

No branches or pull requests

2 participants