Skip to content

package-root bug in dart2js: import a file with a 'package:' and a relative URL #3147

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

Closed
sigmundch opened this issue May 19, 2012 · 10 comments
Closed
Assignees
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures web-dart2js

Comments

@sigmundch
Copy link
Member

When importing a file with 'package:' the file should resolve to the same library as if it was imported with a relative URL.

Example to repro this error:
./out/Release_ia32/frog/bin/frog --package-root=./ a.dart

Where a.dart is:

library("a");

import('b.dart', prefix: 'b1');

import('b.dart', prefix: 'b2');

import('package:b.dart', prefix: 'b3');

main() {
  print("${b1.x === b2.x} ${b1.x === b3.x}");
}

And b.dart is:

library("b");

class X {
  const X();
}
final X x = const X();

@sigmundch
Copy link
Member Author

On that example: the program should print "true true", but prints "true false"

@iposva-google
Copy link
Contributor

See discussion in issue #3148.

@sigmundch
Copy link
Member Author

Following up after the discussion in issue #3148.

Running:
./out/Release_ia32/frog/bin/frog --package-root=./ a.dart

should print 'true false' as it does today, but
./out/Release_ia32/frog/bin/frog --package-root=./ 'package:a.dart'

should print 'true true'.

Equivalently if we add a third file 'c.dart' with this contents:

#library('c');
#import('package:a.dart');

Then I expect to have 'true true' when I call
./out/Release_ia32/frog/bin/frog --package-root=./ c.dart

@anders-sandholm
Copy link
Contributor

Removed Area-Frog label.
Added Area-Dart2JS, OldAreaFrog labels.

@anders-sandholm
Copy link
Contributor

Removed OldAreaFrog label.
Added FromAreaFrog label.

@anders-sandholm
Copy link
Contributor

Verified that dart2js has the same behavior as described in the issue for Frog.


Removed FromAreaFrog label.
Changed the title to: "package-root bug in dart2js: import a file with a 'package:' and a relative URL".

@sigmundch
Copy link
Member Author

Removed Priority-Medium label.
Added Priority-High label.

@kasperl
Copy link

kasperl commented Jun 13, 2012

Nicolas, do you have time to take a look at this?


Set owner to [email protected].
Added Accepted label.

@peter-ahe-google
Copy link
Contributor

CL here: https://chromiumcodereview.appspot.com/10533123/


Set owner to @peter-ahe-google.
Added Started label.

@peter-ahe-google
Copy link
Contributor

Fixed in r8606


Added Fixed label.

@sigmundch sigmundch added Type-Defect P1 A high priority bug; for example, a single project is unusable or has many test failures web-dart2js labels Jun 13, 2012
copybara-service bot pushed a commit that referenced this issue Oct 15, 2021
The pub client still won't send analytics with this PR. (This will be
enabled in a follow-up).

Changes:
```
> git log --format="%C(auto) %h %s" 0764437..35681b0
 https://dart.googlesource.com/pub.git/+/35681b01 Analytics (#2778)
 https://dart.googlesource.com/pub.git/+/9c65d31c Accept 'platforms' property in pubspec.yaml (#3176)
 https://dart.googlesource.com/pub.git/+/1af0de54 Accept 'screenshots' property in pubspec.yaml (#3174)
 https://dart.googlesource.com/pub.git/+/19045b95 Tests related to token authentication (#3147)
 https://dart.googlesource.com/pub.git/+/f36da07f Use applicationConfigHome from package:cli_util (#3164)

```

Diff: https://dart.googlesource.com/pub.git/+/0764437088fd58eb7af779ecef66bab40dfcf2e9~..35681b0126a1fb48bf2062dd09f74296715402c2/
Change-Id: I7313f3125934aba3473b2725074bfc7fd92e25e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217004
Reviewed-by: Jonas Jensen <[email protected]>
Commit-Queue: Sigurd Meldgaard <[email protected]>
copybara-service bot pushed a commit that referenced this issue Sep 13, 2022
…8 revisions)

https://dart.googlesource.com/dartdoc/+log/c64f800bd6a7..b0b0d6ace017

2022-09-13 [email protected] Use toList(growable:false) more (#3151)
2022-09-13 [email protected] Make Warnable.package non-nullable (#3155)
2022-09-13 [email protected] Update scorecard action to v2.0.3 (#3162)
2022-09-13 [email protected] Bump to 6.1.1 (#3161)
2022-09-12 [email protected] Allow analyzer 5.0.0 (#3160)
2022-09-12 [email protected] Make Extension.typeParameters late final (#3150)
2022-09-12 [email protected] Fix HTML of features (#3147)
2022-09-12 [email protected] Improve assert of function typedef (#3158)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-doc-dart-sdk
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Dart Documentation Generator: https://github.com/dart-lang/dartdoc/issues
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Tbr: [email protected]
Change-Id: I96e0843c13d07f35e1bab57cacaddd747f54e00b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259081
Commit-Queue: DEPS Autoroller <[email protected]>
Reviewed-by: Devon Carew <[email protected]>
Commit-Queue: Devon Carew <[email protected]>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures web-dart2js
Projects
None yet
Development

No branches or pull requests

5 participants