Linux tooling TBA

Hi there. Currently I cannot find any linux tooling. I guess we can justify that by fixing upload.js and providing dart binary for the linux platform.

Additionally if I use mac template, install dart 2.8.4 locally and try to run upload-debug.sh I get:

nikolay.seliverstov@seliverstovnlu2:~/Projects/Sunburst-template/utils_mac$ ./upload-debug.sh 
Crash when formatting: [Encoding] Unable to decode bytes as UTF-8.
RangeError (index): Invalid value: Not in range 0..257925, inclusive: 258051
#0      _StringBase.[] (dart:core-patch/string_patch.dart:247:55)
#1      Source.getTextLine (package:kernel/ast.dart:8762:42)
#2      getSourceLine (package:front_end/src/fasta/messages.dart:27:9)
#3      format (package:front_end/src/fasta/command_line_reporting.dart:88:27)
#4      ProcessedOptions.format (package:front_end/src/base/processed_options.dart:203:9)
#5      ProcessedOptions.report (package:front_end/src/base/processed_options.dart:224:29)
#6      CompilerContext.report (package:front_end/src/fasta/compiler_context.dart:69:13)
#7      Loader.addMessage (package:front_end/src/fasta/loader.dart:320:20)
#8      Loader.addProblem (package:front_end/src/fasta/loader.dart:282:12)
#9      LibraryBuilderImpl.addProblem (package:front_end/src/fasta/builder/library_builder.dart:284:19)
#10     SourceLibraryBuilder.addProblem (package:front_end/src/fasta/source/source_library_builder.dart:1325:47)
#11     SourceLoader.tokenize (package:front_end/src/fasta/source/source_loader.dart:292:17)
<asynchronous suspension>
#12     SourceLoader.buildOutline (package:front_end/src/fasta/source/source_loader.dart:332:26)
#13     Loader.buildOutlines (package:front_end/src/fasta/loader.dart:250:13)
#14     KernelTarget.buildOutlines.<anonymous closure> (package:front_end/src/fasta/kernel/kernel_target.dart:292:20)
#15     withCrashReporting (package:front_end/src/fasta/crash.dart:122:24)
#16     KernelTarget.buildOutlines (package:front_end/src/fasta/kernel/kernel_target.dart:291:12)
#17     generateKernelInternal.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart:99:28)
<asynchronous suspension>
#18     generateKernelInternal.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart)
#19     withCrashReporting (package:front_end/src/fasta/crash.dart:122:24)
#20     generateKernelInternal (package:front_end/src/kernel_generator_impl.dart:70:10)
#21     generateKernel.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart:50:18)
#22     CompilerContext.runWithOptions.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:135:20)
<asynchronous suspension>
#23     CompilerContext.runWithOptions.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart)
#24     CompilerContext.runInContext.<anonymous closure>.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:123:46)
#25     new Future.sync (dart:async/future.dart:224:31)
#26     CompilerContext.runInContext.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:123:19)
#27     _rootRun (dart:async/zone.dart:1184:13)
#28     _CustomZone.run (dart:async/zone.dart:1077:19)
#29     _runZoned (dart:async/zone.dart:1619:10)
#30     runZoned (dart:async/zone.dart:1539:10)
#31     CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:122:12)
#32     CompilerContext.runWithOptions (package:front_end/src/fasta/compiler_context.dart:133:10)
#33     generateKernel (package:front_end/src/kernel_generator_impl.dart:49:32)
#34     kernelForModule (package:front_end/src/api_prototype/kernel_generator.dart:99:17)
#35     SingleShotCompilerWrapper.compileInternal (file:///b/s/w/ir/cache/builder/sdk/pkg/vm/bin/kernel_service.dart:400:17)
#36     Compiler.compile.<anonymous closure> (file:///b/s/w/ir/cache/builder/sdk/pkg/vm/bin/kernel_service.dart:168:45)
#37     new Future.<anonymous closure> (dart:async/future.dart:176:37)
#38     _rootRun (dart:async/zone.dart:1180:38)
#39     _CustomZone.run (dart:async/zone.dart:1077:19)
#40     _CustomZone.runGuarded (dart:async/zone.dart:979:7)
#41     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1019:23)
#42     _rootRun (dart:async/zone.dart:1184:13)
#43     _CustomZone.run (dart:async/zone.dart:1077:19)
#44     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:1003:23)
#45     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:23:15)
#46     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)
#47     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)
#48     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

Crash when compiling file:///home/nikolay.seliverstov/Projects/Sunburst-template/utils_mac/upload.dart,
at character offset 257823:
RangeError (index): Invalid value: Not in range 0..257925, inclusive: 258051
#0      _StringBase.[] (dart:core-patch/string_patch.dart:247:55)
#1      Source.getTextLine (package:kernel/ast.dart:8762:42)
#2      getSourceLine (package:front_end/src/fasta/messages.dart:27:9)
#3      format (package:front_end/src/fasta/command_line_reporting.dart:88:27)
#4      ProcessedOptions.format (package:front_end/src/base/processed_options.dart:203:9)
#5      ProcessedOptions.report (package:front_end/src/base/processed_options.dart:224:29)
#6      CompilerContext.report (package:front_end/src/fasta/compiler_context.dart:69:13)
#7      Loader.addMessage (package:front_end/src/fasta/loader.dart:320:20)
#8      Loader.addProblem (package:front_end/src/fasta/loader.dart:282:12)
#9      LibraryBuilderImpl.addProblem (package:front_end/src/fasta/builder/library_builder.dart:284:19)
#10     SourceLibraryBuilder.addProblem (package:front_end/src/fasta/source/source_library_builder.dart:1325:47)
#11     SourceLoader.tokenize (package:front_end/src/fasta/source/source_loader.dart:292:17)
<asynchronous suspension>
#12     SourceLoader.buildOutline (package:front_end/src/fasta/source/source_loader.dart:332:26)
#13     Loader.buildOutlines (package:front_end/src/fasta/loader.dart:250:13)
#14     KernelTarget.buildOutlines.<anonymous closure> (package:front_end/src/fasta/kernel/kernel_target.dart:292:20)
#15     withCrashReporting (package:front_end/src/fasta/crash.dart:122:24)
#16     KernelTarget.buildOutlines (package:front_end/src/fasta/kernel/kernel_target.dart:291:12)
#17     generateKernelInternal.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart:99:28)
<asynchronous suspension>
#18     generateKernelInternal.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart)
#19     withCrashReporting (package:front_end/src/fasta/crash.dart:122:24)
#20     generateKernelInternal (package:front_end/src/kernel_generator_impl.dart:70:10)
#21     generateKernel.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart:50:18)
#22     CompilerContext.runWithOptions.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:135:20)
<asynchronous suspension>
#23     CompilerContext.runWithOptions.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart)
#24     CompilerContext.runInContext.<anonymous closure>.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:123:46)
#25     new Future.sync (dart:async/future.dart:224:31)
#26     CompilerContext.runInContext.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:123:19)
#27     _rootRun (dart:async/zone.dart:1184:13)
#28     _CustomZone.run (dart:async/zone.dart:1077:19)
#29     _runZoned (dart:async/zone.dart:1619:10)
#30     runZoned (dart:async/zone.dart:1539:10)
#31     CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:122:12)
#32     CompilerContext.runWithOptions (package:front_end/src/fasta/compiler_context.dart:133:10)
#33     generateKernel (package:front_end/src/kernel_generator_impl.dart:49:32)
#34     kernelForModule (package:front_end/src/api_prototype/kernel_generator.dart:99:17)
#35     SingleShotCompilerWrapper.compileInternal (file:///b/s/w/ir/cache/builder/sdk/pkg/vm/bin/kernel_service.dart:400:17)
#36     Compiler.compile.<anonymous closure> (file:///b/s/w/ir/cache/builder/sdk/pkg/vm/bin/kernel_service.dart:168:45)
#37     new Future.<anonymous closure> (dart:async/future.dart:176:37)
#38     _rootRun (dart:async/zone.dart:1180:38)
#39     _CustomZone.run (dart:async/zone.dart:1077:19)
#40     _CustomZone.runGuarded (dart:async/zone.dart:979:7)
#41     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1019:23)
#42     _rootRun (dart:async/zone.dart:1184:13)
#43     _CustomZone.run (dart:async/zone.dart:1077:19)
#44     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:1003:23)
#45     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:23:15)
#46     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)
#47     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)
#48     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)


