Giter VIP home page Giter VIP logo

Comments (14)

royteeuwen avatar royteeuwen commented on July 23, 2024

Any input on this issue? I am having the same issue. The dll gets created and works, but it throws this exception which makes it look like an error.

from il-repack.

gluck avatar gluck commented on July 23, 2024

I'm not using Mono/Linux myself, the original support was contributed, do you think you can provide a PR with a validated fix ?
Maybe copying the permissions was not the smartest thing to do just to make it executable, and it's backfiring on you ?

Sorry.

from il-repack.

lextm avatar lextm commented on July 23, 2024

I think the issue is that Mono maps the temp folder to /temp on Linux, even if /temp is not writable for the log on user. Yes, Mono fails to map to a user specific writable folder, while .NET does.

A workaround which I tested in other project (Jexus Manager) is to create a temp folder under user's my documents folder and then write things there. This aproach works fine under both Windows and Linux.

If required I can send a pull request, but it should be pretty easy for anyone to make the change.

from il-repack.

royteeuwen avatar royteeuwen commented on July 23, 2024

Where does the temp folder get involved? I don't see it anywhere in the code. I am using Mac OS X btw. I am currently building it with xbuild using the ILRepack.MSBuild.Task from peters github. when I do xbuild in the project folder I get the error. If the project folder is in /Users/roy.teeuwen/Documents/Development/Project. Then where should I make the temp dir to test it?

from il-repack.

lextm avatar lextm commented on July 23, 2024

@royteeuwen The exception message indicates that

Access to the path "/temp/Sample/Sample.merged.dll" is denied.

About how /temp is involved I am still reviewing the code base. It seems that when you do not specify an absolute path as out as terminal, the output file goes to the temp folder. Can you try to specify an absolutely path there?

I don't have a Mac to test this assumption, but I will soon further investigate on a Linux machine.

from il-repack.

lextm avatar lextm commented on July 23, 2024

@pruiz You will have to provide further information on how this exception can be reproduced, like which folder you were in at terminal. I use ~/Downloads and this issue cannot be reproduced. Based on the exception message I can only guess you were in /temp folder, where non-root users do not have write permissions and every write operation is doomed to fail.

@royteeuwen Can you recheck that you hit exactly the same issue? I suggest you probably open a new issue for the one you met, as you are

  1. Use Mac OS X instead of Linux.
  2. Your exception message might be different (like the file path and call stack).

from il-repack.

royteeuwen avatar royteeuwen commented on July 23, 2024

@lextm I am already using the absolute path, so I don't think the temp folder is involved for me. Here is my full stacktrace which looks exactly the same unless I am readying over something? I am even giving the out dll a different name as to not have permission errors of overwriting the existing one. (Using the same out name does produce the same error though!)

Build FAILED.
Errors:

/Users/roy.teeuwen/Documents/Development/NetProjects/content_manager/ContentManager.Internet/ContentManager.Internet.csproj (default targets) ->
(ILRepack target) ->

    /Users/roy.teeuwen/Documents/Development/NetProjects/content_manager/ContentManager.Internet/ContentManager.Internet.csproj: error : Access to the path "/Users/roy.teeuwen/Documents/Development/NetProjects/content_manager/ContentManager.Internet/bin/Debug/merged-ContentManager.Internet.dll" is denied.  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in <filename unknown>:0 
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
  at Mono.Cecil.ModuleDefinition.GetFileStream (System.String fileName, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0 
  at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0 
  at Mono.Cecil.AssemblyDefinition.ReadAssembly (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0 
  at ILRepacking.ILRepack.Repack () [0x00000] in <filename unknown>:0 
  at ILRepacking.ILRepack.Merge () [0x00000] in <filename unknown>:0 
  at ILRepack.MSBuild.Task.ILRepack.Execute () [0x00000] in <filename unknown>:0 

from il-repack.

lextm avatar lextm commented on July 23, 2024

@royteeuwen Please spare some time and carefully compare the call stacks. You absolutely hit a complete different issue. This is an open source project so you can easily see which line you hit in ILRepack.Repack. You can also debug in Xamarin Studio to confirm what I have told.

I could not help you much as based on the code, OS X and other UNIX are handled differently from Linux.

from il-repack.

royteeuwen avatar royteeuwen commented on July 23, 2024

@lextm: I don't see the difference at all? Yes the last 2 lines are different but thats because I am using the msbuild task instead of using the executable directly... The lines from ILRepacking.ILRepack.Repack () [0x00000] in :0 and above are exactly the same, because there is where the actual repack method starts.

from il-repack.

lextm avatar lextm commented on July 23, 2024

Please find a diff tool and make a diff of the two stacks. Isn't it clear that you hit the read call, while @pruiz hit the write? Then from the Repack code you two are lines apart. How can you say that's "exactly the same"?

from il-repack.

gluck avatar gluck commented on July 23, 2024

Yup, likely different issue, what are the rights of your source primary assembly (the first one in the merged list) ?

from il-repack.

royteeuwen avatar royteeuwen commented on July 23, 2024

@lextm @gluck This is very wierd... I do get the same error, but it seems that one time I got a different error. If I xbuild it again now this is the stacktrace I get, same as I have been getting a few times. But it seems to have failed on another issue too looking at my previous stacktrace, or maybe it was because I was trying out different settings to see if that resolved it.

Build FAILED.
Errors:

/Users/roy.teeuwen/Documents/Development/NetProjects/content_manager/ContentManager.Internet/ContentManager.Internet.csproj (default targets) ->
(ILRepack target) ->

    /Users/roy.teeuwen/Documents/Development/NetProjects/content_manager/ContentManager.Internet/ContentManager.Internet.csproj: error : Access to the path "/Users/roy.teeuwen/Documents/Development/NetProjects/content_manager/ContentManager.Internet/bin/Debug/merged-ContentManager.Internet.dll" is denied.  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in <filename unknown>:0 
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
  at Mono.Cecil.ModuleDefinition.GetFileStream (System.String fileName, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0 
  at Mono.Cecil.ModuleDefinition.Write (System.String fileName, Mono.Cecil.WriterParameters parameters) [0x00000] in <filename unknown>:0 
  at Mono.Cecil.AssemblyDefinition.Write (System.String fileName, Mono.Cecil.WriterParameters parameters) [0x00000] in <filename unknown>:0 
  at ILRepacking.ILRepack.Repack () [0x00000] in <filename unknown>:0 
  at ILRepacking.ILRepack.Merge () [0x00000] in <filename unknown>:0 
  at ILRepack.MSBuild.Task.ILRepack.Execute () [0x00000] in <filename unknown>:0 

from il-repack.

van800 avatar van800 commented on July 23, 2024

@gluck you may close this as obsolete, I guess.

from il-repack.

pruiz avatar pruiz commented on July 23, 2024

I have not tried any recent version (if there is any), as I think I switched to manually invoke merge instead of using msbuild addon

from il-repack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.