Giter Club home page Giter Club logo

Comments (9)

bkonyi avatar bkonyi commented on August 17, 2024

This was changed because google3 makes heavy use of symlinks and CLI artifacts were never guaranteed to be in the same directory as the CLI executable after the symlinks were resolved. Let me take a look, hopefully this is a simple fix.

from sdk.

bkonyi avatar bkonyi commented on August 17, 2024

@dcharkes, I'm unable to reproduce at HEAD:

bkonyi@bkonyi-glinux:~/dart-sdk/sdk/third_party/pkg/native/pkgs/native_assets_cli/example/build/native_add_app$ echo $DART_RELEASE
/usr/local/google/home/bkonyi/dart-sdk/sdk/out/ReleaseX64/dart-sdk/bin/dart
bkonyi@bkonyi-glinux:~/dart-sdk/sdk/third_party/pkg/native/pkgs/native_assets_cli/example/build/native_add_app$ $DART_RELEASE --enable-experiment=native-assets build bin/native_add_app.dart 
Deleting output directory: /usr/local/google/home/bkonyi/dart-sdk/sdk/third_party/pkg/native/pkgs/native_assets_cli/example/build/native_add_app/bin/native_add_app/.
Building native assets.
Writing native_assets.yaml.
Copying 1 build assets: (package:native_add_library/native_add_library.dart)
Generated: /usr/local/google/home/bkonyi/dart-sdk/sdk/third_party/pkg/native/pkgs/native_assets_cli/example/build/native_add_app/bin/native_add_app/native_add_app.exe

Does this SDK need to be downloaded for the issue to be reproduced?

from sdk.

bkonyi avatar bkonyi commented on August 17, 2024

I'm also unable to reproduce with 3.5.0-243.0.dev downloaded from the SDK archives page.

from sdk.

dcharkes avatar dcharkes commented on August 17, 2024

Does this SDK need to be downloaded for the issue to be reproduced?

It's reliably reproducing on the GitHub CI downloading the SDK, see the links in the linked issue. I haven't tried locally.

from sdk.

bkonyi avatar bkonyi commented on August 17, 2024

Does this SDK need to be downloaded for the issue to be reproduced?

It's reliably reproducing on the GitHub CI downloading the SDK, see the links in the linked issue. I haven't tried locally.

Without more insights into the environment (e.g., the directory structure and contents of the unzipped SDK in the context of the GitHub CI), there's unfortunately not much we can do without a reproduction. If there's symlinks involved, that could be problematic, but checkArtifactExists should be able to follow them.

from sdk.

bkonyi avatar bkonyi commented on August 17, 2024

Hm, maybe we should be using FileSystemEntity.typeSync instead of File.existsSync, which appears like it might return false if we're checking the path to a Link object.

from sdk.

dcharkes avatar dcharkes commented on August 17, 2024

Hm, maybe we should be using FileSystemEntity.typeSync instead of File.existsSync, which appears like it might return false if we're checking the path to a Link object.

Ah that could be the case.

The code itself that is failing is fairly simple right. Platform.executable or Platform.resolvedExecutable and then checkArtifactExists that does File(path).existsSync().

Unless someone messed with the current directory that should always be true (except for when it's a symlink as you point out).

It's worth giving it a shot. I don't know how to test this other than landing it, waiting for a dev build and turning the CI back to the latest dev build.

from sdk.

dcharkes avatar dcharkes commented on August 17, 2024

@bkonyi it seems to be still failing on 3.6.0-12.0.dev:

Run dart --enable-experiment=native-assets build bin/native_add_app.dart
  dart --enable-experiment=native-assets build bin/native_add_app.dart
  shell: /usr/bin/bash -e {0}
  env:
    DART_HOME: /opt/hostedtoolcache/dart/3.6.0-12.0.dev/x64
    PUB_CACHE: /home/runner/.pub-cache
Could not find dart. Have you built the full Dart SDK?
Error: Process completed with exit code 255.

https://github.com/dart-lang/native/actions/runs/9853109946/job/27202956400?pr=1271

So the fix unfortunately didn't work.

This was changed because google3 makes heavy use of symlinks and CLI artifacts were never guaranteed to be in the same directory as the CLI executable after the symlinks were resolved. Let me take a look, hopefully this is a simple fix.

In this case it's not a different CLI artifact, it's dart itself.

    if (!Sdk.checkArtifactExists(genKernel) ||
        !Sdk.checkArtifactExists(genSnapshot) ||
        !Sdk.checkArtifactExists(sdk.dart)) {

It's also weird that apparently it is able to find genKernel and genSnapshot.

from sdk.

dcharkes avatar dcharkes commented on August 17, 2024

Does this SDK need to be downloaded for the issue to be reproduced?

It's reliably reproducing on the GitHub CI downloading the SDK, see the links in the linked issue. I haven't tried locally.

Without more insights into the environment (e.g., the directory structure and contents of the unzipped SDK in the context of the GitHub CI), there's unfortunately not much we can do without a reproduction. If there's symlinks involved, that could be problematic, but checkArtifactExists should be able to follow them.

We do own the setup action: https://github.com/dart-lang/setup-dart Maybe someone who contributed to that knows how GitHub uses symlinks. cc @devoncarew

from sdk.

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.