Skip to content

Broken custom source from file system #612

Description

@haf

Trying to create a custom nuget source from the file system, getting this:
`

✗ cat paket.dependencies
source https://www.nuget.org/api/v2
source https://www.myget.org/F/SNIP ...
source ~/.custom-nugets

✗ mono tools/paket.exe update nuget FsSql
Paket version 0.28.0.0
# SNIP
Paket failed with:
    The directory ~/.custom-nugets doesn't exist.
Please check the NuGet source feed definition in your paket.dependencies file.
✗ ls ~/.custom-nugets
FsSql.2.0.1.nupkg

Activity

  1. forki commented on Feb 17, 2015

    @forki
    Member

    mhm do you know if this works with the default .NET DirectoryInfo class?

  2. haf commented on Feb 17, 2015

    @haf
    MemberAuthor
    ✗ fsharpi
    
    F# Interactive for F# 3.1 (Open Source Edition)
    Freely distributed under the Apache 2.0 Open Source License
    
    For help type #help;;
    
    > open System.IO;;
    > new DirectoryInfo("~/dev");;
    val it : DirectoryInfo =
      ~/dev {Attributes = 0;
             CreationTime = 1/1/1601 1:00:00 AM;
             CreationTimeUtc = 1/1/1601 12:00:00 AM;
             Exists = false;
             Extension = "";
             FullName = "/Users/henrik.feldt/dev/haf/FsSql/~/dev";
             LastAccessTime = 1/1/1601 1:00:00 AM;
             LastAccessTimeUtc = 1/1/1601 12:00:00 AM;
             LastWriteTime = 1/1/1601 1:00:00 AM;
             LastWriteTimeUtc = 1/1/1601 12:00:00 AM;
             Name = "dev";
             Parent = /Users/henrik.feldt/dev/haf/FsSql/~;
             Root = /;}
    > let p = it;;
    
    val p : DirectoryInfo = ~/dev
    
    > p.FullPath;;
    
      p.FullPath;;
      ^^^^^^^^^^
    
    /Users/henrik.feldt/dev/haf/FsSql/stdin(4,1): error FS1097: The struct or class field 'FullPath' is not accessible from this code location
    > p.FullName;;
    val it : string = "/Users/henrik.feldt/dev/haf/FsSql/~/dev"
    > p.GetFiles();;
    System.IO.DirectoryNotFoundException: Directory '/Users/henrik.feldt/dev/haf/FsSql/~/dev' not found.
      at System.IO.Directory.ValidateDirectoryListing (System.String path, System.String searchPattern, System.Boolean& stop) [0x00000] in <filename unknown>:0
      at System.IO.Directory.GetFileSystemEntries (System.String path, System.String searchPattern, FileAttributes mask, FileAttributes attrs) [0x00000] in <filename unknown>:0
      at System.IO.Directory.GetFiles (System.String path, System.String searchPattern) [0x00000] in <filename unknown>:0
      at System.IO.DirectoryInfo.GetFiles (System.String searchPattern) [0x00000] in <filename unknown>:0
      at System.IO.DirectoryInfo.GetFiles () [0x00000] in <filename unknown>:0
      at (wrapper remoting-invoke-with-check) System.IO.DirectoryInfo:GetFiles ()
      at <StartupCode$FSI_0007>.$FSI_0007.main@ () [0x00000] in <filename unknown>:0
      at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
      at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
    Stopped due to error
    
  3. forki commented on Feb 17, 2015

    @forki
    Member

    So it mono doesn't understand that, right? How can we work around this?
    On Feb 17, 2015 1:42 PM, "Henrik Feldt" notifications@github.com wrote:

    ✗ fsharpi

    F# Interactive for F# 3.1 (Open Source Edition)
    Freely distributed under the Apache 2.0 Open Source License

    For help type #help;;

    open System.IO;;
    new DirectoryInfo("/dev");;
    val it : DirectoryInfo =
    /dev {Attributes = 0;
    CreationTime = 1/1/1601 1:00:00 AM;
    CreationTimeUtc = 1/1/1601 12:00:00 AM;
    Exists = false;
    Extension = "";
    FullName = "/Users/henrik.feldt/dev/haf/FsSql/
    /dev";
    LastAccessTime = 1/1/1601 1:00:00 AM;
    LastAccessTimeUtc = 1/1/1601 12:00:00 AM;
    LastWriteTime = 1/1/1601 1:00:00 AM;
    LastWriteTimeUtc = 1/1/1601 12:00:00 AM;
    Name = "dev";
    Parent = /Users/henrik.feldt/dev/haf/FsSql/
    ;
    Root = /;}
    let p = it;;

    val p : DirectoryInfo = ~/dev

    p.FullPath;;

    p.FullPath;;
    ^^^^^^^^^^

    /Users/henrik.feldt/dev/haf/FsSql/stdin(4,1): error FS1097: The struct or class field 'FullPath' is not accessible from this code location

    p.FullName;;
    val it : string = "/Users/henrik.feldt/dev/haf/FsSql//dev"
    p.GetFiles();;
    System.IO.DirectoryNotFoundException: Directory '/Users/henrik.feldt/dev/haf/FsSql/
    /dev' not found.
    at System.IO.Directory.ValidateDirectoryListing (System.String path, System.String searchPattern, System.Boolean& stop) [0x00000] in :0
    at System.IO.Directory.GetFileSystemEntries (System.String path, System.String searchPattern, FileAttributes mask, FileAttributes attrs) [0x00000] in :0
    at System.IO.Directory.GetFiles (System.String path, System.String searchPattern) [0x00000] in :0
    at System.IO.DirectoryInfo.GetFiles (System.String searchPattern) [0x00000] in :0
    at System.IO.DirectoryInfo.GetFiles () [0x00000] in :0
    at (wrapper remoting-invoke-with-check) System.IO.DirectoryInfo:GetFiles ()
    at <StartupCode$FSI_0007>.$FSI_0007.main@ () [0x00000] in :0
    at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
    at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0
    Stopped due to error

    —
    Reply to this email directly or view it on GitHub
    #612 (comment).

  4. haf commented on Feb 17, 2015

    @haf
    MemberAuthor

    Regex.Replace("^~", Environment.GetSpecialDirectory(SpecialDirectories.HomeDirectory))?

  5. haf commented on Feb 17, 2015

    @haf
    MemberAuthor

    Another workaround: use the HOME env var http://stackoverflow.com/a/3291314/63621

  6. forki commented on Feb 17, 2015

    @forki
    Member

    I tested it on windows and it used my home dir. please give it a try.

  7. haf commented on Feb 17, 2015

    @haf
    MemberAuthor

    Works nicely ;)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions