Cannot run paket2bazel
Running this:
bazel run @rules_dotnet//tools/paket2bazel
Gives:
INFO: Analyzed target @@rules_dotnet~//tools/paket2bazel:paket2bazel (236 packages loaded, 7860 targets configured).
ERROR: /home/njlr/.cache/bazel/_bazel_njlr/41a7e2597ac2668adfaaefdbd2f1aca7/external/rules_dotnet~/dotnet/private/sdk/gen/BUILD.bazel:3:14: Compiling gen failed: (Exit 1): compiler_wrapper.sh failed: error executing FSharpCompile command (from target @@rules_dotnet~//dotnet/private/sdk/gen:gen) external/rules_dotnet~/dotnet/private/compiler_wrapper.sh external/rules_dotnet~~dotnet~dotnet_x86_64-unknown-linux-gnu/dotnet ... (remaining 2 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
error FS1225: File '/home/njlr/.cache/bazel/_bazel_njlr/41a7e2597ac2668adfaaefdbd2f1aca7/sandbox/processwrapper-sandbox/3/execroot/_main/external/rules_dotnet~~paket2bazel_dependencies_extension~nuget.fsharp.core.v9.0.100/lib/netstandard2.1/FSharp.Core.optdata' not found alongside FSharp.Core. File expected in /home/njlr/.cache/bazel/_bazel_njlr/41a7e2597ac2668adfaaefdbd2f1aca7/sandbox/processwrapper-sandbox/3/execroot/_main/external/rules_dotnet~~paket2bazel_dependencies_extension~nuget.fsharp.core.v9.0.100/lib/netstandard2.1/FSharp.Core.optdata. Consider upgrading to a more recent version of FSharp.Core, where this file is no longer be required.
error FS0229: Error opening binary file '/home/njlr/.cache/bazel/_bazel_njlr/41a7e2597ac2668adfaaefdbd2f1aca7/sandbox/processwrapper-sandbox/3/execroot/_main/external/rules_dotnet~~paket2bazel_dependencies_extension~nuget.fsharp.core.v9.0.100/lib/netstandard2.1/FSharp.Core.dll': The exception has been reported. This internal exception should now be caught at an error recovery point on the stack. Original message: File '/home/njlr/.cache/bazel/_bazel_njlr/41a7e2597ac2668adfaaefdbd2f1aca7/sandbox/processwrapper-sandbox/3/execroot/_main/external/rules_dotnet~~paket2bazel_dependencies_extension~nuget.fsharp.core.v9.0.100/lib/netstandard2.1/FSharp.Core.optdata' not found alongside FSharp.Core. File expected in /home/njlr/.cache/bazel/_bazel_njlr/41a7e2597ac2668adfaaefdbd2f1aca7/sandbox/processwrapper-sandbox/3/execroot/_main/external/rules_dotnet~~paket2bazel_dependencies_extension~nuget.fsharp.core.v9.0.100/lib/netstandard2.1/FSharp.Core.optdata. Consider upgrading to a more recent version of FSharp.Core, where this file is no longer be required.)
error FS3160: Problem reading assembly '/home/njlr/.cache/bazel/_bazel_njlr/41a7e2597ac2668adfaaefdbd2f1aca7/sandbox/processwrapper-sandbox/3/execroot/_main/external/rules_dotnet~~paket2bazel_dependencies_extension~nuget.fsharp.core.v9.0.100/lib/netstandard2.1/FSharp.Core.dll': The exception has been reported. This internal exception should now be caught at an error recovery point on the stack. Original message: Error opening binary file '/home/njlr/.cache/bazel/_bazel_njlr/41a7e2597ac2668adfaaefdbd2f1aca7/sandbox/processwrapper-sandbox/3/execroot/_main/external/rules_dotnet~~paket2bazel_dependencies_extension~nuget.fsharp.core.v9.0.100/lib/netstandard2.1/FSharp.Core.dll': The exception has been reported. This internal exception should now be caught at an error recovery point on the stack. Original message: File '/home/njlr/.cache/bazel/_bazel_njlr/41a7e2597ac2668adfaaefdbd2f1aca7/sandbox/processwrapper-sandbox/3/execroot/_main/external/rules_dotnet~~paket2bazel_dependencies_extension~nuget.fsharp.core.v9.0.100/lib/netstandard2.1/FSharp.Core.optdata' not found alongside FSharp.Core. File expected in /home/njlr/.cache/bazel/_bazel_njlr/41a7e2597ac2668adfaaefdbd2f1aca7/sandbox/processwrapper-sandbox/3/execroot/_main/external/rules_dotnet~~paket2bazel_dependencies_extension~nuget.fsharp.core.v9.0.100/lib/netstandard2.1/FSharp.Core.optdata. Consider upgrading to a more recent version of FSharp.Core, where this file is no longer be required.))
error FS0073: internal error: BuildFrameworkTcImports: no successful import of /home/njlr/.cache/bazel/_bazel_njlr/41a7e2597ac2668adfaaefdbd2f1aca7/sandbox/processwrapper-sandbox/3/execroot/_main/external/rules_dotnet~~paket2bazel_dependencies_extension~nuget.fsharp.core.v9.0.100/lib/netstandard2.1/FSharp.Core.dll
Target @@rules_dotnet~//tools/paket2bazel:paket2bazel failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 4.315s, Critical Path: 0.56s
INFO: 16 processes: 16 internal.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target
Here is the MODULE.bazel:
bazel_dep(name = "rules_dotnet", version = "0.17.5")
dotnet = use_extension("@rules_dotnet//dotnet:extensions.bzl", "dotnet")
dotnet.toolchain(dotnet_version = "6.0.200")
use_repo(dotnet, "dotnet_toolchains")
register_toolchains("@dotnet_toolchains//:all")
# main_extension = use_extension("//paket:paket.main_extension.bzl", "main_extension")
# use_repo(main_extension, "paket.main")
And .bazelversion:
7.4.1
Full repro here: https://github.com/njlr/rules-dotnet-paket2bazel-6
This seems to limited to .Net 6 which is EOL since last November. Still I'm thinking I'll need to put paket2bazel into a separate module within rules_dotnet so that the selection of SDK by the user will not interfere affect the build/runtime of paket2bazel.
Not sure when I'll have the time to work on this but a contribution that moves paket2bazel and the SDK generator to it's own module would be accepted as a contribution.
Hey, I tried to run the install steps for packet2bazel with dotnet 9 and there are issues when compiling the tool :
The errors thrown are the following
/home/mrtndew/.cache/bazel/_bazel_mrtndew/966f46f98e63fa67c841d210c782bd94/sandbox/linux-sandbox/25/execroot/_main/external/rules_dotnet+/tools/paket2bazel/Main.fs(12,9): error FS0842: This attribute is not valid for use on this language element
/home/mrtndew/.cache/bazel/_bazel_mrtndew/966f46f98e63fa67c841d210c782bd94/sandbox/linux-sandbox/25/execroot/_main/external/rules_dotnet+/tools/paket2bazel/Main.fs(13,9): error FS0842: This attribute is not valid for use on this language element
Hey, I tried to run the install steps for packet2bazel with dotnet 9 and there are issues when compiling the tool :
The errors thrown are the following
/home/mrtndew/.cache/bazel/_bazel_mrtndew/966f46f98e63fa67c841d210c782bd94/sandbox/linux-sandbox/25/execroot/_main/external/rules_dotnet+/tools/paket2bazel/Main.fs(12,9): error FS0842: This attribute is not valid for use on this language element /home/mrtndew/.cache/bazel/_bazel_mrtndew/966f46f98e63fa67c841d210c782bd94/sandbox/linux-sandbox/25/execroot/_main/external/rules_dotnet+/tools/paket2bazel/Main.fs(13,9): error FS0842: This attribute is not valid for use on this language element
me too
I can´t reproduce this with .Net 9 and the latest rules_dotnet. It is still a problem if you have an older .Net SDK set in the toolchain though.