How does one use reify from the REPL in trunk?

46 views
Skip to first unread message

Paul Butcher

unread,
Sep 18, 2012, 4:41:35 AM9/18/12
to scala-i...@googlegroups.com
Subject line says it all - this used to work in M6, but in the most recent trunk, I get:

Welcome to Scala version 2.10.0-20120806-133428-114367c0b2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_35).
Type in expressions to have them evaluated.
Type :help for more information.

scala> reflect.runtime.universe.reify("foo")
<console>:8: error: type mismatch;
 found   : $u.Expr[String("foo")]
 required: reflect.runtime.universe.Expr[String]
              reflect.runtime.universe.reify("foo")
                                            ^

--
paul.butcher->msgCount++

Snetterton, Castle Combe, Cadwell Park...
Who says I have a one track mind?

http://www.paulbutcher.com/
LinkedIn: http://www.linkedin.com/in/paulbutcher
MSN: pa...@paulbutcher.com
AIM: paulrabutcher
Skype: paulrabutcher

Eugene Burmako

unread,
Sep 18, 2012, 4:44:38 AM9/18/12
to <scala-internals@googlegroups.com>
Wow. I'm speechless...


Paul Phillips

unread,
Sep 18, 2012, 4:48:39 AM9/18/12
to scala-i...@googlegroups.com
On Tue, Sep 18, 2012 at 1:41 AM, Paul Butcher <pa...@paulbutcher.com> wrote:
> Welcome to Scala version 2.10.0-20120806-133428-114367c0b2 (Java HotSpot(TM)
> 64-Bit Server VM, Java 1.6.0_35).

% git log --oneline 114367c0b2..master | wc -l
554

Interesting idea of "most recent trunk" ...

Paul Butcher

unread,
Sep 18, 2012, 4:49:32 AM9/18/12
to scala-i...@googlegroups.com
On 18 Sep 2012, at 09:44, Eugene Burmako <eugene....@epfl.ch> wrote:

Wow. I'm speechless...

Should I report this as a bug then? :-)

Eugene Burmako

unread,
Sep 18, 2012, 4:50:05 AM9/18/12
to <scala-internals@googlegroups.com>
Most definitely. Make it a blocker please


Paul Butcher

unread,
Sep 18, 2012, 4:50:27 AM9/18/12
to scala-i...@googlegroups.com
Ah - apologies - I thought that using SNAPSHOT in SBT would always get me the most recent? Clearly I was labouring under a misapprehension.

Paul Butcher

unread,
Sep 18, 2012, 4:54:10 AM9/18/12
to scala-i...@googlegroups.com
On 18 Sep 2012, at 09:50, Paul Butcher <pa...@paulbutcher.com> wrote:

Ah - apologies - I thought that using SNAPSHOT in SBT would always get me the most recent? Clearly I was labouring under a misapprehension.

In fact, now that I look at it, it's not downloaded a new snapshot for *ages*. How the hell *do* you tell SBT to get the most recent?!

Eugene Burmako

unread,
Sep 18, 2012, 4:54:19 AM9/18/12
to scala-i...@googlegroups.com
Wait a second. I can't reproduce this. Could you please check with the very latest nightly?

Yesterday I saw something similar, but assume the problem there was due to existentials. Therefore I became so agitated without even checking.

√iktor Ҡlang

unread,
Sep 18, 2012, 4:55:00 AM9/18/12
to scala-i...@googlegroups.com
On Tue, Sep 18, 2012 at 10:54 AM, Paul Butcher <pa...@paulbutcher.com> wrote:
On 18 Sep 2012, at 09:50, Paul Butcher <pa...@paulbutcher.com> wrote:

Ah - apologies - I thought that using SNAPSHOT in SBT would always get me the most recent? Clearly I was labouring under a misapprehension.

In fact, now that I look at it, it's not downloaded a new snapshot for *ages*. How the hell *do* you tell SBT to get the most recent?!

Let me repeat my old saying: "SNAPSHOTs are the Devil"
 

--
paul.butcher->msgCount++

Snetterton, Castle Combe, Cadwell Park...
Who says I have a one track mind?

http://www.paulbutcher.com/
LinkedIn: http://www.linkedin.com/in/paulbutcher
MSN: pa...@paulbutcher.com
AIM: paulrabutcher
Skype: paulrabutcher




--
Viktor Klang

Akka Tech Lead
Typesafe - The software stack for applications that scale

Twitter: @viktorklang

Paul Butcher

unread,
Sep 18, 2012, 4:56:29 AM9/18/12
to scala-i...@googlegroups.com
On 18 Sep 2012, at 09:54, Eugene Burmako <eugene....@epfl.ch> wrote:

Wait a second. I can't reproduce this. Could you please check with the very latest nightly?

Yesterday I saw something similar, but assume the problem there was due to existentials. Therefore I became so agitated without even checking.

Sorry Eugene - I think that this is SBT screwing me up. I naively (clearly) imagined that if I told it to use SNAPSHOT I would get the most recently version. Clearly not.

Please (please!) tell me that there's some way to do this *without* compiling the compiler myself?!

Eugene Burmako

unread,
Sep 18, 2012, 4:59:20 AM9/18/12
to scala-i...@googlegroups.com
I know almost nothing about sbt, but maybe "sbt update"? If that doesn't help, how about deleting the entire .sbt and .ivy2? :)

√iktor Ҡlang

unread,
Sep 18, 2012, 5:01:37 AM9/18/12
to scala-i...@googlegroups.com
On Tue, Sep 18, 2012 at 10:59 AM, Eugene Burmako <eugene....@epfl.ch> wrote:
I know almost nothing about sbt, but maybe "sbt update"? If that doesn't help, how about deleting the entire .sbt and .ivy2? :)

rm -rf ~/.sbt/boot/scala-2.10.0-SNAPSHOT
 


On 18 September 2012 10:56, Paul Butcher <pa...@paulbutcher.com> wrote:
On 18 Sep 2012, at 09:54, Eugene Burmako <eugene....@epfl.ch> wrote:

Wait a second. I can't reproduce this. Could you please check with the very latest nightly?

Yesterday I saw something similar, but assume the problem there was due to existentials. Therefore I became so agitated without even checking.

Sorry Eugene - I think that this is SBT screwing me up. I naively (clearly) imagined that if I told it to use SNAPSHOT I would get the most recently version. Clearly not.

Please (please!) tell me that there's some way to do this *without* compiling the compiler myself?!

--
paul.butcher->msgCount++

Snetterton, Castle Combe, Cadwell Park...
Who says I have a one track mind?

http://www.paulbutcher.com/
LinkedIn: http://www.linkedin.com/in/paulbutcher
MSN: pa...@paulbutcher.com
AIM: paulrabutcher
Skype: paulrabutcher


Kevin Wright

unread,
Sep 18, 2012, 5:02:19 AM9/18/12
to scala-i...@googlegroups.com
You add `changing()` at the end of the import declaration, but I've also discovered that SBT doesn't correctly update the artefact's maven metadata when deploying snapshots.  A certain amount of hackery is almost always required when deploying (depending on whether you use nexus/artifactory/etc.)

Just go with milestones if you can - it makes life *much* easier!

Paul Butcher

unread,
Sep 18, 2012, 5:05:32 AM9/18/12
to scala-i...@googlegroups.com
On 18 Sep 2012, at 10:02, Kevin Wright <kev.lee...@gmail.com> wrote:

Just go with milestones if you can - it makes life *much* easier!

I'd love to go with milestones, but I'm trying to get ScalaMock to work with Eugene's latest changes (I learned the hard way between M6 and M7 that waiting for a milestone was a bad plan).