#0      format (package:front_end/src/fasta/command_line_reporting.dart:99:5)
#1      ProcessedOptions.format (package:front_end/src/base/processed_options.dart:203:9)
#2      ProcessedOptions.report (package:front_end/src/base/processed_options.dart:224:29)
#3      CompilerContext.report (package:front_end/src/fasta/compiler_context.dart:69:13)
#4      Loader.addMessage (package:front_end/src/fasta/loader.dart:320:20)
#5      Loader.addProblem (package:front_end/src/fasta/loader.dart:282:12)
#6      LibraryBuilderImpl.addProblem (package:front_end/src/fasta/builder/library_builder.dart:284:19)
#7      SourceLibraryBuilder.addProblem (package:front_end/src/fasta/source/source_library_builder.dart:1325:47)
#8      SourceLoader.tokenize (package:front_end/src/fasta/source/source_loader.dart:292:17)
<asynchronous suspension>
#9      SourceLoader.buildOutline (package:front_end/src/fasta/source/source_loader.dart:332:26)
#10     Loader.buildOutlines (package:front_end/src/fasta/loader.dart:250:13)
#11     KernelTarget.buildOutlines.<anonymous closure> (package:front_end/src/fasta/kernel/kernel_target.dart:292:20)
#12     withCrashReporting (package:front_end/src/fasta/crash.dart:122:24)
#13     KernelTarget.buildOutlines (package:front_end/src/fasta/kernel/kernel_target.dart:291:12)
#14     generateKernelInternal.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart:99:28)
<asynchronous suspension>
#15     generateKernelInternal.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart)
#16     withCrashReporting (package:front_end/src/fasta/crash.dart:122:24)
#17     generateKernelInternal (package:front_end/src/kernel_generator_impl.dart:70:10)
#18     generateKernel.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart:50:18)
#19     CompilerContext.runWithOptions.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:135:20)
<asynchronous suspension>
#20     CompilerContext.runWithOptions.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart)
#21     CompilerContext.runInContext.<anonymous closure>.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:123:46)
#22     new Future.sync (dart:async/future.dart:224:31)
#23     CompilerContext.runInContext.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:123:19)
#24     _rootRun (dart:async/zone.dart:1184:13)
#25     _CustomZone.run (dart:async/zone.dart:1077:19)
#26     _runZoned (dart:async/zone.dart:1619:10)
#27     runZoned (dart:async/zone.dart:1539:10)
#28     CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:122:12)
#29     CompilerContext.runWithOptions (package:front_end/src/fasta/compiler_context.dart:133:10)
#30     generateKernel (package:front_end/src/kernel_generator_impl.dart:49:32)
#31     kernelForModule (package:front_end/src/api_prototype/kernel_generator.dart:99:17)
#32     SingleShotCompilerWrapper.compileInternal (file:///b/s/w/ir/cache/builder/sdk/pkg/vm/bin/kernel_service.dart:400:17)
#33     Compiler.compile.<anonymous closure> (file:///b/s/w/ir/cache/builder/sdk/pkg/vm/bin/kernel_service.dart:168:45)
#34     new Future.<anonymous closure> (dart:async/future.dart:176:37)
#35     _rootRun (dart:async/zone.dart:1180:38)
#36     _CustomZone.run (dart:async/zone.dart:1077:19)
#37     _CustomZone.runGuarded (dart:async/zone.dart:979:7)
#38     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1019:23)
#39     _rootRun (dart:async/zone.dart:1184:13)
#40     _CustomZone.run (dart:async/zone.dart:1077:19)
#41     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:1003:23)
#42     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:23:15)
#43     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)
#44     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)
#45     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

Not sure if the upload.dart needs to be compiled for Linux specifically.

@vnerozin, you are on Mac, can you please assist with that?

@alex.paramonov, you once mentioned it could be a good idea to port our tooling to Node.js, I think if we do that it will indeed eliminate similar problems.

Yes. In a short-term we can just provide linux snapshot of upload.dart (no dart SDK need to be installed on user machine), and, sure, the best solution is to port datagrok-tools to nodeJs.

I think I’ll start with the first opion. @nikolay.seliverstov, what linux do you use? And do you use package template from UI, or datagrok-tools npm package?

1 Like

I can help with that if you can provide dart source code of the upload file.

I use the package template downloaded from datagrok.ai.

I’m on Ubuntu 18.04 LTS.

uname -a
Linux seliverstovnlu2.arcadia.intranet 5.3.0-53-generic #47~18.04.1-Ubuntu SMP Thu May 7 13:10:50 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Unfortunately currently I’m kinda locked. There is no local tooling and no working git/github integration. I cannot upload my package at datagrok. Can you please help me with that?

https://pastebin.com/ePP0dhc2 here is the source for upload.dart. It needs args, path and archive packages and I recommend to use dart 1.24.3 to run it.

Also I suggest to check “advanced” method of building packages. You need npm and nodejs.
https://datagrok.ai/help/develop/develop#buildable-packages You need to exec just few lines to get package template, and same upload.dart can be used to upload the package.

We will add linux support to datagrok-tools npm package shortly as well as to package-template from public.datagrok.ai

1 Like

Many thanks, Alex!

Would you mind if I would use ts-node + Typescript as scripting language/runtime? Is vanilla JS/node preferable?

Hmm, personally I don’t mind :slight_smile:
But we use JS inside API, and entry point (package.js) must comply with our conventions.

What do you mean? I don’t see package.js for the tools folder. Only package.json is there.

Ok, let me download Ubuntu VM, and I will build upload.dart for Linux and place it inside datagrok-tools.
Or, if you already downloaded SDK and source code – I will highly appreciate if you run

dart --snapshot=upload_snapshot.dart upload.dart

and send me upload_snapshot and your dart binary :slight_smile:

I’m talking about Datagrok package, not the datagrok-tools.
Oh, I misunderstood you. I’m not sure if datagrok-tools will work with this runtime, we didn’t test it in such config.

I can do that, sure.

Are you sure that could be done without package management matadata? It fails with the error

Could not resolve a package location for base

It would work. The main requirement is still node js. Then when you do npm install ts-node gets installed as dev-dependency and after that we can directly run typescript without compilation of typescript sources.

name: upload
version: 0.0.1

environment:
  sdk: '>=1.0.0 <2.0.0'

dependencies:
  archive: any
  args: any 
  path: any

You can use this as pubspec.yaml
I guess you need to run pub get first, and then try to make a snapshot

Then, I don’t see any problems here. At least, you can try.

I’ve compiled it. Can you please share your email?

aparamonov@datagrok.ai