Skip to content

Releases: CandoImage/winnfsd

Continued: Fix for handling in case of multiple mounts / paths && merged changes from Yasushi/winnfsd

02 May 12:14
Compare
Choose a tag to compare

Continued the attempt fixing winnfsd#13
There was still an issue with the siblings iteration on the top-level mounts.
Should work better now.

Further the changes from the https://github.com/Yasushi/winnfsd fork were merged.
Which should fix some path alias handling issues: Yasushi#4

Below you can find the vagrantfile we use to patch vagrant-winnfsd on the fly to:

  • Use the current binary
  • Use the new mounting syntax
  • Write config into the user- instead the program-directory to avoid problems with windows UAC.
# The code in the condition is only needed when the machine is built / reloaded.
if ARGV[0] == "up" || ARGV[0] == "reload" then

  # Windows check.
  is_windows = (RbConfig::CONFIG['host_os'].match(/mswin|mingw|cygwin/i))

  # If this is Windows make sure the NFS stuff can work.
  if (is_windows)
    # Because the program files directory isn't necessarily writable (UAC) and so
    # on, we patch up the vagrant-winnfs plugin to use the vagrant user directory.
    # Created a pull request with the change:
    # https://github.com/winnfsd/vagrant-winnfsd/pull/85
    puts "Patching plugin vagrant-winnfsd"
    patching_file = Vagrant.user_data_path.join("gems/gems/vagrant-winnfsd-1.1.0/lib/vagrant-winnfsd/cap/nfs.rb")
    puts "   Patching config location"
    if File.exist?(patching_file)
      File.write(patching_file, File.open(patching_file,&:read).gsub("\"\#{Vagrant.source_root}/nfspaths\"","\"\#{Vagrant.user_data_path}/nfspaths\""))
      puts "    -> done"
    end

    # Download our own binary because the current 1.0.1 version has issues.
    binary_file = Vagrant.user_data_path.join("gems/gems/vagrant-winnfsd-1.1.0/bin/winnfsd.exe")
    puts "   Patching binary"
    require "digest"
    checksum = Digest::MD5.file(binary_file).hexdigest
    if !checksum.eql? "90db3d0e1695a069891936ece23287da"
      if File.exist?(binary_file)
        if File.writable?(binary_file)
          # Use open-uri because it follows redirects.
          require "open-uri"
          open("https://github.com/CandoImage/winnfsd/releases/download/2.0.3-beta/winnfsd.exe") {|f|
             File.open(binary_file,"wb") do |file|
               file.puts f.read
             end
          }
          puts "    -> done"
        else
          puts "    -> Failed, file not writable."
        end
      end
    else
      puts "    -> Already done - skip binary download."
    end
    # Adjust mounting in the new version.
    patching_file = Vagrant.user_data_path.join("gems/gems/vagrant-winnfsd-1.1.0/lib/vagrant-winnfsd/synced_folder.rb")
    puts "   Patching mount syntax"
    if File.exist?(patching_file)
      File.write(patching_file, File.open(patching_file,&:read).gsub(".gsub(':', '')","").gsub("= '/' +","="))
      puts "    -> done"
    end

  end
end

2.0.2-beta: Fix for handling in case of multiple mounts / paths

18 Apr 04:22
Compare
Choose a tag to compare

An attempt in fixing this issue winnfsd/issues/13
The server was crashing when you had two path mappings and you tried to mount both of them.
It looks like there was no handling in place to actually figure out which path mapping has to be used for the mounted path.
This ultimately led to unhandled errors.
The patched version is more defensive when using the currently selected path mapping and if it doesn't fit it searches a fitting path mapping for the mounted path.

2.0.1-beta: Merge of philrs and Yasushs repositories

06 Apr 23:27
Compare
Choose a tag to compare

This is the binary, compiled using MS Visual Studio 2015, of the merged repos of philr and Yasushi
Adjusted the version number to keep track and marked as beta since it's not tested thoroughly yet.