So the moral of the story seems to be that SBT is just broken with snapshots :-( I'm frankly amazed - searching for SNAPSHOT in the SBT mailing list shows up *many* threads with people complaining about the problem, most of them with *no* answers whatsoever - for example:


Speechless.

I'll resort to local Scala builds, I guess. What a massive pain in the arse.

Kevin Wright

unread,
Sep 18, 2012, 5:07:57 AM9/18/12
to scala-i...@googlegroups.com
On 18 September 2012 10:05, Paul Butcher <pa...@paulbutcher.com> wrote:
On 18 Sep 2012, at 10:02, Kevin Wright <kev.lee...@gmail.com> wrote:

Just go with milestones if you can - it makes life *much* easier!

I'd love to go with milestones, but I'm trying to get ScalaMock to work with Eugene's latest changes (I learned the hard way between M6 and M7 that waiting for a milestone was a bad plan).

So the moral of the story seems to be that SBT is just broken with snapshots :-( I'm frankly amazed - searching for SNAPSHOT in the SBT mailing list shows up *many* threads with people complaining about the problem, most of them with *no* answers whatsoever - for example:


Speechless.

I'll resort to local Scala builds, I guess. What a massive pain in the arse.


Yeah, most of the problem is actually at deployment time.  Folk often miss that part. 

√iktor Ҡlang

unread,
Sep 18, 2012, 5:09:03 AM9/18/12
to scala-i...@googlegroups.com
On Tue, Sep 18, 2012 at 11:05 AM, Paul Butcher <pa...@paulbutcher.com> wrote:
On 18 Sep 2012, at 10:02, Kevin Wright <kev.lee...@gmail.com> wrote:

Just go with milestones if you can - it makes life *much* easier!

I'd love to go with milestones, but I'm trying to get ScalaMock to work with Eugene's latest changes (I learned the hard way between M6 and M7 that waiting for a milestone was a bad plan).

So the moral of the story seems to be that SBT is just broken with snapshots :-( I'm frankly amazed - searching for SNAPSHOT in the SBT mailing list shows up *many* threads with people complaining about the problem, most of them with *no* answers whatsoever - for example:


Speechless.

I'll resort to local Scala builds, I guess. What a massive pain in the arse.


The entire _idea_ of snapshots is broken. It's like a var to a dependency.

Cheers,
 

--
paul.butcher->msgCount++

Snetterton, Castle Combe, Cadwell Park...
Who says I have a one track mind?

http://www.paulbutcher.com/
LinkedIn: http://www.linkedin.com/in/paulbutcher
MSN: pa...@paulbutcher.com
AIM: paulrabutcher
Skype: paulrabutcher

Martin Grigorov

unread,
Sep 18, 2012, 5:16:11 AM9/18/12
to scala-i...@googlegroups.com
On Tue, Sep 18, 2012 at 12:09 PM, √iktor Ҡlang <viktor...@gmail.com> wrote:
>
>
> On Tue, Sep 18, 2012 at 11:05 AM, Paul Butcher <pa...@paulbutcher.com> wrote:
>>
>> On 18 Sep 2012, at 10:02, Kevin Wright <kev.lee...@gmail.com> wrote:
>>
>> Just go with milestones if you can - it makes life *much* easier!
>>
>>
>> I'd love to go with milestones, but I'm trying to get ScalaMock to work
>> with Eugene's latest changes (I learned the hard way between M6 and M7 that
>> waiting for a milestone was a bad plan).
>>
>> So the moral of the story seems to be that SBT is just broken with
>> snapshots :-( I'm frankly amazed - searching for SNAPSHOT in the SBT mailing
>> list shows up *many* threads with people complaining about the problem, most
>> of them with *no* answers whatsoever - for example:
>>
>> https://groups.google.com/d/topic/simple-build-tool/tYwXAikPpSs/discussion
>>
>> Speechless.
>>
>> I'll resort to local Scala builds, I guess. What a massive pain in the
>> arse.
>
>
>
> The entire _idea_ of snapshots is broken. It's like a var to a dependency.

So far it worked well for many Maven based projects. I had the same
problem and solved it successfully with scala-maven-plugin. It works
for me. Maybe it wont work for you ...

@Paul Butcher: you may download the latest builds with some script.
See https://gist.github.com/3740024 for example. Do this once per day.
It should save you some time.

iulian dragos

unread,
Sep 18, 2012, 5:29:52 AM9/18/12
to scala-i...@googlegroups.com
On Tue, Sep 18, 2012 at 11:05 AM, Paul Butcher <pa...@paulbutcher.com> wrote:
On 18 Sep 2012, at 10:02, Kevin Wright <kev.lee...@gmail.com> wrote:

Just go with milestones if you can - it makes life *much* easier!

I'd love to go with milestones, but I'm trying to get ScalaMock to work with Eugene's latest changes (I learned the hard way between M6 and M7 that waiting for a milestone was a bad plan).

So the moral of the story seems to be that SBT is just broken with snapshots :-( I'm frankly amazed - searching for SNAPSHOT in the SBT mailing list shows up *many* threads with people complaining about the problem, most of them with *no* answers whatsoever - for example:

I don't know the solution for SNAPSHOTs in general, but Scala is anyway treated specially. To do it the clean way, use 'reboot full' and then 'compile'. This deletes .sbt and re-downloads the Scala compiler, so if your scalaVersion is -SNAPSHOT it will get the latest one.

iulian
 


Speechless.

I'll resort to local Scala builds, I guess. What a massive pain in the arse.

--
paul.butcher->msgCount++

Snetterton, Castle Combe, Cadwell Park...
Who says I have a one track mind?

http://www.paulbutcher.com/
LinkedIn: http://www.linkedin.com/in/paulbutcher
MSN: pa...@paulbutcher.com
AIM: paulrabutcher
Skype: paulrabutcher




--
« Je déteste la montagne, ça cache le paysage »
Alphonse Allais

√iktor Ҡlang

unread,
Sep 18, 2012, 5:42:43 AM9/18/12
to scala-i...@googlegroups.com
On Tue, Sep 18, 2012 at 11:16 AM, Martin Grigorov <martin....@gmail.com> wrote:
On Tue, Sep 18, 2012 at 12:09 PM, √iktor Ҡlang <viktor...@gmail.com> wrote:
>
>
> On Tue, Sep 18, 2012 at 11:05 AM, Paul Butcher <pa...@paulbutcher.com> wrote:
>>
>> On 18 Sep 2012, at 10:02, Kevin Wright <kev.lee...@gmail.com> wrote:
>>
>> Just go with milestones if you can - it makes life *much* easier!
>>
>>
>> I'd love to go with milestones, but I'm trying to get ScalaMock to work
>> with Eugene's latest changes (I learned the hard way between M6 and M7 that
>> waiting for a milestone was a bad plan).
>>
>> So the moral of the story seems to be that SBT is just broken with
>> snapshots :-( I'm frankly amazed - searching for SNAPSHOT in the SBT mailing
>> list shows up *many* threads with people complaining about the problem, most
>> of them with *no* answers whatsoever - for example:
>>
>> https://groups.google.com/d/topic/simple-build-tool/tYwXAikPpSs/discussion
>>
>> Speechless.
>>
>> I'll resort to local Scala builds, I guess. What a massive pain in the
>> arse.
>
>
>
> The entire _idea_ of snapshots is broken. It's like a var to a dependency.

So far it worked well for many Maven based projects. I had the same
problem and solved it successfully with scala-maven-plugin. It works
for me. Maybe it wont work for you ...

So when I check out an old commit in that codebase and try to build the project, it loads the _last_ SNAPSHOT that the project dependency released,
which very normally is binary incompatible since the entire purpose of SNAPSHOTs is "work-in-progress".

Now, you might think that building old versions should be something that breaks, but I think that is really bad. Hence I think that SNAPSHOT artifacts (i.e. dependency vars) is broken.

Cheers,
 

@Paul Butcher: you may download the latest builds with some script.
See https://gist.github.com/3740024 for example. Do this once per day.
It should save you some time.

>
> Cheers,
> √
>
>>
>>
>> --
>> paul.butcher->msgCount++
>>
>> Snetterton, Castle Combe, Cadwell Park...
>> Who says I have a one track mind?
>>
>> http://www.paulbutcher.com/
>> LinkedIn: http://www.linkedin.com/in/paulbutcher
>> MSN: pa...@paulbutcher.com
>> AIM: paulrabutcher
>> Skype: paulrabutcher
>>
>
>
>
> --
> Viktor Klang
>
> Akka Tech Lead
> Typesafe - The software stack for applications that scale
>
> Twitter: @viktorklang
>

Martin Grigorov

unread,
Sep 18, 2012, 6:05:43 AM9/18/12
to scala-i...@googlegroups.com
Hi Viktor,

In case you need to debug an old version you can always set
temporarily a timestamp version (something like: 20120816-234510). At
least this is what Maven does - it resolves -SNAPSHOT as the latest
deployed timestamp version.

For example if you have a big app that uses the latest features of
Akka 2.1 and you want to verify that your new code in Akka 2.1 is
actually usable before releasing its final version you will set the
app to follow Akka's latest build (the snapshot).
This approach works very well if you know the internals of the
library, otherwise it will slow you down trying to find what change in
the library broke your app.

Since this is off-topic for this mailing list I wont contribute more to it.
Feel free to contact me directly if you want to discuss more.

√iktor Ҡlang

unread,
Sep 18, 2012, 6:11:21 AM9/18/12
to scala-i...@googlegroups.com
Yes, timestamped/individually versioned (write-once) versions are preferable to snapshots.
To me, snapshots is the lowest form of version. Avoid it.

Cheers,

Josh Suereth

unread,
Sep 18, 2012, 7:21:35 AM9/18/12
to scala-i...@googlegroups.com

I think most of this is fixed in upcoming sbt, which is great news for us all.

Sbt treats scala different from any other dependency right now, and so it stinks for snapshots.

Note: do you want scalamock in the community nightlies?  These have enough sbt hackery to always build correctly against current scala nightly,  although "using at home" is not seamless yet.

Paul Butcher

unread,
Sep 18, 2012, 1:27:26 PM9/18/12
to scala-i...@googlegroups.com
On 18 Sep 2012, at 12:21, Josh Suereth <joshua....@gmail.com> wrote:

Note: do you want scalamock in the community nightlies?  These have enough sbt hackery to always build correctly against current scala nightly,  although "using at home" is not seamless yet.

Ultimately, that would be great - but not until I've fixed it to work again. It worked fine with M6, but the changes in M7 killed it. I've finally found time to look at it again, hence this e-mail thread :-)

Reply all
Reply to author
Forward
0 new messages