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

.packages: Eliminate symlinks, phase two #24112

Closed
8 tasks done
mit-mit opened this issue Aug 18, 2015 · 23 comments
Closed
8 tasks done

.packages: Eliminate symlinks, phase two #24112

mit-mit opened this issue Aug 18, 2015 · 23 comments
Assignees
Labels
area-meta Cross-cutting, high-level issues (for tracking many other implementation issues, ...). P1 A high priority bug; for example, a single project is unusable or has many test failures type-enhancement A request for a change that isn't a bug
Milestone

Comments

@mit-mit
Copy link
Member

mit-mit commented Aug 18, 2015

This bug tracks completing the work we started in 1.12 to eliminate symlinks (see previous work here: #23372). The goal of this second phase is to ensure that our whole SDK tool chain works even when no packages directory is present.

Concrete work items are:

Ensure the base SDK tools work great after a user uses pub's --no-package-symlinks:

Then:

Then:

Then:

Finally, ensure the higher-level tools work great if there is no packages/ directory. That work is tracked here: #24288

@mit-mit mit-mit added P1 A high priority bug; for example, a single project is unusable or has many test failures Type-Enhancement area-meta Cross-cutting, high-level issues (for tracking many other implementation issues, ...). labels Aug 18, 2015
@mit-mit mit-mit added this to the 1.13 milestone Aug 18, 2015
@sethladd sethladd changed the title Complete support for .packages Eliminate symlinks Aug 18, 2015
@mit-mit
Copy link
Member Author

mit-mit commented Sep 1, 2015

@sethladd , can you take a look at the task list to check that we got everything?

@sethladd
Copy link
Contributor

sethladd commented Sep 3, 2015

@nex3 I'd like to open a few issues for pub on this topic, but I know pub is on the end of a chain of other prerequisite changes. The new issues will simply help us understand the scope of what we need to do for symlink elimination. Thanks!

@nex3
Copy link
Member

nex3 commented Sep 8, 2015

I closed dart-lang/pub#1331 and removed it from the list above because it's based on a misunderstanding: pub serve doesn't rely on symlinks, and never has. I believe the only place that pub ever actually consumed symlinks (as opposed to generating them) was pub run when it spawned a child process, and that was changed to .packages in dart-lang/pub@097ed87.

The actual title for dart-lang/pub#727 was always kind of misleading—it talks about not consuming on symlinks, but the discussion in the issue is actually about what it would take to not generate them. Maybe we should change the name to something like "Don't generate symlinks"?

@sethladd
Copy link
Contributor

Maybe we should change the name to something like "Don't generate symlinks"?

Sure thing. Done and done!

So, is there anything you'll need before you can stop generating symlinks, which isn't covered in this issue above?

@nex3
Copy link
Member

nex3 commented Sep 10, 2015

It looks like there isn't a list item up there for accessing resolved package URIs—something like #23990 or this CL will be necessary to make it possible for packages (including test) to locate resources reliably and efficiently.

@sethladd
Copy link
Contributor

My impression was that #24022 would be sufficient.

@nex3
Copy link
Member

nex3 commented Sep 10, 2015

#24022 is very important for starting subprocesses with the right package information, but it's not a good fit for finding resources in an existing process. It only works if a package spec is being used, it requires extra IO and parsing, and it won't work with internal Google infrastructure.

@sethladd
Copy link
Contributor

It only works if a package spec is being used

But you can use packageRoot otherwise, yes?

@nex3
Copy link
Member

nex3 commented Sep 10, 2015

Not currently—the getter is only set if the user passed it explicitly on the command line, so if it was implicitly detected based on the entrypoint's location that's not reliable. I'm not sure whether #19430 will change that or not.

@sethladd
Copy link
Contributor

so if it was implicitly detected based on the entrypoint's location that's not reliable

Ah ha, I understand now. Thanks for the additional context.

@sethladd
Copy link
Contributor

@nex3 talking to @iposva-google it sounds like #19430 should be sufficient. Will follow up over there.

@nex3
Copy link
Member

nex3 commented Sep 10, 2015

Okay, but we'll still need resolved package URIs.

@sethladd
Copy link
Contributor

but we'll still need resolved package URIs.

If you had a combination of packageRoot and packageSpec/Map, could you not constract how a package: URI is resolved? In fact, could you not do this in a package that you built yourself?

@nex3
Copy link
Member

nex3 commented Sep 10, 2015

As I said above, it requires extra IO and parsing and won't work with Google's internal infrastructure.

@sethladd
Copy link
Contributor

won't work with Google's internal infrastructure.

So there's no packageRoot or packageMap/Spec in internal google infrastructure? Both would be null, in all cases for internal google infrastructure?

cc @cbracken who might be able to help provide perspective

@cbracken
Copy link
Member

Under google infra, we construct a "flattened" package farm directory, including pubspec.yaml, pubspec.lock, and .packages files for each package in the transitive closure of deps. If the question is whether we can run entirely without the packages/ dirs, I'd imagine it shouldn't be significantly different from externally.

@nex3
Copy link
Member

nex3 commented Sep 11, 2015

@cbracken How does dart path/to/file.dart work internally?

@cbracken
Copy link
Member

VM 'binary' builds emit two things. For an app named foo, we emit:

  1. a small shell script named foo
  2. a tree of all required dep srcs/assets/etc. named foo.runfiles. This includes the vm and anything else necessary for the script to run.

First thing the foo script does on startup is create a tempdir in which it constructs a package-root layout from the srcs in foo.runfiles. It then invokes foo.runfiles/path/to/sdk/dart --package-root=/tmp/sometmpdir foo.runfiles/path/to/file.dart.

There are very minor differences if we're working with snapshots, but they're pretty much what you'd expect given the above.

@mit-mit mit-mit changed the title Eliminate symlinks, phase two .packages: Eliminate symlinks, phase two Oct 20, 2015
@mit-mit mit-mit assigned kevmoo and unassigned sethladd Oct 21, 2015
@kevmoo kevmoo modified the milestones: 1.14, 1.13 Oct 22, 2015
@nex3
Copy link
Member

nex3 commented Oct 29, 2015

I updated the main issue to reflect my understanding of the current plan.

@mit-mit mit-mit modified the milestones: 1.14, 1.15 Jan 29, 2016
@mit-mit mit-mit modified the milestones: 1.15, 1.16 Mar 1, 2016
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
@kevmoo kevmoo modified the milestone: 1.16 Apr 19, 2016
@bp74
Copy link

bp74 commented May 27, 2016

We haven't heard about the "eliminate symlinks" undertaking for quite some time. Is this feature postponed or canceled? I ask because i just deleted a lot of my source code AGAIN by simply deleting a packages symlink in WebStorm.

@mit-mit
Copy link
Member Author

mit-mit commented May 27, 2016

Sorry for the seemingly lack of progress. We are still working on it, but we realized that we needed more investigation and testing before we felt confident releasing this. Hopefully we will be able to launch this fairly soon!

@kevmoo
Copy link
Member

kevmoo commented Aug 17, 2016

Closed by 38dccc8

🎉

@kevmoo kevmoo closed this as completed Aug 17, 2016
@sethladd
Copy link
Contributor

Hurray!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-meta Cross-cutting, high-level issues (for tracking many other implementation issues, ...). P1 A high priority bug; for example, a single project is unusable or has many test failures type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

6 participants