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

.resx-file not found? #20

Open
ibrahim324 opened this issue Dec 8, 2024 · 3 comments
Open

.resx-file not found? #20

ibrahim324 opened this issue Dec 8, 2024 · 3 comments

Comments

@ibrahim324
Copy link

ibrahim324 commented Dec 8, 2024

This was on MacOS, so this might be a problem with msbuild (MSB3552).

Command used:

fspack pack-this.fsx

Contents of my script (pack-this.fsx):

let rec print () : unit = 
    printfn $"Hey Packer!"
    print()

print()

Error in terminal:

Wiederherstellung abgeschlossen (7,9s)
  tmpAtIF3M.tmp fehlerhaft mit 1 Fehler(n) (0,1s)
    /usr/local/share/dotnet/sdk/9.0.100/Microsoft.Common.CurrentVersion.targets(3414,5): error MSB3552: Die Ressourcendatei "**/*.resx" wurde nicht gefunden.

Erstellen von fehlerhaft mit 1 Fehler(n) in 8,2s

translation (Deepl):

Restore completed (7.9s)
  tmpAtIF3M.tmp corrupt with 1 error(s) (0.1s)
    /usr/local/share/dotnet/sdk/9.0.100/Microsoft.Common.CurrentVersion.targets(3414,5): error MSB3552: The resource file ‘**/*.resx’ was not found.

Build failed with 1 error(s) in 8.2s
@kant2002
Copy link
Owner

kant2002 commented Dec 8, 2024

I have a guess that somehow resx files was present in temp folder probably. Because I don’t have Mac, I can only guess for now. If I made a fix, can you try build tool from main branch?

@ibrahim324
Copy link
Author

sure, I can try!

@neon-sunset
Copy link

neon-sunset commented Dec 8, 2024

@ibrahim324 Given the presence of .resx file error - I wonder if it has something to do with the locale, I can't reproduce it on my machine (macOS 15.1.1, en-US) though.

If you are here because you saw the post on Reddit, here's an example fish function to compile F# scripts to native executables:

function fspk
    set name (string replace '.fsx' '' $argv[1])
    fspack $argv[1] -f net9.0 --aot -o . \
        /p:InvariantGlobalization=true \
        /p:OptimizationPreference=Size \
        /p:IlcInstructionSet=native &&
    rm -rf ./$name.dbg ./$name.dSYM
end

Note the invariant globalization and publish AOT properties. You can setup a similar alias in other shells. This should also work around potential locale issues.

Lastly, F#'s print functions which parse format specifier tend to break under AOT compilation, structured formatting with "%A" does not work at all because it uses reflection patterns not analyzable by linker. Luckily, F# now also has "regular" string interpolation, I recommend defining the following bindings for the best experience:

open System

let println s = Console.WriteLine(s: string)
let print s = Console.Write(s: string)

And using them as

let thing = 42, 42
println $"{thing}"

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

3 participants